summaryrefslogtreecommitdiff
path: root/test/bootstrap.php
diff options
context:
space:
mode:
Diffstat (limited to 'test/bootstrap.php')
-rw-r--r--test/bootstrap.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/bootstrap.php b/test/bootstrap.php
index 03ad785..41d9026 100644
--- a/test/bootstrap.php
+++ b/test/bootstrap.php
@@ -38,7 +38,7 @@ class MockDifferentPDOStatement extends MockPDOStatement { }
*
*/
class MockPDO extends PDO {
-
+
/**
* Return a dummy PDO statement
*/
@@ -62,3 +62,23 @@ class MockDifferentPDO extends MockPDO {
return $this->last_query;
}
}
+
+class MockMsSqlPDO extends MockPDO {
+
+ public $fake_driver = 'mssql';
+
+ /**
+ * If we are asking for the name of the driver, check if a fake one
+ * has been set.
+ */
+ public function getAttribute($attribute) {
+ if ($attribute == self::ATTR_DRIVER_NAME) {
+ if (!is_null($this->fake_driver)) {
+ return $this->fake_driver;
+ }
+ }
+
+ return parent::getAttribute($attribute);
+ }
+
+}