phplaravelunit-testingphpunitcode-coverage

Can you specify exactly which line of code a phpunit test should cover?


Considering that there are 2 cases which would have the same result, is there an annotation or anything I can add to make sure that my test covers a specific line in a function?

Code being tested showing 2 cases which would cause the test to pass

Given that code, I want to be sure that this test is hitting the second condition rather than the first.

PHPUnit test intended to cover the second box in the image above

Is this possible or should I just pull that case into a very specific function to make sure that is what is being covered?


Solution

  • Hey @ChrisHaas thanks for the recommendation, what I was able to do is pass it as an array from the second addTag call since the Zendesk function allows arrays or strings so I just changed the shouldReceive call to expect an array and I was able to target that specific call.