File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 22
33namespace Spatie \Snapshots ;
44
5+ use PHPUnit \Framework \ExpectationFailedException ;
56use ReflectionClass ;
67use ReflectionObject ;
7- use Spatie \Snapshots \Drivers \XmlDriver ;
88use Spatie \Snapshots \Drivers \HtmlDriver ;
99use Spatie \Snapshots \Drivers \JsonDriver ;
10+ use Spatie \Snapshots \Drivers \ObjectDriver ;
1011use Spatie \Snapshots \Drivers \TextDriver ;
12+ use Spatie \Snapshots \Drivers \XmlDriver ;
1113use Spatie \Snapshots \Drivers \YamlDriver ;
12- use Spatie \Snapshots \Drivers \ObjectDriver ;
13- use PHPUnit \Framework \ExpectationFailedException ;
1414
1515trait MatchesSnapshots
1616{
@@ -161,7 +161,7 @@ protected function shouldUpdateSnapshots(): bool
161161 */
162162 protected function shouldCreateSnapshots (): bool
163163 {
164- return !in_array ('--no-create-snapshots ' , $ _SERVER ['argv ' ], true );
164+ return ! in_array ('--no-create-snapshots ' , $ _SERVER ['argv ' ], true );
165165 }
166166
167167 protected function doSnapshotAssertion ($ actual , Driver $ driver )
Original file line number Diff line number Diff line change @@ -245,11 +245,10 @@ public function it_needs_a_file_extension_to_do_a_file_snapshot_assertion()
245245
246246 $ this ->expectFail (
247247 $ mockTrait ,
248- 'Unable to make a file snapshot, file does not have a file extension ' .
248+ 'Unable to make a file snapshot, file does not have a file extension ' .
249249 "( $ filePath) "
250250 );
251251
252-
253252 $ this ->assertFileExists ($ filePath );
254253
255254 $ mockTrait ->assertMatchesFileSnapshot ($ filePath );
@@ -466,7 +465,6 @@ private function getMatchesSnapshotMock(): MockObject
466465 return $ matchesSnapshotMock ;
467466 }
468467
469-
470468 /** @test */
471469 public function it_doesnt_create_a_regular_snapshot_and_mismatches_if_asked ()
472470 {
@@ -476,7 +474,7 @@ public function it_doesnt_create_a_regular_snapshot_and_mismatches_if_asked()
476474
477475 $ this ->expectFail (
478476 $ mockTrait ,
479- "Snapshot \"MatchesSnapshotTest__it_doesnt_create_a_regular_snapshot_and_mismatches_if_asked__1.txt \" does not exist. \n" .
477+ "Snapshot \"MatchesSnapshotTest__it_doesnt_create_a_regular_snapshot_and_mismatches_if_asked__1.txt \" does not exist. \n" .
480478 'You can automatically create it by removing `-d --no-create-snapshots` of PHPUnit \'s CLI arguments. '
481479 );
482480
@@ -492,7 +490,7 @@ public function it_doesnt_create_a_file_snapshot_and_mismatches_if_asked()
492490
493491 $ this ->expectFail (
494492 $ mockTrait ,
495- "Snapshot \"MatchesSnapshotTest__it_doesnt_create_a_file_snapshot_and_mismatches_if_asked__1.jpg_failed.jpg \" does not exist. \n" .
493+ "Snapshot \"MatchesSnapshotTest__it_doesnt_create_a_file_snapshot_and_mismatches_if_asked__1.jpg_failed.jpg \" does not exist. \n" .
496494 'You can automatically create it by removing `-d --no-create-snapshots` of PHPUnit \'s CLI arguments. '
497495 );
498496
You can’t perform that action at this time.
0 commit comments