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

Issue #3321904 by kunal.sachdev, tedbow, Wim Leers: Remove...

Issue #3321904 by kunal.sachdev, tedbow, Wim Leers: Remove automatic_updates_extensions/tests/fixtures/stage_composer in favor of using StageFixtureManipulator
parent 3670d81f
No related branches found
No related tags found
No related merge requests found
Showing
with 5 additions and 322 deletions
{
"extra": {
"_readme": [
"This fixture assumes that ../../two_projects is active directory for the test.",
"Simulates a stage directory in which aaa_update_test is updated."
]
}
}
{
"packages": [
{
"name": "drupal/core-recommended",
"version": "9.8.0",
"require": {
"drupal/core": "9.8.0"
}
},
{
"name": "drupal/my_module",
"version": "9.8.0"
}
],
"packages-dev": [
{
"name": "drupal/my_dev_module",
"version": "9.8.1"
}
]
}
{
"packages": [
{
"name": "drupal/core",
"version": "9.8.1",
"type": "drupal-core",
"extra": {
"drupal-scaffold": {
"file-mapping": {}
}
}
},
{
"name": "drupal/semver_test",
"version": "8.1.0",
"type": "drupal-module"
},
{
"name": "drupal/aaa_update_test",
"version": "2.1.0",
"type": "drupal-module"
},{
"name": "drupal/automatic_updates_extensions_test_theme",
"version": "2.0.0",
"type": "drupal-theme"
}
]
}
<?php
/**
* @file
*/
$projects_dir = __DIR__ . '/../../web/projects';
return [
'versions' => [
'drupal/automatic_updates_extensions_test_theme' => [
'type' => 'drupal-theme',
'install_path' => $projects_dir . '/automatic_updates_extensions_test_theme',
],
'drupal/semver_test' => [
'type' => 'drupal-module',
'install_path' => $projects_dir . '/semver_test',
],
'drupal/aaa_update_test' => [
'type' => 'drupal-module',
'install_path' => $projects_dir . '/aaa_update_test',
],
],
];
{
"extra": {
"_readme": [
"This fixture assumes that ../../two_projects is active directory for the test.",
"Simulates a stage directory in which automatic_updates_extensions_test_theme is updated."
]
}
}
{
"packages": [
{
"name": "drupal/core-recommended",
"version": "9.8.0",
"require": {
"drupal/core": "9.8.0"
}
},
{
"name": "drupal/my_module",
"version": "9.8.0"
}
],
"packages-dev": [
{
"name": "drupal/my_dev_module",
"version": "9.8.1"
}
]
}
{
"packages": [
{
"name": "drupal/core",
"version": "9.8.1",
"type": "drupal-core",
"extra": {
"drupal-scaffold": {
"file-mapping": {}
}
}
},
{
"name": "drupal/semver_test",
"version": "8.1.0",
"type": "drupal-module"
},
{
"name": "drupal/aaa_update_test",
"version": "2.0.0",
"type": "drupal-module"
},
{
"name": "drupal/automatic_updates_extensions_test_theme",
"version": "2.1.0",
"type": "drupal-theme"
}
]
}
<?php
/**
* @file
*/
$projects_dir = __DIR__ . '/../../web/projects';
return [
'versions' => [
'drupal/automatic_updates_extensions_test_theme' => [
'type' => 'drupal-theme',
'install_path' => $projects_dir . '/automatic_updates_extensions_test_theme',
],
'drupal/semver_test' => [
'type' => 'drupal-module',
'install_path' => $projects_dir . '/semver_test',
],
'drupal/aaa_update_test' => [
'type' => 'drupal-module',
'install_path' => $projects_dir . '/aaa_update_test',
],
],
];
{
"extra": {
"_readme": [
"This fixture assumes that ../../two_projects is active directory for the test.",
"Simulates a stage directory in which semver_test is updated."
]
}
}
{
"packages": [
{
"name": "drupal/core-recommended",
"version": "9.8.0",
"require": {
"drupal/core": "9.8.0"
}
},
{
"name": "drupal/my_module",
"version": "9.8.0"
}
],
"packages-dev": [
{
"name": "drupal/my_dev_module",
"version": "9.8.1"
}
]
}
{
"packages": [
{
"name": "drupal/core",
"version": "9.8.1",
"type": "drupal-core",
"extra": {
"drupal-scaffold": {
"file-mapping": {}
}
}
},
{
"name": "drupal/semver_test",
"version": "8.1.1",
"type": "drupal-module"
},
{
"name": "drupal/aaa_update_test",
"version": "2.0.0",
"type": "drupal-module"
},
{
"name": "drupal/automatic_updates_extensions_test_theme",
"version": "2.0.0",
"type": "drupal-theme"
}
]
}
<?php
/**
* @file
*/
$projects_dir = __DIR__ . '/../../web/projects';
return [
'versions' => [
'drupal/automatic_updates_extensions_test_theme' => [
'type' => 'drupal-theme',
'install_path' => $projects_dir . '/automatic_updates_extensions_test_theme',
],
'drupal/semver_test' => [
'type' => 'drupal-module',
'install_path' => $projects_dir . '/semver_test',
],
'drupal/aaa_update_test' => [
'type' => 'drupal-module',
'install_path' => $projects_dir . '/aaa_update_test',
],
],
];
{
"extra": {
"_readme": [
"This fixture assumes that ../../two_projects is active directory for the test.",
"Simulates a stage directory in which semver_test and aaa_update_test have been updated."
]
}
}
{
"packages": [
{
"name": "drupal/core-recommended",
"version": "9.8.0",
"require": {
"drupal/core": "9.8.0"
}
},
{
"name": "drupal/my_module",
"version": "9.8.0"
}
],
"packages-dev": [
{
"name": "drupal/my_dev_module",
"version": "9.8.1"
}
]
}
{
"packages": [
{
"name": "drupal/core",
"version": "9.8.1",
"type": "drupal-core",
"extra": {
"drupal-scaffold": {
"file-mapping": {}
}
}
},
{
"name": "drupal/semver_test",
"version": "8.1.1",
"type": "drupal-module"
},
{
"name": "drupal/aaa_update_test",
"version": "2.1.0",
"type": "drupal-module"
},
{
"name": "drupal/automatic_updates_extensions_test_theme",
"version": "2.0.0",
"type": "drupal-theme"
}
]
}
......@@ -6,12 +6,12 @@ namespace Drupal\Tests\automatic_updates_extensions\Functional;
use Drupal\automatic_updates_test\EventSubscriber\TestSubscriber1;
use Drupal\fixture_manipulator\ActiveFixtureManipulator;
use Drupal\fixture_manipulator\StageFixtureManipulator;
use Drupal\package_manager_test_validation\StagedDatabaseUpdateValidator;
use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\StatusCheckEvent;
use Drupal\package_manager\ValidationResult;
use Drupal\package_manager_bypass\Committer;
use Drupal\package_manager_bypass\Stager;
use Drupal\package_manager_test_validation\EventSubscriber\TestSubscriber;
use Drupal\Tests\automatic_updates\Functional\AutomaticUpdatesFunctionalTestBase;
use Drupal\Tests\automatic_updates\Traits\ValidationTestTrait;
......@@ -188,7 +188,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
// modules and themes. The two modules we're testing here (semver_test and
// aaa_update_test) are already installed by static::$modules.
$this->container->get('theme_installer')->install(['automatic_updates_extensions_test_theme']);
$this->useFixtureDirectoryAsStaged(__DIR__ . '/../../fixtures/stage_composer/' . $project_name);
$this->setReleaseMetadata(__DIR__ . '/../../../../package_manager/tests/fixtures/release-history/drupal.9.8.2.xml');
$path_to_fixtures_folder = $project_name === 'aaa_update_test' ? '/../../../../package_manager/tests' : '/../..';
$this->setReleaseMetadata(__DIR__ . $path_to_fixtures_folder . '/fixtures/release-history/' . $project_name . '.1.1.xml');
......@@ -271,7 +270,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
* @requires PHP >= 8.0
*/
public function testStatusCheckerRunAfterUpdate(bool $has_database_updates): void {
$this->useFixtureDirectoryAsStaged(__DIR__ . '/../../fixtures/stage_composer/semver_test');
$this->setReleaseMetadata(__DIR__ . '/../../fixtures/release-history/semver_test.1.1.xml');
$this->setProjectInstalledVersion(['semver_test' => '8.1.0']);
$this->checkForUpdates();
......@@ -400,7 +398,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$this->setReleaseMetadata(__DIR__ . '/../../../../package_manager/tests/fixtures/release-history/drupal.9.8.2.xml');
$this->setReleaseMetadata(__DIR__ . "/../../fixtures/release-history/semver_test.1.1.xml");
$this->setReleaseMetadata(__DIR__ . "/../../../../package_manager/tests/fixtures/release-history/aaa_update_test.1.1.xml");
Stager::setFixturePath(__DIR__ . '/../../fixtures/stage_composer/two_projects');
$this->setProjectInstalledVersion([
'semver_test' => '8.1.0',
'aaa_update_test' => '8.x-2.0',
......@@ -429,6 +426,10 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$page->checkField('projects[aaa_update_test]');
}
$page->checkField('projects[semver_test]');
$stage_manipulator = new StageFixtureManipulator();
$stage_manipulator->setVersion('drupal/aaa_update_test', '2.1.0')
->setVersion('drupal/semver_test', '8.1.1')
->setReadyToCommit();
$page->pressButton('Update');
$this->checkForMetaRefresh();
$this->assertUpdateStagedTimes(1);
......
......@@ -7,7 +7,6 @@ namespace Drupal\Tests\automatic_updates\Functional;
use Drupal\automatic_updates\CronUpdater;
use Drupal\Core\Site\Settings;
use Drupal\package_manager_bypass\Beginner;
use Drupal\package_manager_bypass\Stager;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\package_manager\Traits\AssertPreconditionsTrait;
use Drupal\Tests\package_manager\Traits\FixtureUtilityTrait;
......@@ -206,18 +205,4 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase {
->setPaths($active_dir, $active_dir . '/vendor', '', NULL);
}
/**
* Sets a fixture directory to use as the staged directory.
*
* @param string $fixture_directory
* The fixture directory.
*/
protected function useFixtureDirectoryAsStaged(string $fixture_directory): void {
// Create a temporary directory from our fixture directory that will be
// unique for each test run. This will enable changing files in the
// directory and not affect other tests.
$staged_dir = $this->copyFixtureToTempDirectory($fixture_directory);
Stager::setFixturePath($staged_dir);
}
}
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