public function testIsValidForHost() { $_SERVER['HTTP_HOST'] = 'localhost'; $this->_model->init('test'); $this->assertFalse($this->_model->isValidForHost('test.com')); $this->assertTrue($this->_model->isValidForHost('localhost')); }
/** * Pull out information from session whether there is currently the first page after log in * * The idea is to set this value on login(), then redirect happens, * after that on next request the value is grabbed once the session is initialized * Since the session is used as a singleton, the value will be in $_isFirstPageAfterLogin until the end of request, * unless it is reset intentionally from somewhere * * @param string $namespace * @param string $sessionName * @return Mage_Admin_Model_Session * @see self::login() */ public function init($namespace, $sessionName = null) { parent::init($namespace, $sessionName); $this->isFirstPageAfterLogin(); return $this; }