Skip to content

1.1.0

Choose a tag to compare

@deminy deminy released this 27 Aug 05:34
· 8 commits to master since this release
3d03e54

A compatibility release: where a counit run used to diverge from a plain PHPUnit run, it now matches. Supported
versions are unchanged (~12.5.24 on PHP >= 8.3, ~13.0 on PHP >= 8.4.1) and no test needs changing. Feature-by-feature
detail lives in docs/compatibility.md.

Upgrade note. Checks that used to stay silent under Swoole now report, so a suite that passed under 1.0.x may
legitimately fail under 1.1.0 — a post-yield deprecation/warning/notice, a post-yield skip, and the "did not perform
any assertions" risky check are all counted now, --fail-on-* included. Each report matches what plain PHPUnit says
about the same test. --enforce-time-limit, the global-state backup settings and the --stop-on-* family serialize
the run in exchange for exact semantics.

Added

  • Verdicts reached after a test's first yield are PHPUnit's own again. Failures and errors, skips and
    incompletes, risky verdicts and converted diagnostics are replayed through PHPUnit's events once every coroutine
    has drained, so summaries, listings, exit codes and the JUnit report match a blocking run. A post-yield
    E_USER_ERROR, which used to kill the run with exit code 255, now errors its test. (6bf1ab5, 9cc1a3b, 88da440,
    7fad7af, c78b4ad)
  • Expectations and test doubles work when the interesting thing happens after a yield: expectException() and
    friends, expectOutputString()/expectOutputRegex(), and mock ->expects(...) verification — the last of which
    used to silently pass a violated never(). Such tests are joined at their first yield; everything else keeps
    running concurrently. (01f853c, 33c98b8, a1b0cb8)
  • The test lifecycle observes a finished body. tearDown()/#[After] hooks run after the body instead of at
    its first yield, assertPostConditions()/#[PostCondition] see a finished test, and tearDownCoroutine() /
    Counit::defer() offer body-ordered cleanup homes. (8caa214, 274dee1, 1db358c)
  • #[Depends] and its variants have exact semantics: dependents receive the producer's real return value and
    are skipped when it fails, even after a yield. (1a64cb1, 94cd806, f5cbf24)
  • Runner options behave as documented: --enforce-time-limit times the real test, the global-state backup
    attributes isolate what they should, the --stop-on-* family (plus --repeat/--retry) sequences verdicts
    correctly, and invocations that run no tests (--version, --help, --list-*, bad input) exit like plain
    PHPUnit instead of dying with 255. The first three serialize the run while active. (c0acef9, ba76648, 889d637,
    49f32b9)
  • Reporting is accurate: aggregate code coverage no longer loses post-yield lines, the result cache records
    real defects and durations, and the JUnit report carries corrected per-test counts, durations and verdicts.
    (75b7c8e, 9f22e8b, d8d7ab1)

Bug fixes

  • --log-junit combined with a post-yield skip killed the run (exit code 255, zero-byte report). (e459567)
  • Only one failing repetition was reported under --repeat; each occurrence now gets its own entry. (4f3a90f,
    4902866)
  • Assertions counted on the test object after its first yield were lost from the run's total. (eb4b3f5)

Changes

  • Renamed the two test-adaptation approaches: the "global" style is now the automatic approach and the "case
    by case" style the manual approach, with the test suites and sample directories renamed to match
    (--testsuite global--testsuite automatic, tests/unit/global/tests/unit/automatic/, and likewise for
    the manual one). No PHP API changed, so consumer projects need no edits. (9397f6d)
  • The compatibility documentation moved to docs/compatibility.md, leaving README.md a
    short section and a link. (ba9f057, 17c3a9a)
  • Modernized the codebase for the PHP 8.3 floor. (2d3a23b)

Full changelog: 1.0.2...1.1.0