Problem/Motivation

I was working on the issue #3402601 with module Pagerer.
I believe if in PagetTest.php $GLOBALS['base_root'] was not used, we will not have this issue.
There is only 2 files with using this approach, and I believe using \Drupal\Tests\UiHelperTrait::getAbsoluteUrl() is better.

The problem was that because in Gitlab CI "web" subdrectory is used, we run into issue, having tests failing in Gitlab CI approach.
\Drupal\Tests\UiHelperTrait::getAbsoluteUrl() used in many tests in core. And there are only 3 places where $GLOBALS['base_root'] used.

Steps to reproduce

?

Proposed resolution

Replace $GLOBALS['base_root'] with \Drupal\Tests\UiHelperTrait::getAbsoluteUrl() in PhpUnit functional tests.

Remaining tasks

Refactor code.

User interface changes

none

API changes

none

Data model changes

none

Release notes snippet

none

Issue fork drupal-3402618

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zniki.ru created an issue. See original summary.

Nikolay Shapovalov’s picture

Status: Active » Needs review

MR created. Please let me know what do you think.

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Makes sense, and a similar fix let tests pass in GitlabCI for the contrib Pagerer module.

alexpott’s picture

Version: 11.x-dev » 10.2.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed ed5d89d and pushed to 11.x. Thanks!

Will backport to 10.2.x on Monday.

  • alexpott committed ed5d89dc on 11.x
    Issue #3402618 by zniki.ru: Replace $GLOBALS['base_root'] with...
alexpott’s picture

Status: Patch (to be ported) » Fixed

  • alexpott committed 592d8f57 on 10.2.x
    Issue #3402618 by zniki.ru: Replace $GLOBALS['base_root'] with...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.