Skip to content

Commit 26d93c3

Browse files
committed
Rename parameter to withoutCreatingSnapshots
1 parent 4213436 commit 26d93c3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/MatchesSnapshots.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ protected function shouldUpdateSnapshots(): bool
157157
* matched.
158158
*
159159
* Override this method if you want to use a different flag or mechanism
160-
* than `-d --no-create-snapshots`.
160+
* than `-d --without-creating-snapshots`.
161161
*/
162162
protected function shouldCreateSnapshots(): bool
163163
{
164-
return ! in_array('--no-create-snapshots', $_SERVER['argv'], true);
164+
return ! in_array('--without-creating-snapshots', $_SERVER['argv'], true);
165165
}
166166

167167
protected function doSnapshotAssertion($actual, Driver $driver)
@@ -314,7 +314,7 @@ protected function assertSnapshotShouldBeCreated(string $snapshotFileName): void
314314
$this->fail(
315315
"Snapshot \"$snapshotFileName\" does not exist.\n".
316316
'You can automatically create it by removing '.
317-
'`-d --no-create-snapshots` of PHPUnit\'s CLI arguments.'
317+
'`-d --without-creating-snapshots` of PHPUnit\'s CLI arguments.'
318318
);
319319
}
320320
}

tests/Integration/MatchesSnapshotTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ public function setUp(): void
1919
$this->setUpComparesSnapshotFiles();
2020

2121
$updateArgument = array_search('--update-snapshots', $_SERVER['argv']);
22-
$noCreateArgument = array_search('--no-create-snapshots', $_SERVER['argv']);
22+
$withoutCreatingArgument = array_search('--without-creating-snapshots', $_SERVER['argv']);
2323

2424
if ($updateArgument) {
2525
unset($_SERVER['argv'][$updateArgument]);
2626
}
2727

28-
if ($noCreateArgument) {
29-
unset($_SERVER['argv'][$noCreateArgument]);
28+
if ($withoutCreatingArgument) {
29+
unset($_SERVER['argv'][$withoutCreatingArgument]);
3030
}
3131
}
3232

@@ -468,14 +468,14 @@ private function getMatchesSnapshotMock(): MockObject
468468
/** @test */
469469
public function it_doesnt_create_a_regular_snapshot_and_mismatches_if_asked()
470470
{
471-
$_SERVER['argv'][] = '--no-create-snapshots';
471+
$_SERVER['argv'][] = '--without-creating-snapshots';
472472

473473
$mockTrait = $this->getMatchesSnapshotMock();
474474

475475
$this->expectFail(
476476
$mockTrait,
477477
"Snapshot \"MatchesSnapshotTest__it_doesnt_create_a_regular_snapshot_and_mismatches_if_asked__1.txt\" does not exist.\n".
478-
'You can automatically create it by removing `-d --no-create-snapshots` of PHPUnit\'s CLI arguments.'
478+
'You can automatically create it by removing `-d --without-creating-snapshots` of PHPUnit\'s CLI arguments.'
479479
);
480480

481481
$mockTrait->assertMatchesSnapshot('Bar');
@@ -484,14 +484,14 @@ public function it_doesnt_create_a_regular_snapshot_and_mismatches_if_asked()
484484
/** @test */
485485
public function it_doesnt_create_a_file_snapshot_and_mismatches_if_asked()
486486
{
487-
$_SERVER['argv'][] = '--no-create-snapshots';
487+
$_SERVER['argv'][] = '--without-creating-snapshots';
488488

489489
$mockTrait = $this->getMatchesSnapshotMock();
490490

491491
$this->expectFail(
492492
$mockTrait,
493493
"Snapshot \"MatchesSnapshotTest__it_doesnt_create_a_file_snapshot_and_mismatches_if_asked__1.jpg_failed.jpg\" does not exist.\n".
494-
'You can automatically create it by removing `-d --no-create-snapshots` of PHPUnit\'s CLI arguments.'
494+
'You can automatically create it by removing `-d --without-creating-snapshots` of PHPUnit\'s CLI arguments.'
495495
);
496496

497497
$mockTrait->assertMatchesFileSnapshot(__DIR__.'/stubs/test_files/friendly_man.jpg');

0 commit comments

Comments
 (0)