Coverage records every line executed during a test, not every line the test was checking. A unit test for an invoice calculator that happens to construct three collaborators…
PHPUnit builds a fresh instance of the test class for every test method, so anything assigned in setUp() is rebuilt each time. That isolation is the point, and…
Chasing one failure through a suite that takes four minutes usually ends with the other tests commented out — and one of them staying commented out, which nobody…
assertEquals compares with ==, which is PHP’s loose comparison — so a method that has quietly started returning the string “0” where it used to return the integer…
Testing code that reads and writes files usually ends in a tests/tmp directory, a setUp that creates it, a tearDown that recursively deletes it, and a suite that…
Covering a rate table usually produces six test methods that differ in two literals each, so changing the assertion means changing it six times and one of them…