diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-03-27 14:58:33 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-03-27 14:58:33 +0100 |
commit | 98bc1ad70a26a02f2c4ea87809613f9fb1dc31fd (patch) | |
tree | 42a6b8acd7a94433a37ba85054d40d9b1a25c542 /tests | |
parent | e918bcf2127a727f401f116625b2ea81978d6fdd (diff) | |
parent | b5fad75e579b9aeada87e63b4e7866956e1e20ff (diff) | |
download | nextcloud-server-98bc1ad70a26a02f2c4ea87809613f9fb1dc31fd.tar.gz nextcloud-server-98bc1ad70a26a02f2c4ea87809613f9fb1dc31fd.zip |
Merge pull request #15265 from owncloud/enc2_fixes
core improvements for Encryption 2.0
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/encryption/utiltest.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/lib/encryption/utiltest.php b/tests/lib/encryption/utiltest.php index 00a9ab9c578..672f9ff5e97 100644 --- a/tests/lib/encryption/utiltest.php +++ b/tests/lib/encryption/utiltest.php @@ -98,4 +98,39 @@ class UtilTest extends TestCase { $u->createHeader($header, $em); } + /** + * @dataProvider providePathsForTestIsExcluded + */ + public function testIsEcluded($path, $expected) { + $this->userManager + ->expects($this->any()) + ->method('userExists') + ->will($this->returnCallback(array($this, 'isExcludedCallback'))); + + $u = new Util($this->view, $this->userManager); + + $this->assertSame($expected, + $u->isExcluded($path) + ); + } + + public function providePathsForTestIsExcluded() { + return array( + array('files_encryption/foo.txt', true), + array('test/foo.txt', false), + array('/user1/files_encryption/foo.txt', true), + array('/user1/files/foo.txt', false), + + ); + } + + public function isExcludedCallback() { + $args = func_get_args(); + if ($args[0] === 'user1') { + return true; + } + + return false; + } + } |