Answer the question
In order to leave comments, you need to log in
When running a single test in PHPUnit, is only its dataProvider initialized or is it all?
Actually, as the number of tests and the number of data providers increase, the test launch time increases significantly.
When running a single test
phpunit --filter someTest tests/ExampleTest.php
is the dataProvider initialized for just someTest or all dataProviders in the ExampleTest.php file?
Answer the question
In order to leave comments, you need to log in
theoretically, they shouldn’t, since providers are mapped to the test with annotations and inside phpUnit something like this happens:
1) the test class is loaded
2) it reverses, all test methods are found,
but then two scenarios are possible:
a)
3) the test cycle begins,
4) when running each test, first its annotations are reversed and data providers are called
5) the test itself is launched and the results of the providers' work are transferred to it
b)
3) all annotations of all tests are reversed
4) all data providers are executed
5) tests are launched.
Actually, sorry for the arrogance, but it's easier to check experimentally. or read the code of the framework. tell us at the same time. =)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question