grav = $grav(); $this->pages = $this->grav['pages']; $this->config = $this->grav['config']; $this->uri = $this->grav['uri']; $this->language = $this->grav['language']; $this->old_home = $this->config->get('system.home.alias'); $this->config->set('system.home.alias', '/item1'); $this->config->set('system.absolute_urls', false); $this->config->set('system.languages.supported', []); unset($this->grav['language']); $this->grav['language'] = new Language($this->grav); /** @var UniformResourceLocator $locator */ $locator = $this->grav['locator']; $locator->addPath('page', '', 'tests/fake/nested-site/user/pages', false); $this->pages->init(); $defaults = [ 'extra' => false, 'auto_line_breaks' => false, 'auto_url_links' => false, 'escape_markup' => false, 'special_chars' => ['>' => 'gt', '<' => 'lt'], ]; $this->page = $this->pages->dispatch('/item2/item2-2'); $this->uri->initializeWithURL('http://testing.dev/item2/item2-2')->init(); } protected function _after() { $this->config->set('system.home.alias', $this->old_home); } public function testProcessImageHtml() { $this->assertRegexp('|Sample Image|', Excerpts::processImageHtml('Sample Image', $this->page)); $this->assertRegexp('|Sample Image|', Excerpts::processImageHtml('Sample Image', $this->page)); } }