/** * Setup for testing. * * @return void * * @since 3.2 */ public function setUp() { parent::setUp(); $this->saveFactoryState(); JFactory::$document = $this->getMockDocument(); JFactory::$language = $this->getMockLanguage(); JFactory::$session = $this->getMockSession(); $this->backupServer = $_SERVER; $_SERVER['HTTP_HOST'] = self::TEST_HTTP_HOST; $_SERVER['HTTP_USER_AGENT'] = self::TEST_USER_AGENT; $_SERVER['REQUEST_URI'] = self::TEST_REQUEST_URI; $_SERVER['SCRIPT_NAME'] = '/index.php'; // Set the config for the app $config = new Registry(); $config->set('session', false); // Get a new JApplicationCmsInspector instance. $this->class = new JApplicationCmsInspector($this->getMockInput(), $config); $this->class->setSession(JFactory::$session); $this->class->setDispatcher($this->getMockDispatcher()); JFactory::$application = $this->class; }