Skip to content
Snippets Groups Projects

Issue #3344127: Composer validate all fixture manipulation changes

Compare and
2 files
+ 27
13
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -6,6 +6,7 @@ use Composer\Semver\VersionParser;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Serialization\Yaml;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Process\Process;
/**
* It manipulates.
@@ -40,6 +41,28 @@ class FixtureManipulator {
*/
private string $dir;
/**
* Validate the fixtures still passes `composer validate`.
*/
private function validateComposer(): void {
$process = new Process([
'composer',
'validate',
// @todo Check the lock file in https://drupal.org/i/3343827.
'--no-check-lock',
// @todo Just adding this to check if this makes many more tests pass. If
// it does we might want to commit this issue with this flag that have
// some level of validation and create a follow-up to fix the rest.
'--no-check-all',
'--no-check-publish',
'--with-dependencies',
'--no-interaction',
'--ansi',
'--no-cache',
], $this->dir);
$process->mustRun();
}
/**
* Adds a package.
*
@@ -357,7 +380,7 @@ class FixtureManipulator {
* @param string $dir
* The directory to commit the changes to.
*/
protected function doCommitChanges(string $dir): void {
final protected function doCommitChanges(string $dir): void {
if ($this->committed) {
throw new \BadMethodCallException('Already committed.');
}
@@ -372,6 +395,7 @@ class FixtureManipulator {
}
$this->committed = TRUE;
$this->committingChanges = FALSE;
$this->validateComposer();
}
/**
Loading