summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-03-30 11:01:06 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:28 +0200
commit4aa125cc0a2b5a129c4f97d807f7a225a7620199 (patch)
treea43b0a0024a2795f28cad5c3d9391c8eea785019 /tests
parent2331298380690c9326b6d189c96e0201d6b0b9e1 (diff)
downloadnextcloud-server-4aa125cc0a2b5a129c4f97d807f7a225a7620199.tar.gz
nextcloud-server-4aa125cc0a2b5a129c4f97d807f7a225a7620199.zip
fix unit test execution
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/encryption/utiltest.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/lib/encryption/utiltest.php b/tests/lib/encryption/utiltest.php
index 672f9ff5e97..03aefe61151 100644
--- a/tests/lib/encryption/utiltest.php
+++ b/tests/lib/encryption/utiltest.php
@@ -20,6 +20,9 @@ class UtilTest extends TestCase {
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $userManager;
+ /** @var \PHPUnit_Framework_MockObject_MockObject */
+ private $config;
+
public function setUp() {
parent::setUp();
$this->view = $this->getMockBuilder('OC\Files\View')
@@ -29,13 +32,18 @@ class UtilTest extends TestCase {
$this->userManager = $this->getMockBuilder('OC\User\Manager')
->disableOriginalConstructor()
->getMock();
+
+ $this->config = $this->getMockBuilder('OCP\IConfig')
+ ->disableOriginalConstructor()
+ ->getMock();
+
}
/**
* @dataProvider providesHeadersForEncryptionModule
*/
public function testGetEncryptionModuleId($expected, $header) {
- $u = new Util($this->view, $this->userManager);
+ $u = new Util($this->view, $this->userManager, $this->config);
$id = $u->getEncryptionModuleId($header);
$this->assertEquals($expected, $id);
}
@@ -53,7 +61,7 @@ class UtilTest extends TestCase {
*/
public function testReadHeader($header, $expected, $moduleId) {
$expected['oc_encryption_module'] = $moduleId;
- $u = new Util($this->view, $this->userManager);
+ $u = new Util($this->view, $this->userManager, $this->config);
$result = $u->readHeader($header);
$this->assertSameSize($expected, $result);
foreach ($expected as $key => $value) {
@@ -70,7 +78,7 @@ class UtilTest extends TestCase {
$em = $this->getMock('\OCP\Encryption\IEncryptionModule');
$em->expects($this->any())->method('getId')->willReturn($moduleId);
- $u = new Util($this->view, $this->userManager);
+ $u = new Util($this->view, $this->userManager, $this->config);
$result = $u->createHeader($header, $em);
$this->assertEquals($expected, $result);
}
@@ -94,7 +102,7 @@ class UtilTest extends TestCase {
$em = $this->getMock('\OCP\Encryption\IEncryptionModule');
$em->expects($this->any())->method('getId')->willReturn('moduleId');
- $u = new Util($this->view, $this->userManager);
+ $u = new Util($this->view, $this->userManager, $this->config);
$u->createHeader($header, $em);
}
@@ -107,7 +115,7 @@ class UtilTest extends TestCase {
->method('userExists')
->will($this->returnCallback(array($this, 'isExcludedCallback')));
- $u = new Util($this->view, $this->userManager);
+ $u = new Util($this->view, $this->userManager, $this->config);
$this->assertSame($expected,
$u->isExcluded($path)