/** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. * * @return void * * @since 3.1 */ protected function tearDown() { $_SERVER = $this->backupServer; $this->restoreFactoryState(); parent::tearDown(); JHtmlJqueryInspector::resetLoaded(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.1 */ protected function setUp() { // Ensure the loaded states are reset JHtmlJqueryInspector::resetLoaded(); $this->saveFactoryState(); JFactory::$application = $this->getMockApplication(); JFactory::$document = $this->getMockDocument(); $this->backupServer = $_SERVER; $_SERVER['HTTP_HOST'] = 'example.com'; $_SERVER['SCRIPT_NAME'] = ''; }