Skip to content
Snippets Groups Projects
Commit 4d672ded authored by Morris Jobke's avatar Morris Jobke
Browse files

properly mock dependencies for setup tests

parent c3cac887
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,10 @@ class Test_OC_Setup extends \Test\TestCase { ...@@ -20,6 +20,10 @@ class Test_OC_Setup extends \Test\TestCase {
private $defaults; private $defaults;
/** @var \OC\Setup | PHPUnit_Framework_MockObject_MockObject */ /** @var \OC\Setup | PHPUnit_Framework_MockObject_MockObject */
protected $setupClass; protected $setupClass;
/** @var \OCP\ILogger | PHPUnit_Framework_MockObject_MockObject */
protected $logger;
/** @var \OCP\Security\ISecureRandom | PHPUnit_Framework_MockObject_MockObject */
protected $random;
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
...@@ -28,9 +32,11 @@ class Test_OC_Setup extends \Test\TestCase { ...@@ -28,9 +32,11 @@ class Test_OC_Setup extends \Test\TestCase {
$this->iniWrapper = $this->getMock('\bantu\IniGetWrapper\IniGetWrapper'); $this->iniWrapper = $this->getMock('\bantu\IniGetWrapper\IniGetWrapper');
$this->l10n = $this->getMock('\OCP\IL10N'); $this->l10n = $this->getMock('\OCP\IL10N');
$this->defaults = $this->getMock('\OC_Defaults'); $this->defaults = $this->getMock('\OC_Defaults');
$this->logger = $this->getMock('\OCP\ILogger');
$this->random = $this->getMock('\OCP\Security\ISecureRandom');
$this->setupClass = $this->getMock('\OC\Setup', $this->setupClass = $this->getMock('\OC\Setup',
['class_exists', 'is_callable'], ['class_exists', 'is_callable'],
[$this->config, $this->iniWrapper, $this->l10n, $this->defaults]); [$this->config, $this->iniWrapper, $this->l10n, $this->defaults, $this->logger, $this->random]);
} }
public function testGetSupportedDatabasesWithOneWorking() { public function testGetSupportedDatabasesWithOneWorking() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment