Problem/Motivation

During Drupal 8, we added support for \Drupal::MINIMUM_SUPPORTED_PHP, which defines a PHP version that allows sites to run, but displays warnings on update and errors on the status report for existing sites. (New installations are not allowed except within the test runner.)

However, numerous tests now fail when MINIMUM_SUPPORTED_PHP is actually used, either due to issues with the test or possible regressions in HEAD.

One of these tests is Drupal\Tests\locale\Functional\LocaleTranslatedSchemaDefinitionTest.

Proposed resolution

Fix the tests. See #8.

There are three MRs:

  1. 3265377-FAIL increases the minimum supported PHP version so that the PHP 7.3 test environment will expose the bug, plus skips some other test failures covered in other issues.
  2. 3265377-prove-fix combines the failing version with the change to the test to prove that the issue is resolved.
  3. 3265377-fix-only is the version for commit.

Remaining tasks

Followups for other issues and to actually change the PHP version.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

Issue fork drupal-3265377

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:

Comments

xjm created an issue. See original summary.

xjm’s picture

Status: Active » Needs review

Go, tests, go.

xjm’s picture

Status: Needs review » Needs work

xjm’s picture

Status: Needs work » Needs review

So this is another test that tries to do the right thing, but doesn't quite do so successfully:

    // Visit the update page to collect any strings that may be translatable.   
    $user = $this->drupalCreateUser(['administer software updates']);
    $this->drupalLogin($user);
    $update_url = $GLOBALS['base_url'] . '/update.php';
    $this->drupalGet($update_url, ['external' => TRUE]);
    // Ensure that there are no updates just due to translations. Check for     
    // markup and a link instead of specific text because text may be           
    // translated.                                                              
    $this->drupalGet($update_url . '/selection', ['external' => TRUE]);
    $this->updateRequirementsProblem();
    $this->drupalGet($update_url . '/selection', ['external' => TRUE]);
    $this->assertSession()->responseContains('messages--status');
    $this->assertSession()->linkByHrefNotExists('fr/update.php/run', 'No link to run updates.');

The problem on PHP versions lower than \Drupal::MINIMUM_SUPPORTED_PHP is that strings are only collected from the warnings page, and not from the second screen. Moving the $this->updateRequirementsProblem() call earlier, prior to the randomized translation, resolves this.

xjm’s picture

Issue summary: View changes
daffie’s picture

Status: Needs review » Reviewed & tested by the community

The 3 MR's convince me that the fix is the right one.
For me it is RTBC.

  • catch committed e5cfd78 on 10.0.x
    Issue #3265377 by xjm: Fix LocaleTranslatedSchemaDefinitionTest when...

  • catch committed 8bc92ec on 9.4.x
    Issue #3265377 by xjm: Fix LocaleTranslatedSchemaDefinitionTest when...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.0.x, cherry-picked to 9.4.x and 9.3.x, thanks!

  • catch committed c498993 on 9.3.x
    Issue #3265377 by xjm: Fix LocaleTranslatedSchemaDefinitionTest when...

Status: Fixed » Closed (fixed)

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