Ejemplo n.º 1
0
 protected function tearDown()
 {
     $this->_auth->logout();
     $this->_auth = null;
     $this->_session = null;
     Mage::getSingleton('Mage_Backend_Model_Url')->turnOnSecretKey();
     parent::tearDown();
 }
Ejemplo n.º 2
0
 public function testLogout()
 {
     $this->_model->login(Magento_Test_Bootstrap::ADMIN_NAME, Magento_Test_Bootstrap::ADMIN_PASSWORD);
     $this->assertNotEmpty($this->_model->getAuthStorage()->getData());
     $this->_model->getAuthStorage()->getCookie()->set($this->_model->getAuthStorage()->getSessionName(), 'session_id');
     $this->_model->logout();
     $this->assertEmpty($this->_model->getAuthStorage()->getData());
     $this->assertEmpty($this->_model->getAuthStorage()->getCookie()->get($this->_model->getAuthStorage()->getSessionName()));
 }
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Magento
 * @package     Mage_DesignEditor
 * @subpackage  integration_tests
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
$session = new Mage_DesignEditor_Model_Session();
$auth = new Mage_Backend_Model_Auth();
$auth->setAuthStorage($session);
$session->deactivateDesignEditor();
$auth->logout();
Ejemplo n.º 4
0
 /**
  * Performs user logout
  */
 protected function _logout()
 {
     $this->_auth->logout();
     Mage::getSingleton('Mage_Backend_Model_Url')->turnOnSecretKey();
 }
Ejemplo n.º 5
0
 public static function loginAdminRollback()
 {
     $auth = new Mage_Backend_Model_Auth();
     $auth->setAuthStorage(self::$_adminSession);
     $auth->logout();
 }
Ejemplo n.º 6
0
 /**
  * @covers Mage_Backend_Helper_Data::getCurrentUserId
  */
 public function testGetCurrentUserId()
 {
     $this->assertFalse($this->_helper->getCurrentUserId());
     /**
      * perform login
      */
     Mage::getSingleton('Mage_Backend_Model_Url')->turnOffSecretKey();
     $auth = new Mage_Backend_Model_Auth();
     $auth->login(Magento_Test_Bootstrap::ADMIN_NAME, Magento_Test_Bootstrap::ADMIN_PASSWORD);
     $this->assertEquals(1, $this->_helper->getCurrentUserId());
     /**
      * perform logout
      */
     $auth->logout();
     Mage::getSingleton('Mage_Backend_Model_Url')->turnOnSecretKey();
     $this->assertFalse($this->_helper->getCurrentUserId());
 }