Skip to content
Snippets Groups Projects
Commit c23769f3 authored by Adam G-H's avatar Adam G-H
Browse files

Issue #3310997 by phenaproxima: Remove fake-site fixture from Automatic Updates

parent aae200e6
No related branches found
No related tags found
1 merge request!488Issue #3310997: Remove fake-site fixture from Automatic Updates
Showing
with 23 additions and 118 deletions
{}
{
"require": {
"drupal/core-recommended": "9.8.0"
},
"require-dev": {
"drupal/core-dev": "^9"
}
}
......@@ -11,6 +11,14 @@
}
}
}
},
{
"name": "drupal/core-recommended",
"version": "9.8.0"
},
{
"name": "drupal/core-dev",
"version": "9.8.0"
}
]
}
{
"require": {
"drupal/test-distribution": "*"
},
"require-dev": {
"drupal/core-dev": "^9"
},
"extra": {
"_comment": [
"This is a fake composer.json simulating a site which requires a distribution.",
"The required core packages are determined by scanning the lock file.",
"The required dev packages are determined by looking at the require-dev section of this file."
]
}
}
{
"packages": [
{
"name": "drupal/test-distribution",
"version": "1.0.0",
"require": {
"drupal/core-recommended": "*"
}
},
{
"name": "drupal/core-recommended",
"version": "9.8.0",
"require": {
"drupal/core": "9.8.0"
}
},
{
"name": "drupal/core",
"version": "9.8.0"
}
],
"packages-dev": [
{
"name": "drupal/core-dev",
"version": "9.8.0"
}
]
}
This private file should never be staged.
This public file should never be staged.
This file should be staged.
# A fake services file that should never be staged.
services: {}
<?php
/**
* @file
* A fake local settings file that should never be staged.
*/
<?php
/**
* @file
* A fake settings file that should never be staged.
*/
This file should be staged.
This file should not be staged.
{
"packages": [
{
"name": "drupal/test-distribution",
"version": "1.0.0",
"require": {
"drupal/core-recommended": "*"
}
},
{
"name": "drupal/core-recommended",
"version": "9.8.0",
"require": {
"drupal/core": "9.8.0"
}
},
{
"name": "drupal/core",
"version": "9.8.0",
"extra": {
"drupal-scaffold": {
"file-mapping": {}
}
}
},
{
"name": "drupal/core-dev",
"version": "9.8.0"
}
],
"dev": true,
"dev-package-names": [
"drupal/core-dev"
]
}
<?php
/**
* @file
* Simulates that no packages are installed.
*/
return [
'versions' => [],
];
......@@ -47,7 +47,7 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase {
protected function setUp(): void {
parent::setUp();
$this->disableValidators($this->disableValidators);
$this->useFixtureDirectoryAsActive(__DIR__ . '/../../fixtures/fake-site');
$this->useFixtureDirectoryAsActive(__DIR__ . '/../../../package_manager/tests/fixtures/fake_site');
}
/**
......
......@@ -197,10 +197,12 @@ class CronUpdaterTest extends AutomaticUpdatesKernelTestBase {
$will_update = (int) $will_update;
$this->assertCount($will_update, $this->container->get('package_manager.beginner')->getInvocationArguments());
// If updates happen, then there will be two calls to the stager: one to
// change the constraints in composer.json, and another to actually update
// the installed dependencies.
$this->assertCount($will_update * 2, $this->container->get('package_manager.stager')->getInvocationArguments());
// If updates happen, there will be at least two calls to the stager: one
// to change the runtime constraints in composer.json, and another to
// actually update the installed dependencies. If there are any core
// dev requirements (such as `drupal/core-dev`), the stager will also be
// called to update the dev constraints in composer.json.
$this->assertGreaterThanOrEqual($will_update * 2, $this->container->get('package_manager.stager')->getInvocationArguments());
$this->assertCount($will_update, $this->container->get('package_manager.committer')->getInvocationArguments());
}
......
......@@ -49,11 +49,6 @@ class UpdaterTest extends AutomaticUpdatesKernelTestBase {
$user = $this->createUser([], NULL, TRUE, ['uid' => 2]);
$this->setCurrentUser($user);
// Point to a fake site which requires Drupal core via a distribution. The
// lock file should be scanned to determine the core packages, which should
// result in drupal/core-recommended being updated.
$this->createVirtualProject(__DIR__ . '/../../fixtures/fake-site');
$id = $this->container->get('automatic_updates.updater')->begin([
'drupal' => '9.8.1',
]);
......
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