testing

  • Test doubles for an interface you do not own

    Mocking a third-party class binds the test to that class’s current signature, so an upgrade changing a method leaves the test passing against a shape that no longer…

  • A contract test for the API you depend on

    Mocking an upstream service makes the suite fast and guarantees nothing about the upstream still behaving that way. A contract test is a small suite that runs against…

  • WooCommerce 3.0 turned products into objects

    Every plugin reading _price from post meta is now reading a private field. The mechanical half, the half that is not, and the compatibility layer for code you…

  • CSS Grid arrived, and the layout hacks can go

    Chrome 57 and Firefox 52 shipped it a fortnight apart in March. Replacing a grid system of nested rows, negative margins and a clearfix with fourteen lines.

  • Static analysis on a codebase that has never had any

    Four thousand errors on the first run is a number nobody can act on. Starting at level 0, ignoring by pattern, and raising the floor one level at…

  • The asset pipeline Laravel 5.4 shipped

    Elixir wrapped gulp, which wrapped everything else. Mix wraps webpack directly — and leaves the configuration reachable when the abstraction runs out.

  • The REST API in core, and the plugin it replaces

    4.7 shipped the content endpoints. What moving off the feature plugin involves, why authentication is still the unsolved half, and the read API every site now exposes.

  • phpunit.xml groups let CI split the suite

    A suite that takes twenty minutes gets run less often, which is the opposite of what it is for. Groups let the fast tests gate every push and…

  • Queues, workers and the jobs that fail twice

    The email that arrived four times and the charge that arrived twice. What makes a job safe to run again, and keeping workers alive without them serving stale…

  • Argument order decides how readable the failure is

    PHPUnit takes the expected value first and the actual second, and getting them the wrong way round produces a test that passes and fails identically — but reports…