Skip to content
Snippets Groups Projects
Commit 6696dd12 authored by Kunal Sachdev's avatar Kunal Sachdev Committed by Ted Bowman
Browse files

Issue #3321386 by kunal.sachdev, tedbow, Wim Leers: Add missing test coverage...

Issue #3321386 by kunal.sachdev, tedbow, Wim Leers: Add missing test coverage in SupportedReleaseValidatorTest
parent e13acfd9
No related branches found
No related tags found
1 merge request!592Issue #3321386: Add missing test coverage in SupportedReleaseValidatorTest
<?xml version="1.0" encoding="utf-8"?>
<!--
This fixture is used by \Drupal\Tests\package_manager\Kernel\SupportedReleaseValidatorTest.
Contains metadata about the following (fake) releases of Package Manager Theme, all of which are secure, in order:
- 8.2.0, which is in an unsupported branch
- 8.1.1
- 8.1.0
-->
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Package Manager Theme</title>
<short_name>package_manager_theme</short_name>
<dc:creator>Drupal</dc:creator>
<supported_branches>8.0.,8.1.</supported_branches>
<project_status>published</project_status>
<link>http://example.com/project/package_manager_theme</link>
<terms>
<term><name>Projects</name><value>Package Manager Theme project</value></term>
</terms>
<releases>
<release>
<name>Package Manager Theme 8.2.0</name>
<version>8.2.0</version>
<tag>8.2.0</tag>
<status>published</status>
<release_link>http://example.com/package_manager_theme-8-2-0-release</release_link>
<download_link>http://example.com/package_manager_theme-8-2-0.tar.gz</download_link>
<date>1584195300</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Package Manager Theme 8.1.1</name>
<version>8.1.1</version>
<tag>8.1.1</tag>
<status>published</status>
<release_link>http://example.com/package_manager_theme-8-1-1-release</release_link>
<download_link>http://example.com/package_manager_theme-8-1-1.tar.gz</download_link>
<date>1581603300</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Package Manager Theme 8.1.0</name>
<version>8.1.0</version>
<tag>8.1.0</tag>
<status>published</status>
<release_link>http://example.com/package_manager_theme-8-1-0-release</release_link>
<download_link>http://example.com/package_manager_theme-8-1-0.tar.gz</download_link>
<date>1573827300</date>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>
......@@ -42,6 +42,18 @@ class SupportedReleaseValidatorTest extends PackageManagerKernelTestBase {
'type' => 'drupal-module',
'install_path' => '../../modules/aaa_update_test',
]);
$this->addPackage($active_dir, [
'name' => "drupal/package_manager_theme",
'version' => '8.1.0',
'type' => 'drupal-theme',
'install_path' => '../../modules/package_manager_theme',
]);
$this->addPackage($active_dir, [
'name' => "somewhere/a_drupal_module",
'version' => '8.1.0',
'type' => 'drupal-module',
'install_path' => '../../modules/a_drupal_module',
]);
}
/**
......@@ -145,6 +157,51 @@ class SupportedReleaseValidatorTest extends PackageManagerKernelTestBase {
],
[],
],
'package_manager_theme, supported update' => [
[
'package_manager_theme' => "$release_fixture_folder/package_manager_theme.1.1.xml",
],
NULL,
TRUE,
[
'name' => "drupal/package_manager_theme",
'version' => '8.1.1',
'type' => 'drupal-theme',
'install_path' => NULL,
],
[],
],
'package_manager_theme, update to unsupported branch' => [
[
'package_manager_theme' => "$release_fixture_folder/package_manager_theme.1.1.xml",
],
NULL,
TRUE,
[
'name' => "drupal/package_manager_theme",
'version' => '8.2.0',
'type' => 'drupal-theme',
'install_path' => NULL,
],
[
ValidationResult::createError(['package_manager_theme (drupal/package_manager_theme) 8.2.0'], $summary),
],
],
// For modules that don't start with 'drupal/' will not have update XML
// from drupal.org and so will not be checked by the validator.
// @see \Drupal\package_manager\Validator\SupportedReleaseValidator::checkStagedReleases()
'updating a module that does not start with drupal/' => [
[],
NULL,
TRUE,
[
'name' => "somewhere/a_drupal_module",
'version' => '8.1.1',
'type' => 'drupal-module',
'install_path' => NULL,
],
[],
],
];
}
......
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