diff -u b/core/modules/update/src/ProjectCoreCompatibility.php b/core/modules/update/src/ProjectCoreCompatibility.php --- b/core/modules/update/src/ProjectCoreCompatibility.php +++ b/core/modules/update/src/ProjectCoreCompatibility.php @@ -139,7 +139,8 @@ foreach ($releases_to_set as &$release) { if (!empty($release['core_compatibility'])) { $release['core_compatible'] = $this->isCoreCompatible($release['core_compatibility']); - $release['core_compatibility_details'] = $this->createCoreCompatibilityDetails($release['core_compatibility'], $release['core_compatible']); + $release['core_compatibility_range'] = $this->createMessageFromCoreCompatibility($release['core_compatibility']); + $release['core_compatibility_details'] = $this->createCoreCompatibilityDetails($release['core_compatible'], $release['core_compatibility_range']); } } } @@ -147,21 +148,24 @@ /** * Creates core a compatibility details element. * - * @param string $core_compatibility_constraint - * A semantic version constraint. * @param bool $core_compatible * Is the release compatible with the currently installed version of core? + * @param string $core_compatibility_range + * The translated core compatibility range message from + * static::createMessageFromCoreCompatibility(). * * @return array * Render array of the core compatibility details element. * * @todo Should this be a twig template? + * + * @see static::createMessageFromCoreCompatibility() */ - protected function createCoreCompatibilityDetails($core_compatibility_constraint, $core_compatible) { + protected function createCoreCompatibilityDetails($core_compatible, $core_compatibility_range) { $element = [ '#type' => 'details', 'compatibility_range' => [ - '#markup' => $this->createMessageFromCoreCompatibility($core_compatibility_constraint), + '#markup' => $core_compatibility_range, ], ]; if ($core_compatible) { only in patch2: unchanged: --- a/core/drupalci.yml +++ b/core/drupalci.yml @@ -21,37 +21,37 @@ build: # deprecated code. run_tests.phpunit: types: 'PHPUnit-Unit' - testgroups: '--all' + testgroups: '--module update' suppress-deprecations: false halt-on-fail: false run_tests.kernel: types: 'PHPUnit-Kernel' - testgroups: '--all' - suppress-deprecations: false - halt-on-fail: false - run_tests.simpletest: - types: 'Simpletest' - testgroups: '--all' - suppress-deprecations: false - halt-on-fail: false - run_tests.build: - # Limit concurrency due to disk space concerns. - concurrency: 15 - types: 'PHPUnit-Build' - testgroups: '--all' + testgroups: '--module update' suppress-deprecations: false halt-on-fail: false +# run_tests.simpletest: +# types: 'Simpletest' +# testgroups: '--all' +# suppress-deprecations: false +# halt-on-fail: false +# run_tests.build: +# # Limit concurrency due to disk space concerns. +# concurrency: 15 +# types: 'PHPUnit-Build' +# testgroups: '--all' +# suppress-deprecations: false +# halt-on-fail: false run_tests.functional: types: 'PHPUnit-Functional' - testgroups: '--all' - suppress-deprecations: false - halt-on-fail: false - run_tests.javascript: - concurrency: 15 - types: 'PHPUnit-FunctionalJavascript' - testgroups: '--all' + testgroups: '--module update' suppress-deprecations: false halt-on-fail: false +# run_tests.javascript: +# concurrency: 15 +# types: 'PHPUnit-FunctionalJavascript' +# testgroups: '--all' +# suppress-deprecations: false +# halt-on-fail: false # Run nightwatch testing. # @see https://www.drupal.org/project/drupal/issues/2869825 - nightwatchjs: +# nightwatchjs: only in patch2: unchanged: --- a/core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php +++ b/core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php @@ -20,6 +20,14 @@ public function testSetProjectCoreCompatibilityRanges(array $project_data, $core $project_compatibility = new ProjectCoreCompatibility($core_data, $core_releases); $project_compatibility->setStringTranslation($this->getStringTranslationStub()); $project_compatibility->setReleaseMessage($project_data); + // Ignore the
markup, and only assert that the core compatibility + // constraint, range message and core compatible boolean matches. + $purge_compatibility_details = function($release) { + unset($release['core_compatibility_details']); + return $release; + }; + $project_data['releases'] = array_map($purge_compatibility_details, $project_data['releases']); + $project_data['security updates'] = array_map($purge_compatibility_details, $project_data['security updates']); $this->assertSame($expected_releases, $project_data['releases']); $this->assertSame($expected_security_updates, $project_data['security updates']); } @@ -72,22 +80,26 @@ public function providerSetProjectCoreCompatibilityRanges() { 'expected_releases' => [ '1.0.1' => [ 'core_compatibility' => '8.x', - 'core_compatibility_message' => 'This module is compatible with Drupal core: 8.8.0 to 8.9.2', + 'core_compatible' => TRUE, + 'core_compatibility_range' => 'Requires Drupal core: 8.8.0 to 8.9.2', ], '1.2.3' => [ 'core_compatibility' => '^8.9 || ^9', - 'core_compatibility_message' => 'This module is compatible with Drupal core: 8.9.0 to 8.9.2', + 'core_compatible' => FALSE, + 'core_compatibility_range' => 'Requires Drupal core: 8.9.0 to 8.9.2', ], '1.2.4' => [ 'core_compatibility' => '^8.9.2 || ^9', - 'core_compatibility_message' => 'This module is compatible with Drupal core: 8.9.2', + 'core_compatible' => FALSE, + 'core_compatibility_range' => 'Requires Drupal core: 8.9.2', ], '1.2.6' => [], ], 'expected_security_updates' => [ '1.2.5' => [ 'core_compatibility' => '8.9.0 || 8.9.2 || ^9.0.1', - 'core_compatibility_message' => 'This module is compatible with Drupal core: 8.9.0, 8.9.2', + 'core_compatible' => FALSE, + 'core_compatibility_range' => 'Requires Drupal core: 8.9.0, 8.9.2', ], ], ]; @@ -110,22 +122,26 @@ public function providerSetProjectCoreCompatibilityRanges() { $test_cases['with 9 full releases']['expected_releases'] = [ '1.0.1' => [ 'core_compatibility' => '8.x', - 'core_compatibility_message' => 'This module is compatible with Drupal core: 8.8.0 to 8.9.2', + 'core_compatible' => TRUE, + 'core_compatibility_range' => 'Requires Drupal core: 8.8.0 to 8.9.2', ], '1.2.3' => [ 'core_compatibility' => '^8.9 || ^9', - 'core_compatibility_message' => 'This module is compatible with Drupal core: 8.9.0 to 9.0.2', + 'core_compatible' => FALSE, + 'core_compatibility_range' => 'Requires Drupal core: 8.9.0 to 9.0.2', ], '1.2.4' => [ 'core_compatibility' => '^8.9.2 || ^9', - 'core_compatibility_message' => 'This module is compatible with Drupal core: 8.9.2 to 9.0.2', + 'core_compatible' => FALSE, + 'core_compatibility_range' => 'Requires Drupal core: 8.9.2 to 9.0.2', ], '1.2.6' => [], ]; $test_cases['with 9 full releases']['expected_security_updates'] = [ '1.2.5' => [ 'core_compatibility' => '8.9.0 || 8.9.2 || ^9.0.1', - 'core_compatibility_message' => 'This module is compatible with Drupal core: 8.9.0, 8.9.2, 9.0.1 to 9.0.2', + 'core_compatible' => FALSE, + 'core_compatibility_range' => 'Requires Drupal core: 8.9.0, 8.9.2, 9.0.1 to 9.0.2', ], ]; return $test_cases;