Petr Bugyík Petr Bugyík - 1 year ago 160
PHP Question

Silex - Code coverage from functional test

I would like to generate code coverage from functional testing in Silex App via PHPUnit. I created sandbox where you could reproduce.

The question is: Why

method is marked as
Not Executed
code in code coverage report?

code coverage

Thank you!

Answer Source

No time for testing. What i have seen:

You are setting your test array for the first test in app.php

return new \Symfony\Component\HttpFoundation\JsonResponse(['foo' => 'bar']);

Why? And did the test fail if you remove that? Maybe here the Controller isn't tested.

Then you are testing the 2 methods not in the same way.

Maybe that leads to the solution of the problem.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download