public function UpdaterTest::testCorrectVersionsStaged in Automatic Updates 8.2
Tests that correct versions are staged after calling ::begin().
File
- tests/
src/ Kernel/ UpdaterTest.php, line 27
Class
- UpdaterTest
- @coversDefaultClass \Drupal\automatic_updates\Updater
Namespace
Drupal\Tests\automatic_updates\KernelCode
public function testCorrectVersionsStaged() {
$this
->setReleaseMetadata(__DIR__ . '/../../fixtures/release-history/drupal.9.8.1-security.xml');
$this->container
->get('automatic_updates.updater')
->begin([
'drupal' => '9.8.1',
]);
// Rebuild the container to ensure the project versions are kept in state.
/** @var \Drupal\Core\DrupalKernel $kernel */
$kernel = $this->container
->get('kernel');
$kernel
->rebuildContainer();
$this->container = $kernel
->getContainer();
$stager = $this
->prophesize('\\PhpTuf\\ComposerStager\\Domain\\StagerInterface');
$command = [
'require',
'drupal/core:9.8.1',
// These two plugins are in the root composer.json that ships with a
// git clone of Drupal core, so they will be included when determining
// which core packages to update.
// @see \Drupal\automatic_updates\Updater::getCorePackageNames()
'drupal/core-project-message:9.8.1',
'drupal/core-vendor-hardening:9.8.1',
'--update-with-all-dependencies',
];
$stager
->stage($command, Argument::cetera())
->shouldBeCalled();
$this->container
->set('package_manager.stager', $stager
->reveal());
$this->container
->get('automatic_updates.updater')
->stage();
}