Skip to content

Commit

Permalink
bug #14102 [Fixtures] Fix removing images before suite (GSadee)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.11|
| Bug fix?        | yes                                                       |
| New feature?    | no                                                      |
| BC breaks?      | no                                                      |
| Deprecations?   | no|
| Related tickets | fixes #14095                       |
| License         | MIT                                                          |

<!--
 - Bug fixes must be submitted against the 1.10 or 1.11 branch(the lowest possible)
 - Features and deprecations must be submitted against the master branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->


Commits
-------

40e3edb [Fixtures] Fix removing images before suite
  • Loading branch information
AdamKasp committed Jun 23, 2022
2 parents 472e03f + 40e3edb commit c994b72
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 c994b72

Please sign in to comment.