Skip to content
Snippets Groups Projects
Commit 61aba172 authored by Theresa Grannum's avatar Theresa Grannum Committed by Adam G-H
Browse files

Issue #3274633 by Theresa.Grannum, tedbow: Move semver test to new directory

parent ca81aef4
No related branches found
No related tags found
1 merge request!265Issue #3274633: Move semver test to new directory
......@@ -44,7 +44,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
*/
protected function setUp(): void {
parent::setUp();
$this->setReleaseMetadata(__DIR__ . '/../../../../tests/fixtures/release-history/semver_test.1.1.xml');
$this->setReleaseMetadata(__DIR__ . '/../../fixtures/release-history/semver_test.1.1.xml');
$this->drupalLogin($this->rootUser);
$this->drupalPlaceBlock('local_tasks_block', ['primary' => TRUE]);
}
......
......@@ -19,10 +19,10 @@ class TestController extends ControllerBase {
public function metadata($project_name = 'drupal', $version = NULL): Response {
$xml_map = $this->config('update_test.settings')->get('xml_map');
if (isset($xml_map[$project_name])) {
$availability_scenario = $xml_map[$project_name];
$file = $xml_map[$project_name];
}
elseif (isset($xml_map['#all'])) {
$availability_scenario = $xml_map['#all'];
$file = $xml_map['#all'];
}
else {
// The test didn't specify (for example, the webroot has other modules and
......@@ -30,10 +30,9 @@ class TestController extends ControllerBase {
// running the test. So, we default to a file we know won't exist, so at
// least we'll get an empty xml response instead of a bunch of Drupal page
// output.
$availability_scenario = '#broken#';
$file = '#broken#';
}
$file = __DIR__ . "/../../../fixtures/release-history/$project_name.$availability_scenario.xml";
$headers = ['Content-Type' => 'text/xml; charset=utf-8'];
if (!is_file($file)) {
// Return an empty response.
......
......@@ -43,7 +43,7 @@ class CoreUpdateTest extends UpdateTestBase {
// referenced in our fake release metadata (see
// fixtures/release-history/drupal.0.0.xml).
$this->setUpstreamCoreVersion('9.8.1');
$this->setReleaseMetadata(['drupal' => '9.8.1-security']);
$this->setReleaseMetadata(['drupal' => __DIR__ . '/../../fixtures/release-history/drupal.9.8.1-security.xml']);
// Ensure that Drupal thinks we are running 9.8.0, then refresh information
// about available updates and ensure that an update to 9.8.1 is available.
......
......@@ -135,10 +135,10 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase {
->set('fetch.url', $this->baseUrl . '/test-release-history')
->save();
[$project, $fixture] = explode('.', basename($file, '.xml'), 2);
[$project] = explode('.', basename($file, '.xml'), 2);
$this->config('update_test.settings')
->set('xml_map', [
$project => $fixture,
$project => $file,
])
->save();
}
......
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