Beispiel #1
0
 public function testReturnsUserPropertiesWhenInvokedViaObjectInvokationAndAnArgumentIsPassed()
 {
     $login = '******';
     $user = new User();
     $user->setLogin($login);
     $auth = $this->getMockBuilder('Auth\\AuthenticationService')->disableOriginalConstructor()->getMock();
     $auth->expects($this->exactly(2))->method('getUser')->willReturn($user);
     $target = new AuthHelper();
     $target->setService($auth);
     $this->assertEquals($login, $target('login'));
     $this->assertNull($target('nonexistent'));
 }
Beispiel #2
0
 /**
  * @testdox Allows to set the login name of the user
  * @covers Auth\Entity\User::getLogin
  * @covers Auth\Entity\User::setLogin
  */
 public function testSetGetLogin()
 {
     $input = 'demo';
     $this->target->setLogin($input);
     $this->assertEquals($input, $this->target->getLogin());
 }