Skip to content
Snippets Groups Projects

Issue #3344127: Composer validate all fixture manipulation changes

Compare and Show latest version
1 file
+ 5
5
Compare changes
  • Side-by-side
  • Inline
@@ -79,7 +79,11 @@ class FixtureManipulator {
*/
public function addPackage(array $package, bool $is_dev_requirement = FALSE, bool $create_project = TRUE): self {
if (!$this->committingChanges) {
$this->queueManipulation('addPackage', func_get_args());
// To pass Composer validation all packages must have a version specified.
if (!isset($package['version'])) {
$package['version'] = '1.2.3';
}
$this->queueManipulation('addPackage', [$package, $is_dev_requirement, $create_project]);
return $this;
}
foreach (['name', 'type'] as $required_key) {
@@ -182,10 +186,6 @@ class FixtureManipulator {
if ($should_exist && isset($is_dev_requirement)) {
throw new \LogicException('Changing an existing project to a dev requirement is not supported');
}
// To pass Composer validation all packages must have a version specified.
if (!$should_exist && $package && !isset($package['version'])) {
$package['version'] = '1.2.3';
}
$composer_folder = $this->dir . '/vendor/composer';
$file = $composer_folder . '/installed.json';
Loading