diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-09-16 14:15:35 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-09-24 13:46:30 +0200 |
commit | d101ff42f16ef7288b40666eba20c69621481ea4 (patch) | |
tree | e3183f924da88090feb88ff67e1af5060a0b9db6 /tests/lib/user/session.php | |
parent | 40871bab88159d914cfab2dd938a2312ed8eb1c1 (diff) | |
download | nextcloud-server-d101ff42f16ef7288b40666eba20c69621481ea4.tar.gz nextcloud-server-d101ff42f16ef7288b40666eba20c69621481ea4.zip |
User: move checkPassword from User to Manager to not break API
Diffstat (limited to 'tests/lib/user/session.php')
-rw-r--r-- | tests/lib/user/session.php | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/tests/lib/user/session.php b/tests/lib/user/session.php index 274e9e2831e..e457a7bda30 100644 --- a/tests/lib/user/session.php +++ b/tests/lib/user/session.php @@ -62,10 +62,6 @@ class Session extends \PHPUnit_Framework_TestCase { $user = $this->getMock('\OC\User\User', array(), array('foo', $backend)); $user->expects($this->once()) - ->method('checkPassword') - ->with('bar') - ->will($this->returnValue(true)); - $user->expects($this->once()) ->method('isEnabled') ->will($this->returnValue(true)); $user->expects($this->any()) @@ -73,8 +69,8 @@ class Session extends \PHPUnit_Framework_TestCase { ->will($this->returnValue('foo')); $manager->expects($this->once()) - ->method('get') - ->with('foo') + ->method('checkPassword') + ->with('foo', 'bar') ->will($this->returnValue($user)); $userSession = new \OC\User\Session($manager, $session); @@ -93,16 +89,12 @@ class Session extends \PHPUnit_Framework_TestCase { $user = $this->getMock('\OC\User\User', array(), array('foo', $backend)); $user->expects($this->once()) - ->method('checkPassword') - ->with('bar') - ->will($this->returnValue(true)); - $user->expects($this->once()) ->method('isEnabled') ->will($this->returnValue(false)); $manager->expects($this->once()) - ->method('get') - ->with('foo') + ->method('checkPassword') + ->with('foo', 'bar') ->will($this->returnValue($user)); $userSession = new \OC\User\Session($manager, $session); @@ -119,17 +111,13 @@ class Session extends \PHPUnit_Framework_TestCase { $backend = $this->getMock('OC_User_Dummy'); $user = $this->getMock('\OC\User\User', array(), array('foo', $backend)); - $user->expects($this->once()) - ->method('checkPassword') - ->with('bar') - ->will($this->returnValue(false)); $user->expects($this->never()) ->method('isEnabled'); $manager->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue($user)); + ->method('checkPassword') + ->with('foo', 'bar') + ->will($this->returnValue(false)); $userSession = new \OC\User\Session($manager, $session); $userSession->login('foo', 'bar'); @@ -145,9 +133,9 @@ class Session extends \PHPUnit_Framework_TestCase { $backend = $this->getMock('OC_User_Dummy'); $manager->expects($this->once()) - ->method('get') - ->with('foo') - ->will($this->returnValue(null)); + ->method('checkPassword') + ->with('foo', 'bar') + ->will($this->returnValue(false)); $userSession = new \OC\User\Session($manager, $session); $userSession->login('foo', 'bar'); |