Issue #3280679 by quietone, Wim Leers: Remove legacy attributes, add supported_branches and consistently name update.module's XML fixtures
(cherry picked from commit 82d325ee79
)
merge-requests/7427/head
parent
7c2638e272
commit
5ed786fdcc
|
@ -3,7 +3,6 @@
|
|||
<title>AAA Update test</title>
|
||||
<short_name>aaa_update_test</short_name>
|
||||
<dc:creator>Drupal</dc:creator>
|
||||
<api_version>8.x</api_version>
|
||||
<supported_branches>8.x-1.</supported_branches>
|
||||
<project_status>published</project_status>
|
||||
<link>http://example.com/project/aaa_update_test</link>
|
||||
|
@ -15,15 +14,10 @@
|
|||
<name>aaa_update_test 8.x-1.3-beta1</name>
|
||||
<version>8.x-1.3-beta1</version>
|
||||
<core_compatibility>8.0.0 || 8.1.1</core_compatibility>
|
||||
<version_major>1</version_major>
|
||||
<version_patch>3</version_patch>
|
||||
<version_extra>beta1</version_extra>
|
||||
<status>published</status>
|
||||
<release_link>http://example.com/aaa_update_test-8-x-1-3-beta1-release</release_link>
|
||||
<download_link>http://example.com/aaa_update_test-8-x-1-3-beta1.tar.gz</download_link>
|
||||
<date>1250624521</date>
|
||||
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
|
||||
<filesize>1073751924</filesize>
|
||||
<terms>
|
||||
<term><name>Release type</name><value>New features</value></term>
|
||||
<term><name>Release type</name><value>Bug fixes</value></term>
|
||||
|
@ -33,14 +27,10 @@
|
|||
<name>aaa_update_test 8.x-1.2</name>
|
||||
<version>8.x-1.2</version>
|
||||
<core_compatibility>^8</core_compatibility>
|
||||
<version_major>1</version_major>
|
||||
<version_patch>2</version_patch>
|
||||
<status>published</status>
|
||||
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
|
||||
<download_link>http://example.com/aaa_update_test-8-x-1-2.tar.gz</download_link>
|
||||
<date>1250424521</date>
|
||||
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
|
||||
<filesize>1073741824</filesize>
|
||||
<terms>
|
||||
<term><name>Release type</name><value>New features</value></term>
|
||||
<term><name>Release type</name><value>Bug fixes</value></term>
|
||||
|
@ -49,14 +39,10 @@
|
|||
<release>
|
||||
<name>aaa_update_test 8.x-1.1</name>
|
||||
<version>8.x-1.1</version>
|
||||
<version_major>1</version_major>
|
||||
<version_patch>1</version_patch>
|
||||
<status>published</status>
|
||||
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
|
||||
<download_link>http://example.com/aaa_update_test-8-x-1-1.tar.gz</download_link>
|
||||
<date>1250424521</date>
|
||||
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
|
||||
<filesize>1073741824</filesize>
|
||||
<terms>
|
||||
<term><name>Release type</name><value>New features</value></term>
|
||||
<term><name>Release type</name><value>Bug fixes</value></term>
|
||||
|
@ -65,14 +51,10 @@
|
|||
<release>
|
||||
<name>aaa_update_test 8.x-1.0</name>
|
||||
<version>8.x-1.0</version>
|
||||
<version_major>1</version_major>
|
||||
<version_patch>0</version_patch>
|
||||
<status>published</status>
|
||||
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
|
||||
<download_link>http://example.com/aaa_update_test-8-x-1-0.tar.gz</download_link>
|
||||
<date>1250424521</date>
|
||||
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
|
||||
<filesize>1073741824</filesize>
|
||||
<terms>
|
||||
<term><name>Release type</name><value>New features</value></term>
|
||||
<term><name>Release type</name><value>Bug fixes</value></term>
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
<title>Drupal</title>
|
||||
<short_name>drupal</short_name>
|
||||
<dc:creator>Drupal</dc:creator>
|
||||
<api_version>8.x</api_version>
|
||||
<recommended_major>8</recommended_major>
|
||||
<supported_majors>8</supported_majors>
|
||||
<default_major>8</default_major>
|
||||
<project_status>published</project_status>
|
||||
<link>http://example.com/project/drupal</link>
|
||||
<terms><term><name>Projects</name><value>Drupal project</value></term></terms>
|
|
@ -3,10 +3,6 @@
|
|||
<title>Drupal</title>
|
||||
<short_name>drupal</short_name>
|
||||
<dc:creator>Drupal</dc:creator>
|
||||
<api_version>8.x</api_version>
|
||||
<recommended_major>8</recommended_major>
|
||||
<supported_majors>8</supported_majors>
|
||||
<default_major>8</default_major>
|
||||
<project_status>published</project_status>
|
||||
<link>http://example.com/project/drupal</link>
|
||||
<terms><term><name>Projects</name><value>Drupal project</value></term></terms>
|
|
@ -3,10 +3,6 @@
|
|||
<title>Drupal</title>
|
||||
<short_name>drupal</short_name>
|
||||
<dc:creator>Drupal</dc:creator>
|
||||
<api_version>8.x</api_version>
|
||||
<recommended_major>8</recommended_major>
|
||||
<supported_majors>8</supported_majors>
|
||||
<default_major>8</default_major>
|
||||
<project_status>published</project_status>
|
||||
<link>http://example.com/project/drupal</link>
|
||||
<terms><term><name>Projects</name><value>Drupal project</value></term></terms>
|
|
@ -63,7 +63,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
],
|
||||
]);
|
||||
$this->mockDefaultExtensionsInfo(['version' => '8.0.0']);
|
||||
$this->refreshUpdateStatus(['drupal' => '0.0', 'aaa_update_test' => 'no-releases']);
|
||||
$this->refreshUpdateStatus(['drupal' => '8.0.0', 'aaa_update_test' => 'no-releases']);
|
||||
// Cannot use $this->standardTests() because we need to check for the
|
||||
// 'No available releases found' string.
|
||||
$this->assertSession()->responseContains('<h3>Drupal core</h3>');
|
||||
|
@ -95,7 +95,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
$this->mockDefaultExtensionsInfo(['version' => '8.0.0']);
|
||||
$this->refreshUpdateStatus(
|
||||
[
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
'aaa_update_test' => '1_0',
|
||||
]
|
||||
);
|
||||
|
@ -113,7 +113,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
$this->mockDefaultExtensionsInfo(['version' => '8.0.0']);
|
||||
$this->refreshUpdateStatus(
|
||||
[
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
'aaa_update_test' => '1_0',
|
||||
]
|
||||
);
|
||||
|
@ -126,7 +126,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
$this->mockDefaultExtensionsInfo(['version' => '8.0.0']);
|
||||
$this->refreshUpdateStatus(
|
||||
[
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
'aaa_update_test' => '1_0',
|
||||
]
|
||||
);
|
||||
|
@ -176,7 +176,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
'hidden' => FALSE,
|
||||
],
|
||||
]);
|
||||
$this->refreshUpdateStatus(['drupal' => '0.0', '#all' => '1_0']);
|
||||
$this->refreshUpdateStatus(['drupal' => '8.0.0', '#all' => '1_0']);
|
||||
$this->standardTests();
|
||||
// We're expecting the report to say all projects are up to date.
|
||||
$this->assertSession()->pageTextContains('Up to date');
|
||||
|
@ -232,7 +232,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
],
|
||||
]);
|
||||
$xml_mapping = [
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
'update_test_subtheme' => '1_0',
|
||||
'update_test_basetheme' => '1_1-sec',
|
||||
];
|
||||
|
@ -263,7 +263,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
foreach (['-beta1', '-alpha1', ''] as $extra_version) {
|
||||
$full_version = "8.x-$version$extra_version";
|
||||
$this->refreshUpdateStatus([
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
'aaa_update_test' => str_replace('.', '_', $version) . $extra_version,
|
||||
]);
|
||||
$this->standardTests();
|
||||
|
@ -372,7 +372,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
// to avoid test failures in those cases.
|
||||
$update_settings->set('fetch.max_attempts', 99999)->save();
|
||||
$xml_mapping = [
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
'update_test_subtheme' => '1_0',
|
||||
'update_test_basetheme' => '1_1-sec',
|
||||
];
|
||||
|
@ -456,7 +456,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
$this->drupalGet('admin/reports/updates');
|
||||
|
||||
$xml_mapping = [
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
'aaa_update_test' => '1_0',
|
||||
'bbb_update_test' => 'does-not-exist',
|
||||
'ccc_update_test' => '1_0',
|
||||
|
@ -520,7 +520,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
$update_test_config->set('update_status', $update_status)->save();
|
||||
$this->refreshUpdateStatus(
|
||||
[
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
'aaa_update_test' => '1_0',
|
||||
]
|
||||
);
|
||||
|
@ -568,20 +568,20 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
// - '1.1' instead of '1.1-core_compatibility'.
|
||||
// - '1.1-alpha1' instead of '1.1-alpha1-core_compatibility'.
|
||||
// Delete the files:
|
||||
// - core/modules/update/tests/modules/update_test/drupal.1.1-alpha1-core_compatibility.xml
|
||||
// - core/modules/update/tests/modules/update_test/drupal.1.1-core_compatibility.xml
|
||||
$this->refreshUpdateStatus(['drupal' => '1.1-core_compatibility', 'aaa_update_test' => '8.x-1.2']);
|
||||
// - core/modules/update/tests/modules/update_test/drupal.8.1.1-alpha1-core_compatibility.xml
|
||||
// - core/modules/update/tests/modules/update_test/drupal.8.1.1-core_compatibility.xml
|
||||
$this->refreshUpdateStatus(['drupal' => '8.1.1-core_compatibility', 'aaa_update_test' => '8.x-1.2']);
|
||||
$this->assertCoreCompatibilityMessage('8.x-1.2', '8.0.0 to 8.1.1', 'Recommended version:');
|
||||
$this->assertCoreCompatibilityMessage('8.x-1.3-beta1', '8.0.0, 8.1.1', 'Latest version:');
|
||||
|
||||
// Change the available core releases and confirm that the messages change.
|
||||
$this->refreshUpdateStatus(['drupal' => '1.1-alpha1-core_compatibility', 'aaa_update_test' => '8.x-1.2']);
|
||||
$this->refreshUpdateStatus(['drupal' => '8.1.1-alpha1-core_compatibility', 'aaa_update_test' => '8.x-1.2']);
|
||||
$this->assertCoreCompatibilityMessage('8.x-1.2', '8.0.0 to 8.1.0', 'Recommended version:');
|
||||
$this->assertCoreCompatibilityMessage('8.x-1.3-beta1', '8.0.0', 'Latest version:');
|
||||
|
||||
// Confirm that messages are displayed for security and 'Also available'
|
||||
// updates.
|
||||
$this->refreshUpdateStatus(['drupal' => '1.1-core_compatibility', 'aaa_update_test' => 'core_compatibility.8.x-1.2_8.x-2.2']);
|
||||
$this->refreshUpdateStatus(['drupal' => '8.1.1-core_compatibility', 'aaa_update_test' => 'core_compatibility.8.x-1.2_8.x-2.2']);
|
||||
$this->assertCoreCompatibilityMessage('8.x-1.2', '8.1.0 to 8.1.1', 'Security update:', FALSE);
|
||||
$this->assertCoreCompatibilityMessage('8.x-2.2', '8.1.1', 'Also available:', FALSE);
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
],
|
||||
]);
|
||||
$this->mockDefaultExtensionsInfo(['version' => '8.0.0']);
|
||||
$this->refreshUpdateStatus(['drupal' => '0.0', 'aaa_update_test' => $fixture]);
|
||||
$this->refreshUpdateStatus(['drupal' => '8.0.0', 'aaa_update_test' => $fixture]);
|
||||
$this->assertSecurityUpdates('aaa_update_test', $expected_security_releases, $expected_update_message_type, 'table.update:nth-of-type(2)');
|
||||
}
|
||||
|
||||
|
@ -736,7 +736,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
],
|
||||
]);
|
||||
$this->refreshUpdateStatus([
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
$this->updateProject => '1_0-supported',
|
||||
]);
|
||||
// @todo Change the version label to 'Recommended version:' in
|
||||
|
@ -744,7 +744,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
$this->confirmRevokedStatus('8.x-1.0', '8.x-2.0', 'Also available:');
|
||||
|
||||
$this->refreshUpdateStatus([
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
$this->updateProject => '1_0-unsupported',
|
||||
]);
|
||||
$this->confirmRevokedStatus('8.x-1.0', '8.x-2.0', 'Recommended version:');
|
||||
|
@ -774,7 +774,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
],
|
||||
]);
|
||||
$this->refreshUpdateStatus([
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
$this->updateProject => '1_0-supported',
|
||||
]);
|
||||
// @todo Change the version label to 'Recommended version:' in
|
||||
|
@ -782,7 +782,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
$this->confirmUnsupportedStatus('8.x-1.1', '8.x-2.0', 'Also available:');
|
||||
|
||||
$this->refreshUpdateStatus([
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
$this->updateProject => '1_0-unsupported',
|
||||
]);
|
||||
$this->confirmUnsupportedStatus('8.x-1.1', '8.x-2.0', 'Recommended version:');
|
||||
|
@ -817,7 +817,7 @@ class UpdateContribTest extends UpdateTestBase {
|
|||
}
|
||||
$this->mockInstalledExtensionsInfo($installed_extensions);
|
||||
$this->refreshUpdateStatus([
|
||||
'drupal' => '0.0',
|
||||
'drupal' => '8.0.0',
|
||||
$this->updateProject => '1_0-supported',
|
||||
]);
|
||||
$this->standardTests();
|
||||
|
|
|
@ -87,8 +87,8 @@ class UpdateManagerUpdateTest extends UpdateTestBase {
|
|||
* - '1.1' instead of '1.1-core_compatibility'.
|
||||
* - '1.1-alpha1' instead of '1.1-alpha1-core_compatibility'.
|
||||
* Delete the files:
|
||||
* - core/modules/update/tests/modules/update_test/drupal.1.1-alpha1-core_compatibility.xml
|
||||
* - core/modules/update/tests/modules/update_test/drupal.1.1-core_compatibility.xml
|
||||
* - core/modules/update/tests/modules/update_test/drupal.8.1.1-alpha1-core_compatibility.xml
|
||||
* - core/modules/update/tests/modules/update_test/drupal.8.1.1-core_compatibility.xml
|
||||
*
|
||||
* @return array[]
|
||||
* Test data.
|
||||
|
@ -96,7 +96,7 @@ class UpdateManagerUpdateTest extends UpdateTestBase {
|
|||
public static function incompatibleUpdatesTableProvider() {
|
||||
return [
|
||||
'only one compatible' => [
|
||||
'core_fixture' => '1.1-core_compatibility',
|
||||
'core_fixture' => '8.1.1-core_compatibility',
|
||||
// aaa_update_test.8.x-1.2.xml has core compatibility set and will test
|
||||
// the case where $recommended_release['core_compatible'] === TRUE in
|
||||
// \Drupal\update\Form\UpdateManagerUpdate.
|
||||
|
@ -109,7 +109,7 @@ class UpdateManagerUpdateTest extends UpdateTestBase {
|
|||
'incompatible' => [],
|
||||
],
|
||||
'only one incompatible' => [
|
||||
'core_fixture' => '1.1-core_compatibility',
|
||||
'core_fixture' => '8.1.1-core_compatibility',
|
||||
'a_fixture' => 'core_compatibility.8.x-1.2_8.x-2.2',
|
||||
// Use a fixture with only a 8.x-1.0 release so BBB is up to date.
|
||||
'b_fixture' => '1_0',
|
||||
|
@ -122,7 +122,7 @@ class UpdateManagerUpdateTest extends UpdateTestBase {
|
|||
],
|
||||
],
|
||||
'two compatible, no incompatible' => [
|
||||
'core_fixture' => '1.1-core_compatibility',
|
||||
'core_fixture' => '8.1.1-core_compatibility',
|
||||
'a_fixture' => '8.x-1.2',
|
||||
// bbb_update_test.1_1.xml does not have core compatibility set and will
|
||||
// test the case where $recommended_release['core_compatible'] === NULL
|
||||
|
@ -135,7 +135,7 @@ class UpdateManagerUpdateTest extends UpdateTestBase {
|
|||
'incompatible' => [],
|
||||
],
|
||||
'two incompatible, no compatible' => [
|
||||
'core_fixture' => '1.1-core_compatibility',
|
||||
'core_fixture' => '8.1.1-core_compatibility',
|
||||
'a_fixture' => 'core_compatibility.8.x-1.2_8.x-2.2',
|
||||
// bbb_update_test.1_2.xml has core compatibility set and will test the
|
||||
// case where $recommended_release['core_compatible'] === FALSE in
|
||||
|
@ -154,7 +154,7 @@ class UpdateManagerUpdateTest extends UpdateTestBase {
|
|||
],
|
||||
],
|
||||
'one compatible, one incompatible' => [
|
||||
'core_fixture' => '1.1-core_compatibility',
|
||||
'core_fixture' => '8.1.1-core_compatibility',
|
||||
'a_fixture' => 'core_compatibility.8.x-1.2_8.x-2.2',
|
||||
'b_fixture' => '1_1',
|
||||
'compatible' => [
|
||||
|
@ -245,7 +245,7 @@ class UpdateManagerUpdateTest extends UpdateTestBase {
|
|||
$uninstalled_table_locator = '[data-drupal-selector="edit-uninstalled-projects"]';
|
||||
|
||||
$fixtures = [
|
||||
'drupal' => '1.1-core_compatibility',
|
||||
'drupal' => '8.1.1-core_compatibility',
|
||||
'aaa_update_test' => '8.x-1.2',
|
||||
// Use a fixture with only a 8.x-1.0 release so BBB is up to date.
|
||||
'bbb_update_test' => '1_0',
|
||||
|
|
|
@ -137,7 +137,7 @@ class UpdateMiscTest extends UpdateTestBase {
|
|||
->toString())
|
||||
->save();
|
||||
$this->config('update_test.settings')
|
||||
->set('xml_map', ['drupal' => '0.0'])
|
||||
->set('xml_map', ['drupal' => '8.0.0'])
|
||||
->save();
|
||||
|
||||
$this->drupalGet('admin/reports/updates');
|
||||
|
@ -163,7 +163,7 @@ class UpdateMiscTest extends UpdateTestBase {
|
|||
->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
|
||||
->save();
|
||||
$this->config('update_test.settings')
|
||||
->set('xml_map', ['drupal' => '0.1'])
|
||||
->set('xml_map', ['drupal' => '8.0.1'])
|
||||
->save();
|
||||
|
||||
$this->drupalGet('admin/reports/updates');
|
||||
|
@ -199,7 +199,7 @@ class UpdateMiscTest extends UpdateTestBase {
|
|||
$this->config('update.settings')
|
||||
->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
|
||||
->save();
|
||||
$this->mockReleaseHistory(['drupal' => 'sec.0.2']);
|
||||
$this->mockReleaseHistory(['drupal' => 'sec.8.0.2']);
|
||||
|
||||
$this->drupalGet('admin/reports/updates');
|
||||
$this->clickLink('Check manually');
|
||||
|
@ -232,7 +232,7 @@ class UpdateMiscTest extends UpdateTestBase {
|
|||
$this->config('update.settings')
|
||||
->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
|
||||
->save();
|
||||
$this->mockReleaseHistory(['drupal' => '0.0']);
|
||||
$this->mockReleaseHistory(['drupal' => '8.0.0']);
|
||||
|
||||
$this->cronRun();
|
||||
$this->drupalGet('admin/modules');
|
||||
|
|
|
@ -61,12 +61,12 @@ class UpdateSemverCoreSecurityCoverageTest extends UpdateSemverCoreTestBase {
|
|||
*
|
||||
* These test cases rely on the following fixtures containing the following
|
||||
* releases:
|
||||
* - drupal.sec.2.0_3.0-rc1.xml
|
||||
* - drupal.sec.8.2.0_3.0-rc1.xml
|
||||
* - 8.2.0
|
||||
* - 8.3.0-rc1
|
||||
* - drupal.sec.2.0.xml
|
||||
* - drupal.sec.8.2.0.xml
|
||||
* - 8.2.0
|
||||
* - drupal.sec.2.0_9.0.0.xml
|
||||
* - drupal.sec.8.2.0_9.0.0.xml
|
||||
* - 8.2.0
|
||||
* - 9.0.0
|
||||
* - drupal.sec.9.5.0.xml
|
||||
|
@ -84,35 +84,35 @@ class UpdateSemverCoreSecurityCoverageTest extends UpdateSemverCoreTestBase {
|
|||
$test_cases = [
|
||||
'8.0.0, unsupported' => [
|
||||
'installed_version' => '8.0.0',
|
||||
'fixture' => 'sec.2.0_3.0-rc1',
|
||||
'fixture' => 'sec.8.2.0_8.3.0-rc1',
|
||||
'requirements_section_heading' => 'Errors found',
|
||||
'message' => "$coverage_ended_message $update_asap_message $release_coverage_message",
|
||||
'mock_date' => '',
|
||||
],
|
||||
'8.1.0, supported with 3rc' => [
|
||||
'installed_version' => '8.1.0',
|
||||
'fixture' => 'sec.2.0_3.0-rc1',
|
||||
'fixture' => 'sec.8.2.0_8.3.0-rc1',
|
||||
'requirements_section_heading' => 'Warnings found',
|
||||
'message' => "Covered until 8.3.0 Update to 8.2 or higher soon to continue receiving security updates. $release_coverage_message",
|
||||
'mock_date' => '',
|
||||
],
|
||||
'8.1.0, supported' => [
|
||||
'installed_version' => '8.1.0',
|
||||
'fixture' => 'sec.2.0',
|
||||
'fixture' => 'sec.8.2.0',
|
||||
'requirements_section_heading' => 'Warnings found',
|
||||
'message' => "Covered until 8.3.0 Update to 8.2 or higher soon to continue receiving security updates. $release_coverage_message",
|
||||
'mock_date' => '',
|
||||
],
|
||||
'8.2.0, supported with 3rc' => [
|
||||
'installed_version' => '8.2.0',
|
||||
'fixture' => 'sec.2.0_3.0-rc1',
|
||||
'fixture' => 'sec.8.2.0_8.3.0-rc1',
|
||||
'requirements_section_heading' => 'Checked',
|
||||
'message' => "Covered until 8.4.0 $release_coverage_message",
|
||||
'mock_date' => '',
|
||||
],
|
||||
'8.2.0, supported' => [
|
||||
'installed_version' => '8.2.0',
|
||||
'fixture' => 'sec.2.0',
|
||||
'fixture' => 'sec.8.2.0',
|
||||
'requirements_section_heading' => 'Checked',
|
||||
'message' => "Covered until 8.4.0 $release_coverage_message",
|
||||
'mock_date' => '',
|
||||
|
@ -120,14 +120,14 @@ class UpdateSemverCoreSecurityCoverageTest extends UpdateSemverCoreTestBase {
|
|||
// Ensure we don't show messages for pre-release or dev versions.
|
||||
'8.2.0-beta2, no message' => [
|
||||
'installed_version' => '8.2.0-beta2',
|
||||
'fixture' => 'sec.2.0_3.0-rc1',
|
||||
'fixture' => 'sec.8.2.0_8.3.0-rc1',
|
||||
'requirements_section_heading' => '',
|
||||
'message' => '',
|
||||
'mock_date' => '',
|
||||
],
|
||||
'8.1.0-dev, no message' => [
|
||||
'installed_version' => '8.1.0-dev',
|
||||
'fixture' => 'sec.2.0_3.0-rc1',
|
||||
'fixture' => 'sec.8.2.0_8.3.0-rc1',
|
||||
'requirements_section_heading' => '',
|
||||
'message' => '',
|
||||
'mock_date' => '',
|
||||
|
@ -137,7 +137,7 @@ class UpdateSemverCoreSecurityCoverageTest extends UpdateSemverCoreTestBase {
|
|||
// CORE_MINORS_WITH_SECURITY_COVERAGE minors have been released.
|
||||
'8.0.0, 9 unsupported' => [
|
||||
'installed_version' => '8.0.0',
|
||||
'fixture' => 'sec.2.0_9.0.0',
|
||||
'fixture' => 'sec.8.2.0_9.0.0',
|
||||
'requirements_section_heading' => 'Errors found',
|
||||
'message' => "$coverage_ended_message $update_asap_message $release_coverage_message",
|
||||
'mock_date' => '',
|
||||
|
@ -147,7 +147,7 @@ class UpdateSemverCoreSecurityCoverageTest extends UpdateSemverCoreTestBase {
|
|||
// CORE_MINORS_WITH_SECURITY_COVERAGE minors have not been released.
|
||||
'8.2.0, 9 warning' => [
|
||||
'installed_version' => '8.2.0',
|
||||
'fixture' => 'sec.2.0_9.0.0',
|
||||
'fixture' => 'sec.8.2.0_9.0.0',
|
||||
'requirements_section_heading' => 'Warnings found',
|
||||
'message' => "Covered until 8.4.0 Update to 8.3 or higher soon to continue receiving security updates. $release_coverage_message",
|
||||
'mock_date' => '',
|
||||
|
|
|
@ -98,7 +98,7 @@ class UpdateSemverCoreTest extends UpdateSemverCoreTestBase {
|
|||
$this->drupalGet('admin/reports/status');
|
||||
$this->assertSession()->statusCodeEquals(200);
|
||||
$this->assertSession()->pageTextContains('There was a problem checking available updates for Drupal.');
|
||||
$this->mockReleaseHistory(['drupal' => 'sec.0.2']);
|
||||
$this->mockReleaseHistory(['drupal' => 'sec.8.0.2']);
|
||||
// Simulate the update_available_releases state expiring before cron is run
|
||||
// and the state is used by \Drupal\update\UpdateManager::getProjects().
|
||||
\Drupal::keyValueExpirable('update_available_releases')->deleteAll();
|
||||
|
|
|
@ -56,7 +56,7 @@ abstract class UpdateSemverTestBase extends UpdateTestBase {
|
|||
*/
|
||||
protected function refreshUpdateStatus($xml_map, $url = 'update-test') {
|
||||
if (!isset($xml_map['drupal'])) {
|
||||
$xml_map['drupal'] = '0.0';
|
||||
$xml_map['drupal'] = '8.0.0';
|
||||
}
|
||||
parent::refreshUpdateStatus($xml_map, $url);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ trait UpdateSemverTestBaselineTrait {
|
|||
/**
|
||||
* Tests the Update Manager module when no updates are available.
|
||||
*
|
||||
* The XML fixture file 'drupal.1.0.xml' which is one of the XML files this
|
||||
* The XML fixture file 'drupal.8.1.0.xml' which is one of the XML files this
|
||||
* test uses also contains 2 extra releases that are newer than '8.0.1'. These
|
||||
* releases will not show as available updates because of the following
|
||||
* reasons:
|
||||
|
@ -30,7 +30,7 @@ trait UpdateSemverTestBaselineTrait {
|
|||
foreach ([0, 1] as $patch_version) {
|
||||
foreach (['-alpha1', '-beta1', ''] as $extra_version) {
|
||||
$this->setProjectInstalledVersion("8.$minor_version.$patch_version" . $extra_version);
|
||||
$this->refreshUpdateStatus([$this->updateProject => "$minor_version.$patch_version" . $extra_version]);
|
||||
$this->refreshUpdateStatus([$this->updateProject => "8.$minor_version.$patch_version" . $extra_version]);
|
||||
$this->standardTests();
|
||||
// The XML test fixtures for this method all contain the '8.2.0'
|
||||
// release but because '8.2.0' is not in a supported branch it will
|
||||
|
@ -58,7 +58,7 @@ trait UpdateSemverTestBaselineTrait {
|
|||
foreach ([0, 1] as $minor_version) {
|
||||
foreach (['-alpha1', '-beta1', ''] as $extra_version) {
|
||||
$full_version = "8.$minor_version.1$extra_version";
|
||||
$this->refreshUpdateStatus([$this->updateProject => "$minor_version.1" . $extra_version]);
|
||||
$this->refreshUpdateStatus([$this->updateProject => "8.$minor_version.1" . $extra_version]);
|
||||
$this->standardTests();
|
||||
$this->assertUpdateTableTextNotContains('Security update required!');
|
||||
// The XML test fixtures for this method all contain the '8.2.0' release
|
||||
|
@ -124,7 +124,7 @@ trait UpdateSemverTestBaselineTrait {
|
|||
* releases supported, 8 and 9.
|
||||
*/
|
||||
public function testMajorUpdateAvailable() {
|
||||
foreach (['9', '8.0.0-9.0.0'] as $release_history) {
|
||||
foreach (['9.0.0', '8.0.0-9.0.0'] as $release_history) {
|
||||
foreach ([0, 1] as $minor_version) {
|
||||
foreach ([0, 1] as $patch_version) {
|
||||
foreach (['-alpha1', '-beta1', ''] as $extra_version) {
|
||||
|
@ -142,7 +142,7 @@ trait UpdateSemverTestBaselineTrait {
|
|||
->toString());
|
||||
$this->assertUpdateTableTextNotContains('Latest version:');
|
||||
|
||||
if ($release_history === '9') {
|
||||
if ($release_history === '9.0.0') {
|
||||
$this->assertUpdateTableTextNotContains('Up to date');
|
||||
$this->assertUpdateTableTextContains('Not supported!');
|
||||
$this->assertVersionUpdateLinks('Recommended version:', '9.0.0');
|
||||
|
@ -173,15 +173,15 @@ trait UpdateSemverTestBaselineTrait {
|
|||
* whether the installed version is in a supported branch or not. This test
|
||||
* relies on 2 test XML fixtures that are identical except for the
|
||||
* 'supported_branches' value:
|
||||
* - [::$updateProject].1.0.xml
|
||||
* - [::$updateProject].8.1.0.xml
|
||||
* 'supported_branches' is '8.0.,8.1.'.
|
||||
* - [::$updateProject].1.0-unsupported.xml
|
||||
* - [::$updateProject].8.1.0-unsupported.xml
|
||||
* 'supported_branches' is '8.1.'.
|
||||
* They both have an '8.0.2' release that is unpublished and an '8.1.0'
|
||||
* release that is published and is the expected update.
|
||||
*/
|
||||
public function testRevokedRelease() {
|
||||
foreach (['1.0', '1.0-unsupported'] as $fixture) {
|
||||
foreach (['8.1.0', '8.1.0-unsupported'] as $fixture) {
|
||||
$this->setProjectInstalledVersion('8.0.2');
|
||||
$this->refreshUpdateStatus([$this->updateProject => $fixture]);
|
||||
$this->standardTests();
|
||||
|
@ -196,16 +196,16 @@ trait UpdateSemverTestBaselineTrait {
|
|||
* the installed version is in a supported branch or not. This test relies on
|
||||
* 2 test XML fixtures that are identical except for the 'supported_branches'
|
||||
* value:
|
||||
* - [::$updateProject].1.0.xml
|
||||
* - [::$updateProject].8.1.0.xml
|
||||
* 'supported_branches' is '8.0.,8.1.'.
|
||||
* - [::$updateProject].1.0-unsupported.xml
|
||||
* - [::$updateProject].8.1.0-unsupported.xml
|
||||
* 'supported_branches' is '8.1.'.
|
||||
* They both have an '8.0.3' release that has the 'Release type' value of
|
||||
* 'unsupported' and an '8.1.0' release that has the 'Release type' value of
|
||||
* 'supported' and is the expected update.
|
||||
*/
|
||||
public function testUnsupportedRelease() {
|
||||
foreach (['1.0', '1.0-unsupported'] as $fixture) {
|
||||
foreach (['8.1.0', '8.1.0-unsupported'] as $fixture) {
|
||||
$this->setProjectInstalledVersion('8.0.3');
|
||||
$this->refreshUpdateStatus([$this->updateProject => $fixture]);
|
||||
$this->standardTests();
|
||||
|
|
|
@ -34,15 +34,15 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
*
|
||||
* These test cases rely on the following fixtures containing the following
|
||||
* releases:
|
||||
* - [::$updateProject].sec.0.1_0.2.xml
|
||||
* - [::$updateProject].sec.8.0.1_0.2.xml
|
||||
* - 8.0.2 Security update
|
||||
* - 8.0.1 Security update, Insecure
|
||||
* - 8.0.0 Insecure
|
||||
* - [::$updateProject].sec.0.2.xml
|
||||
* - [::$updateProject].sec.8.0.2.xml
|
||||
* - 8.0.2 Security update
|
||||
* - 8.0.1 Insecure
|
||||
* - 8.0.0 Insecure
|
||||
* - [::$updateProject].sec.2.0-rc2.xml
|
||||
* - [::$updateProject].sec.8.2.0-rc2.xml
|
||||
* - 8.2.0-rc2 Security update
|
||||
* - 8.2.0-rc1 Insecure
|
||||
* - 8.2.0-beta2 Insecure
|
||||
|
@ -55,23 +55,23 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
* - 8.0.2 Security update
|
||||
* - 8.0.1 Insecure
|
||||
* - 8.0.0 Insecure
|
||||
* - [::$updateProject].sec.1.2.xml
|
||||
* - [::$updateProject].sec.8.1.2.xml
|
||||
* - 8.1.2 Security update
|
||||
* - 8.1.1 Insecure
|
||||
* - 8.1.0 Insecure
|
||||
* - 8.0.2
|
||||
* - 8.0.1
|
||||
* - 8.0.0
|
||||
* - [::$updateProject].sec.1.2_insecure.xml
|
||||
* - [::$updateProject].sec.8.1.2_insecure.xml
|
||||
* - 8.1.2 Security update
|
||||
* - 8.1.1 Insecure
|
||||
* - 8.1.0 Insecure
|
||||
* - 8.0.2 Insecure
|
||||
* - 8.0.1 Insecure
|
||||
* - 8.0.0 Insecure
|
||||
* - [::$updateProject].sec.1.2_insecure-unsupported
|
||||
* - [::$updateProject].sec.8.1.2_insecure-unsupported
|
||||
* This file has the exact releases as
|
||||
* [::$updateProject].sec.1.2_insecure.xml. It has a different value for
|
||||
* [::$updateProject].sec.8.1.2_insecure.xml. It has a different value for
|
||||
* 'supported_branches' that does not contain '8.0.'. It is used to ensure
|
||||
* that the "Security update required!" is displayed even if the currently
|
||||
* installed version is in an unsupported branch.
|
||||
|
@ -97,7 +97,7 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
'site_patch_version' => '0.0',
|
||||
'expected_security_releases' => ['0.2'],
|
||||
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
|
||||
'fixture' => 'sec.0.2',
|
||||
'fixture' => 'sec.8.0.2',
|
||||
],
|
||||
// Site on latest security release available for site minor release 0.
|
||||
// Minor release 1 also has a security release, and the current release
|
||||
|
@ -106,16 +106,16 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
'site_patch_version' => '0.2',
|
||||
'expected_security_release' => ['1.2', '2.0-rc2'],
|
||||
'expected_update_message_type' => static::UPDATE_AVAILABLE,
|
||||
'fixture' => 'sec.2.0-rc2',
|
||||
'fixture' => 'sec.8.2.0-rc2',
|
||||
],
|
||||
// Two security releases available for site minor release 0.
|
||||
// 0.1 security release marked as insecure.
|
||||
// No releases for next minor.
|
||||
'0.0, 0.1 0.2' => [
|
||||
'0.0, 0.1, 0.2' => [
|
||||
'site_patch_version' => '0.0',
|
||||
'expected_security_releases' => ['0.2'],
|
||||
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
|
||||
'fixture' => 'sec.0.1_0.2',
|
||||
'fixture' => 'sec.8.0.1_8.0.2',
|
||||
],
|
||||
// Security release available for site minor release 1.
|
||||
// No releases for next minor.
|
||||
|
@ -123,7 +123,7 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
'site_patch_version' => '1.0',
|
||||
'expected_security_releases' => ['1.2'],
|
||||
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
|
||||
'fixture' => 'sec.1.2',
|
||||
'fixture' => 'sec.8.1.2',
|
||||
],
|
||||
// Security release available for site minor release 0.
|
||||
// Security release also available for next minor.
|
||||
|
@ -131,7 +131,7 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
'site_patch_version' => '0.0',
|
||||
'expected_security_releases' => ['0.2', '1.2', '2.0-rc2'],
|
||||
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
|
||||
'fixture' => 'sec.2.0-rc2',
|
||||
'fixture' => 'sec.8.2.0-rc2',
|
||||
],
|
||||
// No newer security release for site minor 1.
|
||||
// Previous minor has security release.
|
||||
|
@ -139,7 +139,7 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
'site_patch_version' => '1.2',
|
||||
'expected_security_releases' => [],
|
||||
'expected_update_message_type' => static::UPDATE_NONE,
|
||||
'fixture' => 'sec.2.0-rc2',
|
||||
'fixture' => 'sec.8.2.0-rc2',
|
||||
],
|
||||
// No security release available for site minor release 0.
|
||||
// Security release available for next minor.
|
||||
|
@ -147,7 +147,7 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
'site_patch_version' => '0.0',
|
||||
'expected_security_releases' => ['1.2'],
|
||||
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
|
||||
'fixture' => 'sec.1.2_insecure',
|
||||
'fixture' => 'sec.8.1.2_insecure',
|
||||
],
|
||||
// No security release available for site minor release 0.
|
||||
// Site minor is not a supported branch.
|
||||
|
@ -156,7 +156,7 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
'site_patch_version' => '0.0',
|
||||
'expected_security_releases' => ['1.2'],
|
||||
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
|
||||
'fixture' => 'sec.1.2_insecure-unsupported',
|
||||
'fixture' => 'sec.8.1.2_insecure-unsupported',
|
||||
],
|
||||
// All releases for minor 0 are secure.
|
||||
// Security release available for next minor.
|
||||
|
@ -164,20 +164,20 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
'site_patch_version' => '0.0',
|
||||
'expected_security_release' => ['1.2'],
|
||||
'expected_update_message_type' => static::UPDATE_AVAILABLE,
|
||||
'fixture' => 'sec.1.2',
|
||||
'fixture' => 'sec.8.1.2',
|
||||
],
|
||||
'0.2, 1.2, secure' => [
|
||||
'site_patch_version' => '0.2',
|
||||
'expected_security_release' => ['1.2'],
|
||||
'expected_update_message_type' => static::UPDATE_AVAILABLE,
|
||||
'fixture' => 'sec.1.2',
|
||||
'fixture' => 'sec.8.1.2',
|
||||
],
|
||||
// Site on 2.0-rc2 which is a security release.
|
||||
'2.0-rc2, 0.2 1.2' => [
|
||||
'site_patch_version' => '2.0-rc2',
|
||||
'expected_security_releases' => [],
|
||||
'expected_update_message_type' => static::UPDATE_NONE,
|
||||
'fixture' => 'sec.2.0-rc2',
|
||||
'fixture' => 'sec.8.2.0-rc2',
|
||||
],
|
||||
// Ensure that 8.0.2 security release is not shown because it is earlier
|
||||
// version than 1.0.
|
||||
|
@ -185,7 +185,7 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
'site_patch_version' => '1.0',
|
||||
'expected_security_releases' => ['1.2', '2.0-rc2'],
|
||||
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
|
||||
'fixture' => 'sec.2.0-rc2',
|
||||
'fixture' => 'sec.8.2.0-rc2',
|
||||
],
|
||||
];
|
||||
$pre_releases = [
|
||||
|
@ -205,7 +205,7 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
'site_patch_version' => $pre_release,
|
||||
'expected_security_releases' => [],
|
||||
'expected_update_message_type' => $pre_release === '2.0-rc2' ? static::UPDATE_NONE : static::UPDATE_AVAILABLE,
|
||||
'fixture' => 'sec.2.0-rc2-b',
|
||||
'fixture' => 'sec.8.2.0-rc2-b',
|
||||
];
|
||||
// If the site is on an alpha/beta/RC of an upcoming minor and there is
|
||||
// an RC version with a security update, it should be recommended.
|
||||
|
@ -213,7 +213,7 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
|
|||
'site_patch_version' => $pre_release,
|
||||
'expected_security_releases' => $pre_release === '2.0-rc2' ? [] : ['2.0-rc2'],
|
||||
'expected_update_message_type' => $pre_release === '2.0-rc2' ? static::UPDATE_NONE : static::SECURITY_UPDATE_REQUIRED,
|
||||
'fixture' => 'sec.2.0-rc2',
|
||||
'fixture' => 'sec.8.2.0-rc2',
|
||||
];
|
||||
}
|
||||
return $test_cases;
|
||||
|
|
|
@ -65,8 +65,8 @@ trait UpdateTestTrait {
|
|||
* The release history XML files to use for particular extension(s). The
|
||||
* keys are the extension names (use 'drupal' for Drupal core itself), and
|
||||
* the values are the suffix of the release history XML file to use. For
|
||||
* example, @code 'drupal' => 'sec.0.2' @endcode will map to a file called
|
||||
* drupal.sec.0.2.xml. Look at
|
||||
* example, @code 'drupal' => 'sec.8.0.2' @endcode will map to a file called
|
||||
* drupal.sec.8.0.2.xml. Look at
|
||||
* core/modules/update/tests/fixtures/release-history for more release
|
||||
* history XML examples.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue