Skip to content

Commit 887ebee

Browse files
committed
Add documentation
1 parent 8c6e03d commit 887ebee

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,29 @@ Drivers can be used by passing them as `assertMatchesSnapshot`'s second argument
274274
$this->assertMatchesSnapshot($something->toYaml(), new MyYamlDriver());
275275
```
276276

277+
### Usage in CI
278+
279+
When running your tests in Continuous Integration you would possibility want to disable the snapshots' creation.
280+
281+
By using the `--no-create-snapshots` parameter, Phpunit will fail if the snapshots don't exist.
282+
283+
```bash
284+
> ./vendor/bin/phpunit -d --no-create-snapshots
285+
286+
1) ExampleTest::test_it_matches_a_string
287+
Snapshot "ExampleTest__test_it_matches_a_string__1.txt" does not exist.
288+
You can automatically create it by removing `-d --no-create-snapshots` of PHPUnit's CLI arguments.
289+
290+
```
291+
292+
277293
## Changelog
278294
279295
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
280296
281297
## Testing
282298
283-
``` bash
299+
```bash
284300
composer test
285301
```
286302

0 commit comments

Comments
 (0)