logout() публичный Метод

logout the user
С версии: 3.0.0
public logout ( ) : boolean
Результат boolean
Пример #1
0
 /**
  * process the class
  *
  * @since 3.0.0
  *
  * @return string
  */
 public function process()
 {
     $auth = new Auth($this->_request);
     $auth->init();
     /* handle success */
     if ($auth->logout()) {
         return $this->_success();
     }
     return $this->_error();
 }
Пример #2
0
 /**
  * testProcess
  *
  * @since 3.0.0
  *
  * @param array $authArray
  * @param string $expect
  *
  * @dataProvider providerProcess
  */
 public function testProcess($authArray = [], $expect = null)
 {
     /* setup */
     $auth = new Auth($this->_request);
     $logoutController = new Controller\Logout($this->_registry, $this->_language, $this->_request);
     if ($authArray['login']) {
         $auth->login(1);
     }
     if ($authArray['logout']) {
         $auth->logout();
     }
     /* actual */
     $actual = $logoutController->process();
     /* compare */
     $this->assertEquals($expect, $actual);
 }
Пример #3
0
 /**
  * testLogin
  *
  * @since 3.0.0
  */
 public function testLoginAndLogout()
 {
     /* setup */
     $auth = new Auth($this->_request);
     $auth->logout();
     /* compare */
     $this->assertFalse($auth->login());
     $this->assertTrue($auth->login(1));
     $this->assertTrue($auth->logout());
     $this->assertFalse($auth->logout());
 }