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

handle more fatal errors #1510

Closed
wants to merge 2 commits into from

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Nov 19, 2018

For example, we have the following code:

$class = new class implements \stdClass {};

For example, in Home::index() function.

Previously, it will get the following output:

before

I updated so it will got the following output:

after

Checklist:

  • Securely signed commits

@jim-parry
Copy link
Contributor

It looks like you are trapping too much output. Did you notice that the code coverage dropped 60%?
I would rather live with a bit of messy debugging output!

@samsonasik
Copy link
Member Author

dropping 60% coverage is weird as ob_start() should always pass.

I previously uses ob_start() to get buffer error ( https://github.com/samsonasik/ErrorHeroModule/blob/master/src/HeroTrait.php#L25-L41 ) with more conditions and it can be covering by only 3 test examples https://github.com/samsonasik/ErrorHeroModule/blob/master/spec/Middleware/ExpressiveSpec.php#L530-L565 , but with different test framework ( kahlan )

@jim-parry
Copy link
Contributor

Check the travis-ci details...
There were 2315 risky tests:

  1. CodeIgniter\API\ResponseTraitTest::testNoFormatterJSON
    Test code or tested code did not (only) close its own output buffers

Your ob_start is hijacking the output buffer from phpunit, it looks like, and most of the tests are not running properly.

@samsonasik
Copy link
Member Author

ok, it seems the coverage still hit even use of @codeCoverageIgnoreStart/End, I'm closing for now.

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.

None yet

2 participants