Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve fail() and fails() doc #253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

dansysanalyst
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant