summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-07-30 12:32:22 +0200
committerLukas Reschke <lukas@owncloud.com>2015-07-30 12:32:22 +0200
commite95bc68ac75222bdb839d2fb062abc9d4a8e1911 (patch)
tree1e5f6624322af7dc94620898cb99a4659e2e1411 /tests
parent4d672ded244e5e8a242d649588879979bdde1bb6 (diff)
downloadnextcloud-server-e95bc68ac75222bdb839d2fb062abc9d4a8e1911.tar.gz
nextcloud-server-e95bc68ac75222bdb839d2fb062abc9d4a8e1911.zip
Check for PDO instead of removed function for PHP 7 compatibility
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/setup.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/lib/setup.php b/tests/lib/setup.php
index fa9fe08ed95..72c84520056 100644
--- a/tests/lib/setup.php
+++ b/tests/lib/setup.php
@@ -35,7 +35,7 @@ class Test_OC_Setup extends \Test\TestCase {
$this->logger = $this->getMock('\OCP\ILogger');
$this->random = $this->getMock('\OCP\Security\ISecureRandom');
$this->setupClass = $this->getMock('\OC\Setup',
- ['class_exists', 'is_callable'],
+ ['class_exists', 'is_callable', 'getAvailableDbDriversForPdo'],
[$this->config, $this->iniWrapper, $this->l10n, $this->defaults, $this->logger, $this->random]);
}
@@ -51,9 +51,13 @@ class Test_OC_Setup extends \Test\TestCase {
->method('class_exists')
->will($this->returnValue(true));
$this->setupClass
- ->expects($this->exactly(2))
+ ->expects($this->once())
->method('is_callable')
->will($this->returnValue(false));
+ $this->setupClass
+ ->expects($this->once())
+ ->method('getAvailableDbDriversForPdo')
+ ->will($this->returnValue([]));
$result = $this->setupClass->getSupportedDatabases();
$expectedResult = array(
'sqlite' => 'SQLite'
@@ -74,9 +78,13 @@ class Test_OC_Setup extends \Test\TestCase {
->method('class_exists')
->will($this->returnValue(false));
$this->setupClass
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('is_callable')
->will($this->returnValue(false));
+ $this->setupClass
+ ->expects($this->once())
+ ->method('getAvailableDbDriversForPdo')
+ ->will($this->returnValue([]));
$result = $this->setupClass->getSupportedDatabases();
$this->assertSame(array(), $result);
@@ -94,9 +102,13 @@ class Test_OC_Setup extends \Test\TestCase {
->method('class_exists')
->will($this->returnValue(true));
$this->setupClass
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('is_callable')
->will($this->returnValue(true));
+ $this->setupClass
+ ->expects($this->once())
+ ->method('getAvailableDbDriversForPdo')
+ ->will($this->returnValue(['mysql']));
$result = $this->setupClass->getSupportedDatabases();
$expectedResult = array(
'sqlite' => 'SQLite',