This commit is contained in:
Fabio Ivona
2023-08-01 17:15:44 +02:00
parent 844d175981
commit fe3747f850
3 changed files with 8 additions and 8 deletions

View File

@ -110,8 +110,8 @@ final class SnapshotRepository
$description = TestSuite::getInstance()->getDescription(); $description = TestSuite::getInstance()->getDescription();
if($this->getCurrentSnapshotCounter() > 1){ if ($this->getCurrentSnapshotCounter() > 1) {
$description .= '__' . $this->getCurrentSnapshotCounter(); $description .= '__'.$this->getCurrentSnapshotCounter();
} }
return sprintf('%s/%s.snap', $this->testsPath.'/'.$this->snapshotsPath.$relativePath, $description); return sprintf('%s/%s.snap', $this->testsPath.'/'.$this->snapshotsPath.$relativePath, $description);
@ -131,7 +131,7 @@ final class SnapshotRepository
{ {
$key = $this->getCurrentSnapshotKey(); $key = $this->getCurrentSnapshotKey();
if(!isset(self::$expectationsCounter[$key])){ if (! isset(self::$expectationsCounter[$key])) {
self::$expectationsCounter[$key] = 0; self::$expectationsCounter[$key] = 0;
} }

View File

@ -100,7 +100,7 @@ final class TestSuite
return self::$instance; return self::$instance;
} }
if (!self::$instance instanceof self) { if (! self::$instance instanceof self) {
Panic::with(new InvalidPestCommand()); Panic::with(new InvalidPestCommand());
} }

View File

@ -122,13 +122,13 @@ test('not failures', function () {
})->throws(ExpectationFailedException::class); })->throws(ExpectationFailedException::class);
test('multiple snapshot expectations', function () { test('multiple snapshot expectations', function () {
expect("foo bar 1")->toMatchSnapshot(); expect('foo bar 1')->toMatchSnapshot();
expect("foo bar 2")->toMatchSnapshot(); expect('foo bar 2')->toMatchSnapshot();
}); });
test('multiple snapshot expectations with datasets', function () { test('multiple snapshot expectations with datasets', function () {
expect("foo bar 1")->toMatchSnapshot(); expect('foo bar 1')->toMatchSnapshot();
expect("foo bar 2")->toMatchSnapshot(); expect('foo bar 2')->toMatchSnapshot();
})->with([1, 'foo', 'bar', 'baz']); })->with([1, 'foo', 'bar', 'baz']);