Skip to content
Snippets Groups Projects
Verified Commit ed5d89dc authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3402618 by zniki.ru: Replace $GLOBALS['base_root'] with getAbsoluteUrl() in Functional Test

parent 3df04e71
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,7 @@ public function testThemeDiscovery() { ...@@ -73,7 +73,7 @@ public function testThemeDiscovery() {
$this->drupalGet('admin/appearance'); $this->drupalGet('admin/appearance');
$element = $this->assertSession()->elementExists('xpath', "//a[normalize-space()='Install and set as default' and contains(@href, '{$theme}')]"); $element = $this->assertSession()->elementExists('xpath', "//a[normalize-space()='Install and set as default' and contains(@href, '{$theme}')]");
$this->drupalGet($GLOBALS['base_root'] . $element->getAttribute('href'), ['external' => TRUE]); $this->drupalGet($this->getAbsoluteUrl($element->getAttribute('href')), ['external' => TRUE]);
$translation_base_url = 'admin/config/development/performance/translate'; $translation_base_url = 'admin/config/development/performance/translate';
$this->drupalGet($translation_base_url); $this->drupalGet($translation_base_url);
......
...@@ -73,7 +73,7 @@ public function testActiveClass() { ...@@ -73,7 +73,7 @@ public function testActiveClass() {
$element = $this->assertSession()->elementExists('xpath', '//li[contains(@class, "pager__item--last")]/a'); $element = $this->assertSession()->elementExists('xpath', '//li[contains(@class, "pager__item--last")]/a');
preg_match('@page=(\d+)@', $element->getAttribute('href'), $matches); preg_match('@page=(\d+)@', $element->getAttribute('href'), $matches);
$current_page = (int) $matches[1]; $current_page = (int) $matches[1];
$this->drupalGet($GLOBALS['base_root'] . parse_url($this->getUrl())['path'] . $element->getAttribute('href'), ['external' => TRUE]); $this->drupalGet($this->getAbsoluteUrl(parse_url($this->getUrl())['path'] . $element->getAttribute('href')), ['external' => TRUE]);
$this->assertPagerItems($current_page); $this->assertPagerItems($current_page);
// Verify the pager does not render on a list without pagination. // Verify the pager does not render on a list without pagination.
...@@ -181,7 +181,7 @@ public function testMultiplePagers() { ...@@ -181,7 +181,7 @@ public function testMultiplePagers() {
// (1-indexed) and resulting query parameter // (1-indexed) and resulting query parameter
foreach ($test_data as $data) { foreach ($test_data as $data) {
$input_query = str_replace(' ', '%20', $data['input_query']); $input_query = str_replace(' ', '%20', $data['input_query']);
$this->drupalGet($GLOBALS['base_root'] . parse_url($this->getUrl())['path'] . $input_query, ['external' => TRUE]); $this->drupalGet($this->getAbsoluteUrl(parse_url($this->getUrl())['path'] . $input_query), ['external' => TRUE]);
foreach ([0, 1, 4] as $pager_element) { foreach ([0, 1, 4] as $pager_element) {
$active_page = $this->cssSelect("div.test-pager-{$pager_element} ul.pager__items li.is-active:contains('{$data['expected_page'][$pager_element]}')"); $active_page = $this->cssSelect("div.test-pager-{$pager_element} ul.pager__items li.is-active:contains('{$data['expected_page'][$pager_element]}')");
$destination = str_replace('%2C', ',', $active_page[0]->find('css', 'a')->getAttribute('href')); $destination = str_replace('%2C', ',', $active_page[0]->find('css', 'a')->getAttribute('href'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment