diff --git a/tests/KernelTest.php b/tests/KernelTest.php index 71f9085..f18518b 100644 --- a/tests/KernelTest.php +++ b/tests/KernelTest.php @@ -87,8 +87,9 @@ public function commandsOnObjects(): void } /** + * @param string $path * @param string $command - * @param int $depth + * @param int $depth * @param array{ * command: string, * depth: int, @@ -99,15 +100,15 @@ public function commandsOnObjects(): void */ #[Testing] #[DataProvider('executeProvider')] - public function execute(string $command, int $depth, array $return): void + public function execute(string $path, string $command, int $depth, array $return): void { - $this->createDirectory('./storage/files/'); + $this->createDirectory($path); - $this->createImage(); + $this->createImage(path: $path); $this->assertSame($return, $this->kernel->execute($command, $depth)); - $this->rmdirRecursively('./storage'); + $this->rmdirRecursively('./storage/'); } #[Testing] diff --git a/tests/Providers/KernelProviderTrait.php b/tests/Providers/KernelProviderTrait.php index cd1bda4..551bad6 100644 --- a/tests/Providers/KernelProviderTrait.php +++ b/tests/Providers/KernelProviderTrait.php @@ -18,19 +18,19 @@ public static function executeProvider(): array /** @phpstan-ignore-next-line */ return [ [ + 'path' => './storage/', 'command' => 'cd ./storage/ && ls', - 'depth' => 0, - 'return' => [ - 'files', + 'depth' => 0, + 'return' => [ 'image.png', ], ], [ - 'command' => 'ls', - 'depth' => 1, - 'return' => [ - /** @phpstan-ignore-next-line */ - FOLDER_PATH, + 'path' => './storage/files/', + 'command' => 'cd ./storage/files && ls', + 'depth' => 0, + 'return' => [ + 'image.png', ], ], ];