Loading .gitlab-ci/pipeline.yml +1 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,7 @@ variables: '⚙️️ PHPUnit Kernel': <<: [ *with-composer, *run-tests, *default-job-settings ] parallel: 4 parallel: 5 variables: TESTSUITE: PHPUnit-Kernel KUBERNETES_CPU_REQUEST: "8" Loading core/modules/package_manager/tests/modules/fixture_manipulator/src/ActiveFixtureManipulator.php +2 −1 Original line number Diff line number Diff line Loading @@ -14,12 +14,13 @@ final class ActiveFixtureManipulator extends FixtureManipulator { /** * {@inheritdoc} */ public function commitChanges(?string $dir = NULL): void { public function commitChanges(?string $dir = NULL, bool $validate_composer = FALSE): self { if ($dir) { throw new \UnexpectedValueException("$dir cannot be specific for a ActiveFixtureManipulator instance"); } $dir = \Drupal::service(PathLocator::class)->getProjectRoot(); parent::doCommitChanges($dir); return $this; } } core/modules/package_manager/tests/modules/fixture_manipulator/src/FixtureManipulator.php +25 −7 Original line number Diff line number Diff line Loading @@ -303,8 +303,10 @@ public function setCorePackageVersion(string $version): self { * * @param array $additional_config * The configuration to add. * @param bool $update_lock * Whether to run composer update --lock. Defaults to FALSE. */ public function addConfig(array $additional_config): self { public function addConfig(array $additional_config, bool $update_lock = FALSE): self { if (empty($additional_config)) { throw new \InvalidArgumentException('No config to add.'); } Loading @@ -330,17 +332,23 @@ public function addConfig(array $additional_config): self { $command[] = $value; $this->runComposerCommand($command); } if ($update_lock) { $this->runComposerCommand(['update', '--lock']); } return $this; } /** * Commits the changes to the directory. * * @param string $dir * The directory to commit the changes to. */ public function commitChanges(string $dir): void { public function commitChanges(string $dir): self { $this->doCommitChanges($dir); $this->committed = TRUE; return $this; } /** Loading @@ -367,7 +375,11 @@ final protected function doCommitChanges(string $dir): void { } $this->committed = TRUE; $this->committingChanges = FALSE; $this->validateComposer(); } public function updateLock(): self { $this->runComposerCommand(['update', '--lock']); return $this; } /** Loading Loading @@ -623,8 +635,12 @@ private function addRepository(array $package): string { /** * Sets up the path repos at absolute paths. * * @param bool $composer_refresh * Whether to run composer update --lock && composer install. Defaults to * FALSE. */ public function setUpRepos(): void { public function setUpRepos($composer_refresh = FALSE): void { $fs = new SymfonyFileSystem(); $path_repo_base = \Drupal::state()->get(self::PATH_REPO_STATE_KEY); if (empty($path_repo_base)) { Loading @@ -638,8 +654,10 @@ public function setUpRepos(): void { // repos at the absolute path. $composer_json = file_get_contents($this->dir . '/packages.json'); assert(file_put_contents($this->dir . '/packages.json', str_replace('../path_repos/', "$path_repo_base/", $composer_json)) !== FALSE); if ($composer_refresh) { $this->runComposerCommand(['update', '--lock']); $this->runComposerCommand(['install']); } } } core/modules/package_manager/tests/modules/fixture_manipulator/src/StageFixtureManipulator.php +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public function begin(PathInterface $activeDir, PathInterface $stagingDir, ?Path /** * {@inheritdoc} */ public function commitChanges(string $dir): void { public function commitChanges(string $dir, bool $validate_composer = FALSE): self { throw new \BadMethodCallException('::commitChanges() should not be called directly in StageFixtureManipulator().'); } Loading core/modules/package_manager/tests/src/Kernel/AllowedScaffoldPackagesValidatorTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ public function testPreCreate(): void { "drupal/dummy_scaffolding", "drupal/dummy_scaffolding_2", ], ])->commitChanges(); ])->commitChanges()->updateLock(); $result = ValidationResult::createError( [ Loading @@ -47,7 +47,7 @@ public function testPreApply(): void { 'extra.drupal-scaffold.allowed-packages' => [ "drupal/dummy_scaffolding", ], ]); ], TRUE); $result = ValidationResult::createError( [ Loading Loading
.gitlab-ci/pipeline.yml +1 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,7 @@ variables: '⚙️️ PHPUnit Kernel': <<: [ *with-composer, *run-tests, *default-job-settings ] parallel: 4 parallel: 5 variables: TESTSUITE: PHPUnit-Kernel KUBERNETES_CPU_REQUEST: "8" Loading
core/modules/package_manager/tests/modules/fixture_manipulator/src/ActiveFixtureManipulator.php +2 −1 Original line number Diff line number Diff line Loading @@ -14,12 +14,13 @@ final class ActiveFixtureManipulator extends FixtureManipulator { /** * {@inheritdoc} */ public function commitChanges(?string $dir = NULL): void { public function commitChanges(?string $dir = NULL, bool $validate_composer = FALSE): self { if ($dir) { throw new \UnexpectedValueException("$dir cannot be specific for a ActiveFixtureManipulator instance"); } $dir = \Drupal::service(PathLocator::class)->getProjectRoot(); parent::doCommitChanges($dir); return $this; } }
core/modules/package_manager/tests/modules/fixture_manipulator/src/FixtureManipulator.php +25 −7 Original line number Diff line number Diff line Loading @@ -303,8 +303,10 @@ public function setCorePackageVersion(string $version): self { * * @param array $additional_config * The configuration to add. * @param bool $update_lock * Whether to run composer update --lock. Defaults to FALSE. */ public function addConfig(array $additional_config): self { public function addConfig(array $additional_config, bool $update_lock = FALSE): self { if (empty($additional_config)) { throw new \InvalidArgumentException('No config to add.'); } Loading @@ -330,17 +332,23 @@ public function addConfig(array $additional_config): self { $command[] = $value; $this->runComposerCommand($command); } if ($update_lock) { $this->runComposerCommand(['update', '--lock']); } return $this; } /** * Commits the changes to the directory. * * @param string $dir * The directory to commit the changes to. */ public function commitChanges(string $dir): void { public function commitChanges(string $dir): self { $this->doCommitChanges($dir); $this->committed = TRUE; return $this; } /** Loading @@ -367,7 +375,11 @@ final protected function doCommitChanges(string $dir): void { } $this->committed = TRUE; $this->committingChanges = FALSE; $this->validateComposer(); } public function updateLock(): self { $this->runComposerCommand(['update', '--lock']); return $this; } /** Loading Loading @@ -623,8 +635,12 @@ private function addRepository(array $package): string { /** * Sets up the path repos at absolute paths. * * @param bool $composer_refresh * Whether to run composer update --lock && composer install. Defaults to * FALSE. */ public function setUpRepos(): void { public function setUpRepos($composer_refresh = FALSE): void { $fs = new SymfonyFileSystem(); $path_repo_base = \Drupal::state()->get(self::PATH_REPO_STATE_KEY); if (empty($path_repo_base)) { Loading @@ -638,8 +654,10 @@ public function setUpRepos(): void { // repos at the absolute path. $composer_json = file_get_contents($this->dir . '/packages.json'); assert(file_put_contents($this->dir . '/packages.json', str_replace('../path_repos/', "$path_repo_base/", $composer_json)) !== FALSE); if ($composer_refresh) { $this->runComposerCommand(['update', '--lock']); $this->runComposerCommand(['install']); } } }
core/modules/package_manager/tests/modules/fixture_manipulator/src/StageFixtureManipulator.php +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public function begin(PathInterface $activeDir, PathInterface $stagingDir, ?Path /** * {@inheritdoc} */ public function commitChanges(string $dir): void { public function commitChanges(string $dir, bool $validate_composer = FALSE): self { throw new \BadMethodCallException('::commitChanges() should not be called directly in StageFixtureManipulator().'); } Loading
core/modules/package_manager/tests/src/Kernel/AllowedScaffoldPackagesValidatorTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ public function testPreCreate(): void { "drupal/dummy_scaffolding", "drupal/dummy_scaffolding_2", ], ])->commitChanges(); ])->commitChanges()->updateLock(); $result = ValidationResult::createError( [ Loading @@ -47,7 +47,7 @@ public function testPreApply(): void { 'extra.drupal-scaffold.allowed-packages' => [ "drupal/dummy_scaffolding", ], ]); ], TRUE); $result = ValidationResult::createError( [ Loading