/** * 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(); }
/** * 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); }
/** * 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()); }