public function getSupportedDatabases($allowAllDatabases = false) {
$availableDatabases = array(
'sqlite' => array(
- 'type' => 'class',
- 'call' => 'SQLite3',
+ 'type' => 'pdo',
+ 'call' => 'sqlite',
'name' => 'SQLite'
),
'mysql' => array(
$type = $availableDatabases[$database]['type'];
$call = $availableDatabases[$database]['call'];
- if($type === 'class') {
- $working = $this->class_exists($call);
- } elseif ($type === 'function') {
+ if ($type === 'function') {
$working = $this->is_callable($call);
} elseif($type === 'pdo') {
$working = in_array($call, $this->getAvailableDbDriversForPdo(), TRUE);
->will($this->returnValue(
array('sqlite', 'mysql', 'oci')
));
- $this->setupClass
- ->expects($this->once())
- ->method('class_exists')
- ->will($this->returnValue(true));
$this->setupClass
->expects($this->once())
->method('is_callable')
$this->setupClass
->expects($this->any())
->method('getAvailableDbDriversForPdo')
- ->will($this->returnValue([]));
+ ->will($this->returnValue(['sqlite']));
$result = $this->setupClass->getSupportedDatabases();
$expectedResult = array(
'sqlite' => 'SQLite'
->will($this->returnValue(
array('sqlite', 'mysql', 'oci', 'pgsql')
));
- $this->setupClass
- ->expects($this->any())
- ->method('class_exists')
- ->will($this->returnValue(false));
$this->setupClass
->expects($this->any())
->method('is_callable')
->will($this->returnValue(
array('sqlite', 'mysql', 'pgsql', 'oci')
));
- $this->setupClass
- ->expects($this->any())
- ->method('class_exists')
- ->will($this->returnValue(true));
$this->setupClass
->expects($this->any())
->method('is_callable')
$this->setupClass
->expects($this->any())
->method('getAvailableDbDriversForPdo')
- ->will($this->returnValue(['mysql', 'pgsql']));
+ ->will($this->returnValue(['sqlite', 'mysql', 'pgsql']));
$result = $this->setupClass->getSupportedDatabases();
$expectedResult = array(
'sqlite' => 'SQLite',