From 943adbda1253c4a1ea2e3b2c168de1a4848c634b Mon Sep 17 00:00:00 2001 From: Nigel James Date: Tue, 19 Mar 2024 12:24:29 +1100 Subject: [PATCH] renamed function conflicting with PHPUnit final function --- tests/SnapshotsTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/SnapshotsTest.php b/tests/SnapshotsTest.php index 559066f5..259022b9 100644 --- a/tests/SnapshotsTest.php +++ b/tests/SnapshotsTest.php @@ -46,7 +46,7 @@ public function snapshots(): array public function build(string $name) { // Delete the contents of the output directory in the source to clean up previous builds - $this->filesystem->deleteDirectory($this->output($name), true); + $this->filesystem->deleteDirectory($this->testOutput($name), true); $jigsaw = realpath(implode('/', array_filter([__DIR__, '..', 'jigsaw']))); $arguments = static::$arguments[$name] ?? []; @@ -63,19 +63,19 @@ public function build(string $name) private function assertSnapshotMatches($name) { - $this->assertDirectoryExists($this->output($name)); + $this->assertDirectoryExists($this->testOutput($name)); $this->assertSame( collect($this->filesystem->allFiles($this->snapshot($name), true)) ->map(fn ($file) => Str::after($file->getPathname(), $this->snapshot($name))) ->toArray(), - collect($this->filesystem->allFiles($this->output($name), true)) - ->map(fn ($file) => Str::after($file->getPathname(), $this->output($name))) + collect($this->filesystem->allFiles($this->testOutput($name), true)) + ->map(fn ($file) => Str::after($file->getPathname(), $this->testOutput($name))) ->toArray(), "Output file structure does not match snapshot in '{$name}'.", ); - collect($this->filesystem->allFiles($this->output($name), true))->map(function (SplFileInfo $file) use ($name) { + collect($this->filesystem->allFiles($this->testOutput($name), true))->map(function (SplFileInfo $file) use ($name) { $this->assertSame( file_get_contents(implode(DIRECTORY_SEPARATOR, array_filter([$this->snapshot($name), $file->getRelativePathname()]))), $file->getContents(), @@ -89,7 +89,7 @@ private function source(string $name = ''): string return implode(DIRECTORY_SEPARATOR, array_filter([__DIR__, 'snapshots', $name])); } - private function output(string $name): string + private function testOutput(string $name): string { $output = $name === 'environment-specific-config-file' ? 'build_staging' : 'build_local';