docs icon indicating copy to clipboard operation
docs copied to clipboard

improve fail() and fails() doc

Open dansysanalyst opened this issue 2 years ago • 0 comments

Hello everybody,

This PR proposes an improvement on fail() and fails() methods.

I have provided new examples for PASS and FAIL for fails(), replacing the \Exception with the fail() method, as the current example results in an Exception.

it('fails', function () {
    throw new Exception('Something happened.');
})->fails('Something went wrong.');

Exception

   FAIL  Tests\Feature\ExampleTest
  ⨯ it fails                                                                                                                                                                                     0.11s  
   FAILED  Tests\Feature\ExampleTest > it fails                                                                                                                                                         
  Failed asserting that exception of type "Exception" matches expected exception "PHPUnit\Framework\AssertionFailedError". Message was: "Something happened." at

Greetings and thanks

Dan

dansysanalyst avatar Jan 12 '24 21:01 dansysanalyst