Redaxscript\Controller\Logout::process PHP Method

process() public method

process the class
Since: 3.0.0
public process ( ) : string
return string
    public function process()
    {
        $auth = new Auth($this->_request);
        $auth->init();
        /* handle success */
        if ($auth->logout()) {
            return $this->_success();
        }
        return $this->_error();
    }

Usage Example

Example #1
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);
 }