While developing a lib with PHPUnit at every step of the way, everything was fine. Then I pushed this lib online and deleted the folder.
A while later, I cloned a fresh instance of the repository to continue development, ran the exact same PHPUnit binary (globally installed via Composer) in the root folder of the cloned project (so, effectively, reproduced the original conditions), and noticed that even though PHPUnit read the configuration inside the folder (it said so), it ignored some values, namely, to use colors and the target only the tests folder. Instead, it did run all my tests and they were all successful, but it generated coverage for the folder the PHPUnit binary is in, and deeper.
I then tried the same, but with a freshly downloaded phpunit.phar. This one produced different, but also weird results - it also read the configuration properly, and used colors this time, but ignored tests once again. It also generated coverage for the folder it was in (the project's root folder) ignoring the tests location in the XML, and instead generating coverage for the tests and vendor folder as well.
Here is the phpunit.xml.dist used in both cases.
What could be the cause of this? Library in question is this, in case you want to run the tests.
Aucun commentaire:
Enregistrer un commentaire