Skip to content

Commit

Permalink
feat(testing): Added $suffix for WithTempFile::getTempFile().
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed Oct 6, 2022
1 parent b35af60 commit 6faf1b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/testing/src/Utils/WithTempFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
use function sys_get_temp_dir;

trait WithTempFile {
protected function getTempFile(string $content = null): SplFileInfo {
protected function getTempFile(string $content = null, string $suffix = ''): SplFileInfo {
$fs = new Filesystem();
$pkg = Package::Name;
$path = $fs->tempnam(sys_get_temp_dir(), $pkg);
$path = $fs->tempnam(sys_get_temp_dir(), $pkg, $suffix);
$file = new SplFileInfo($path);

if ($content) {
Expand Down

0 comments on commit 6faf1b7

Please sign in to comment.