File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -67,11 +67,21 @@ assertThat($result === true);
6767assertThat(true, is(true));
6868```
6969
70- :warning : ** NOTE:** the global proxy-functions aren't autoloaded by default, so you will need to load them first:
71-
72- ``` php
73- \Hamcrest\Util::registerGlobalFunctions();
74- ```
70+ > [ !NOTE]
71+ > To prevent tests from being marked as Risky (the ` This test did not perform any assertions ` message)
72+ > add this code to your test case ` tearDown ` method:
73+ >
74+ > ``` php
75+ > $this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount());
76+ > \Hamcrest\MatcherAssert::resetCount();
77+ > ```
78+
79+ > [!WARNING]
80+ > the global proxy-functions aren't autoloaded by default, so you will need to load them first:
81+ >
82+ > ```php
83+ > \Hamcrest\Util::registerGlobalFunctions();
84+ > ```
7585
7686For brevity, all of the examples below use the proxy-functions.
7787
You can’t perform that action at this time.
0 commit comments