diff options
-rw-r--r-- | lib/private/Setup.php | 8 | ||||
-rw-r--r-- | tests/lib/SetupTest.php | 16 |
2 files changed, 5 insertions, 19 deletions
diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 81a5343fe21..d9997767684 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -125,8 +125,8 @@ class Setup { public function getSupportedDatabases($allowAllDatabases = false) { $availableDatabases = array( 'sqlite' => array( - 'type' => 'class', - 'call' => 'SQLite3', + 'type' => 'pdo', + 'call' => 'sqlite', 'name' => 'SQLite' ), 'mysql' => array( @@ -163,9 +163,7 @@ class Setup { $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); diff --git a/tests/lib/SetupTest.php b/tests/lib/SetupTest.php index a8389eaaf56..acbce938a25 100644 --- a/tests/lib/SetupTest.php +++ b/tests/lib/SetupTest.php @@ -55,16 +55,12 @@ class SetupTest extends \Test\TestCase { )); $this->setupClass ->expects($this->once()) - ->method('class_exists') - ->will($this->returnValue(true)); - $this->setupClass - ->expects($this->once()) ->method('is_callable') ->will($this->returnValue(false)); $this->setupClass ->expects($this->any()) ->method('getAvailableDbDriversForPdo') - ->will($this->returnValue([])); + ->will($this->returnValue(['sqlite'])); $result = $this->setupClass->getSupportedDatabases(); $expectedResult = array( 'sqlite' => 'SQLite' @@ -82,10 +78,6 @@ class SetupTest extends \Test\TestCase { )); $this->setupClass ->expects($this->any()) - ->method('class_exists') - ->will($this->returnValue(false)); - $this->setupClass - ->expects($this->any()) ->method('is_callable') ->will($this->returnValue(false)); $this->setupClass @@ -106,16 +98,12 @@ class SetupTest extends \Test\TestCase { )); $this->setupClass ->expects($this->any()) - ->method('class_exists') - ->will($this->returnValue(true)); - $this->setupClass - ->expects($this->any()) ->method('is_callable') ->will($this->returnValue(true)); $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', |