Skip to content

Commit b6dbfe0

Browse files
committed
Improve docs to avoid Risky test warnings
1 parent 8cf45b1 commit b6dbfe0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ assertThat($result === true);
6767
assertThat(true, is(true));
6868
```
6969

70+
:warning: To prevent tests from being marked as Risky (the `This test did not perform any assertions` message)
71+
add this code to your test case `tearDown` method:
72+
73+
```php
74+
$this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount());
75+
\Hamcrest\MatcherAssert::resetCount();
76+
```
77+
7078
:warning: **NOTE:** the global proxy-functions aren't autoloaded by default, so you will need to load them first:
7179

7280
```php

0 commit comments

Comments
 (0)