Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Better error messages in failing tests #32752

Copy link
Copy link
Closed
@javiereguiluz

Description

@javiereguiluz
Issue body actions

Description
Recently, when running some PHPUnit tests in a CI service, I saw these failing tests:

1) App\Tests\Controller\SomeControllerTest::testSomething with data set #0 ('...', '..', '...')
Failed asserting that the Response has header "Content-Type" with value "application/pdf".

I spent some time debugging the problem because I recently fixed this feature and I knew it worked on my local computer, on the server, etc. So, why was it failing only in the CI service? I had to SSH-login into it, debug things manually, etc. At the end, a simple dd($this->client->getResponse()) showed the real problem:

<title>An exception has been thrown during the rendering of a template
("file_get_contents(/home/circleci/project/public/build/some-file.css):
failed to open stream: No such file or directory"). (500 Internal Server Error)</title>

As you can see, the Symfony exception message is perfect and tells you the problem instantly .. while the PHPUnit error message only confuses you.

Possible solution

All these would have been solved if PHPUnit failing tests showed the real exception message from Symfony. Could we add that to the error messages shown by PHPUnit? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    BrowserKitDXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)ErrorHandlerFeature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.