Skip to content

Commit 211e1d5

Browse files
Merge pull request #2 from bramdevries/master
Easier to use update API
2 parents 7957748 + 9181e4f commit 211e1d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MatchesSnapshots.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function assertMatchesSnapshot($actual, $type = 'var', $methodTrace = nul
1919
return $this->markTestIncomplete("Snapshot created for {$snapshot->id()}");
2020
}
2121

22-
if (getenv('update_snapshots') == 1) {
22+
if (in_array('--update', $_SERVER['argv'], true)) {
2323
return $this->updateSnapshot($type, $snapshot, $actual);
2424
}
2525

@@ -31,7 +31,7 @@ protected function updateSnapshot($type, Snapshot $snapshot, $actual)
3131
try {
3232
$this->doSnapShotAssertion($type, $snapshot, $actual);
3333
} catch (PHPUnit_Framework_ExpectationFailedException $exception) {
34-
$snapshot->update($actual);
34+
$snapshot->create($actual);
3535

3636
$this->markTestIncomplete("Snapshot updated for {$snapshot->id()}");
3737
}

0 commit comments

Comments
 (0)