diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-25 15:39:02 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-25 15:39:02 +0100 |
commit | 9412f6910479ee6ecfcd54ddfd98ea613735e764 (patch) | |
tree | 0ff407215bde7d9fe9867a215a007d7745636c11 /tests | |
parent | 32f4bea0ae174487fd5a58e2c9eeb6e567d1ff91 (diff) | |
download | nextcloud-server-9412f6910479ee6ecfcd54ddfd98ea613735e764.tar.gz nextcloud-server-9412f6910479ee6ecfcd54ddfd98ea613735e764.zip |
Fix verifyExpirationDate passwordSet argument
Password set should be false if the password is null.
Also updated the unit tests to tests this now.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/share20/managertest.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/lib/share20/managertest.php b/tests/lib/share20/managertest.php index c41f0754396..42610f94715 100644 --- a/tests/lib/share20/managertest.php +++ b/tests/lib/share20/managertest.php @@ -787,7 +787,7 @@ class ManagerTest extends \Test\TestCase { $hookListner = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock(); \OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListner, 'listener'); $hookListner->expects($this->once())->method('listener')->with($this->callback(function ($data) use ($expected) { - return $data['expirationDate'] == $expected; + return $data['expirationDate'] == $expected && $data['passwordSet'] === false; })); $res = $this->invokePrivate($this->manager, 'validateExpirationDate', [$share]); @@ -799,10 +799,11 @@ class ManagerTest extends \Test\TestCase { $hookListner = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock(); \OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListner, 'listener'); $hookListner->expects($this->once())->method('listener')->with($this->callback(function ($data) { - return $data['expirationDate'] === null; + return $data['expirationDate'] === null && $data['passwordSet'] === true; })); $share = $this->manager->newShare(); + $share->setPassword('password'); $date = $this->invokePrivate($this->manager, 'validateExpirationDate', [$share]); |