Exemple #1
0
 public function testSetGetAuthStorage()
 {
     // by default Mage_Backend_Model_Auth_Session class will instantiate as a Authentication Storage
     $this->assertInstanceOf('Mage_Backend_Model_Auth_Session', $this->_model->getAuthStorage());
     $mockStorage = $this->getMock('Mage_Backend_Model_Auth_StorageInterface');
     $this->_model->setAuthStorage($mockStorage);
     $this->assertInstanceOf('Mage_Backend_Model_Auth_StorageInterface', $this->_model->getAuthStorage());
     $incorrectStorage = new StdClass();
     try {
         $this->_model->setAuthStorage($incorrectStorage);
         $this->fail('Incorrect authentication storage setted.');
     } catch (Mage_Backend_Model_Auth_Exception $e) {
         // in case of exception - Auth works correct
         $this->assertNotEmpty($e->getMessage());
     }
 }
/**
 * 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();
Exemple #3
0
 public function setUp()
 {
     $this->_auth = new Mage_Backend_Model_Auth();
     $this->_model = new Mage_Backend_Model_Auth_Session();
     $this->_auth->setAuthStorage($this->_model);
 }
Exemple #4
0
 public static function loginAdminRollback()
 {
     $auth = new Mage_Backend_Model_Auth();
     $auth->setAuthStorage(self::$_adminSession);
     $auth->logout();
 }
Exemple #5
0
 public function setUp()
 {
     $this->_auth = Mage::getModel('Mage_Backend_Model_Auth');
     $this->_model = Mage::getModel('Mage_Backend_Model_Auth_Session');
     $this->_auth->setAuthStorage($this->_model);
 }