Skip to content

Commit

Permalink
[Fixtures] Fix removing images before suite
Browse files Browse the repository at this point in the history
  • Loading branch information
GSadee committed Jun 22, 2022
1 parent 2f8c6c9 commit 191a3fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function __construct(private Filesystem $filesystem, private string $imag

public function beforeSuite(SuiteEvent $suiteEvent, array $options): void
{
$this->filesystem->remove($this->imagesDirectoryPath . '/*');
$this->filesystem->remove($this->imagesDirectoryPath);
$this->filesystem->mkdir($this->imagesDirectoryPath);
$this->filesystem->touch($this->imagesDirectoryPath . '/.gitkeep');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public function let(Filesystem $filesystem): void

public function it_removes_images_before_fixture_suite(Filesystem $filesystem, SuiteInterface $suite): void
{
$filesystem->remove('/media/*')->shouldBeCalled();
$filesystem->remove('/media')->shouldBeCalled();
$filesystem->mkdir('/media')->shouldBeCalled();
$filesystem->touch('/media/.gitkeep')->shouldBeCalled();

$this->beforeSuite(new SuiteEvent($suite->getWrappedObject()), []);
Expand Down

0 comments on commit 191a3fc

Please sign in to comment.