|
|
|
|
@ -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',
|
|
|
|
|
|