From 465807490d7648e5675f1cdbc5b1d232cda4feee Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 13 Jun 2016 16:00:49 +0200 Subject: create session token only for clients that support cookies --- apps/dav/tests/unit/Connector/Sabre/AuthTest.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'apps') diff --git a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php index b3ab49a027e..147a0c2b8c5 100644 --- a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php @@ -159,7 +159,7 @@ class AuthTest extends TestCase { $user = $this->getMockBuilder('\OCP\IUser') ->disableOriginalConstructor() ->getMock(); - $user->expects($this->exactly(4)) + $user->expects($this->exactly(3)) ->method('getUID') ->will($this->returnValue('MyTestUser')); $this->userSession @@ -167,7 +167,7 @@ class AuthTest extends TestCase { ->method('isLoggedIn') ->will($this->returnValue(true)); $this->userSession - ->expects($this->exactly(4)) + ->expects($this->exactly(3)) ->method('getUser') ->will($this->returnValue($user)); $this->session @@ -178,12 +178,8 @@ class AuthTest extends TestCase { $this->userSession ->expects($this->once()) ->method('logClientIn') - ->with('MyTestUser', 'MyTestPassword') + ->with('MyTestUser', 'MyTestPassword', $this->request) ->will($this->returnValue(true)); - $this->userSession - ->expects($this->once()) - ->method('createSessionToken') - ->with($this->request, 'MyTestUser', 'MyTestUser', 'MyTestPassword'); $this->session ->expects($this->once()) ->method('set') @@ -626,17 +622,14 @@ class AuthTest extends TestCase { ->method('logClientIn') ->with('username', 'password') ->will($this->returnValue(true)); - $this->userSession - ->expects($this->once()) - ->method('createSessionToken'); $user = $this->getMockBuilder('\OCP\IUser') ->disableOriginalConstructor() ->getMock(); - $user->expects($this->exactly(4)) + $user->expects($this->exactly(3)) ->method('getUID') ->will($this->returnValue('MyTestUser')); $this->userSession - ->expects($this->exactly(4)) + ->expects($this->exactly(3)) ->method('getUser') ->will($this->returnValue($user)); $response = $this->auth->check($server->httpRequest, $server->httpResponse); -- cgit v1.2.3