D
D
DenchikDev2021-01-25 13:48:57
PHP
DenchikDev, 2021-01-25 13:48:57

How to exclude a file from coverage in PHPUnit by pattern?

Good afternoon!

There was a need to exclude from coverage (test coverage analysis) all files that contain the word "Factory".
I would like to specify an exception in phpunit.xml.dist . There is an option through the @codeCoverageIgnore annotation, but it does not quite fit, because it becomes more difficult to maintain such code.
Maybe someone faced such a task?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Shamanov, 2021-01-25
@SilenceOfWinter

see exclude block

D
DenchikDev, 2021-01-25
@DenchikDev

Thank you, but this option is not suitable, since my factories are NOT in one place, but next to handlers with different hierarchies. The option that you suggested is suitable for one specific file only.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question