]> source.dussan.org Git - nextcloud-server.git/commitdiff
adjust test
authorArthur Schiwon <blizzz@owncloud.com>
Fri, 13 Dec 2013 11:56:06 +0000 (12:56 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Fri, 13 Dec 2013 15:58:23 +0000 (16:58 +0100)
tests/lib/user/session.php

index e457a7bda30218463cec7fb1bfdf56ed0e5e8e97..46b268b3624a6344f21fb7d020017b9768c0e91e 100644 (file)
@@ -52,9 +52,20 @@ class Session extends \PHPUnit_Framework_TestCase {
 
        public function testLoginValidPasswordEnabled() {
                $session = $this->getMock('\OC\Session\Memory', array(), array(''));
-               $session->expects($this->once())
+               $session->expects($this->exactly(2))
                        ->method('set')
-                       ->with('user_id', 'foo');
+                       ->with($this->callback(function($key) {
+                                               switch($key) {
+                                                       case 'user_id':
+                                                       case 'loginname':
+                                                               return true;
+                                                               break;
+                                                       default:
+                                                               return false;
+                                                               break;
+                                               }
+                                       },
+                                       'foo'));
 
                $manager = $this->getMock('\OC\User\Manager');