/**
  * @covers ULogin\Init::isAuthorised()
  */
 public function testAuthorised()
 {
     // first call
     $auth = $this->init->isAuthorised();
     $this->assertFalse($auth, "[-] Auth user status must be init as `false` on first state");
     $reflectionProperty = $this->reflection->getProperty('user');
     $reflectionProperty->setAccessible(true);
     $this->user = $reflectionProperty->setValue($this->init, ['first_name' => 'Brain', 'last_name' => 'F**k', 'sex' => '2']);
     // check auth
     $auth = $this->init->isAuthorised();
     $this->assertTrue($auth, "[-] Success user auth must return true");
 }
Beispiel #2
0
 /**
  * User logout
  *
  * @return boolean
  */
 public function logout()
 {
     parent::logout();
     $this->session->remove(self::KEY);
     return true;
 }