/** * @magentoAppIsolation enabled */ public function testLogout() { $this->_model->login(\Magento\TestFramework\Bootstrap::ADMIN_NAME, \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD); $this->assertNotEmpty($this->_model->getAuthStorage()->getData()); $this->_model->logout(); $this->assertEmpty($this->_model->getAuthStorage()->getData()); }
/** * Performs user logout */ protected function _logout() { $this->_auth->logout(); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Backend\Model\UrlInterface' )->turnOnSecretKey(); }
/** * Test if the admin session is created in database * * @magentoDbIsolation enabled */ public function testIsAdminSessionIsCreated() { $this->auth->login(\Magento\TestFramework\Bootstrap::ADMIN_NAME, \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD); $sessionId = $this->authSession->getSessionId(); $this->adminSessionInfo->load($sessionId, 'session_id'); $this->assertGreaterThanOrEqual(1, (int) $this->adminSessionInfo->getId()); $this->auth->logout(); }
/** * {@inheritdoc} */ public function logout() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'logout'); if (!$pluginInfo) { return parent::logout(); } else { return $this->___callPlugins('logout', func_get_args(), $pluginInfo); } }
/** * @magentoAppIsolation enabled */ public function testLogout() { $this->markTestIncomplete('MAGETWO-17021'); $this->_model->login(\Magento\TestFramework\Bootstrap::ADMIN_NAME, \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD); $this->assertNotEmpty($this->_model->getAuthStorage()->getData()); $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('\\Magento\\Framework\\Stdlib\\Cookie'); $cookie->set($this->_model->getAuthStorage()->getName(), 'session_id'); $this->_model->logout(); $this->assertEmpty($this->_model->getAuthStorage()->getData()); $this->assertEmpty($cookie->get($this->_model->getAuthStorage()->getName())); }