diff --git a/tests/Unit/SnapshotTest.php b/tests/Unit/SnapshotTest.php deleted file mode 100755 index efde332..0000000 --- a/tests/Unit/SnapshotTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ - private static $configs = [ - 'drupal', - 'drupal-commerce-kickstart', - 'drupal-localgov', - 'fractal', - ]; - - public function testCompareFiles(): void - { - foreach (self::$configs as $config) { - $baseDir = getcwd() . "/tests/snapshots/output/{$config}"; - $generatedDir = getcwd() . "/.ignored/snapshots/output/{$config}"; - - $this->runCliTool($config); - - $baseFiles = $this->getFiles($baseDir); - - foreach ($baseFiles as $file) { - $this->assertFileEquals( - expected: $baseDir . '/' . $file, - actual: $generatedDir . '/' . $file, - message: "Files do not match: {$file}", - ); - } - } - } - - private function runCliTool(string $config): void - { - $configFilePath = getcwd() . "/tests/snapshots/configs/{$config}.yaml"; - - $cliCommand = sprintf( - "%s app:generate --config-file %s --output-dir %s", - getcwd() . '/bin/build-configs', - $configFilePath, - getcwd() . "/.ignored/snapshots/output/{$config}", - ); - - exec($cliCommand); - } - - /** - * @return array - */ - private function getFiles(string $directory): array - { - $files = []; - - $finder = new Finder(); - $finder->in($directory)->files(); - - foreach ($finder as $file) { - $files[] = $file->getRelativePathname(); - } - - return $files; - } -}