testing

  • The editor changed, and so did every plugin

    5.0 shipped on 6 December and the meta box is no longer the answer. What still works, what needs a flag, and what has to be rewritten.

  • PHPUnit 7 changed the assertion you use most

    7.0 landed in February and deprecated a set of assertions that appear in almost every suite, with removals following in 8 — so the warnings are a deadline…

  • React 16 rewrote how a component fails

    An error in one component used to blank the page. 16 unmounts the whole tree deliberately — and gives you the mechanism to stop it.

  • A data provider turns twelve tests into one

    Twelve near-identical test methods differing only in their input is twelve places to update when the method signature changes, and a suite nobody reads. Naming the rows with…

  • Testing what the database actually does

    The repository test passed against a mock and failed against MySQL. A mock asserts what you believe the database does, which is the thing in question.

  • A test that asserts on a query count

    An N+1 does not fail a test — the page renders correctly, just slowly — so the regression ships and is found by a customer three releases later.…

  • Assembling an API skeleton from packages you did not write

    A micro-framework, and the six packages it takes to make it useful. What goes in the starter pack, what does not, and when micro stops paying off.

  • An integration test needs a real database or it proves nothing

    A repository test against a mocked connection asserts that the code calls the methods you expected, which is a restatement of the code rather than a check on…

  • Autowiring, and what the container is allowed to guess

    services.yaml went from four hundred lines to twelve. Where the guessing stops is the part worth knowing before it stops in production.

  • A coverage report that only measures changed lines

    Total coverage moves so slowly that it tells you nothing about the change in front of you, and the question a reviewer wants answered is whether the new…