Skip to content

Released version 2.6.2

Latest

Choose a tag to compare

@dg dg released this 13 Sep 00:22
· 8 commits to master since this release

A release about trust: a green result now means more. Assertions no longer skip checks silently, parallel runs clean up after themselves, reports stay valid whatever your tests print, and the code coverage report got a thorough round of fixes. And yes, PHP 8.6 is supported.

✨ New Features

  • TestCase::run() – no longer stops at the first failing method: every test method runs, results come first and the details of each failure follow (#469)
  • Stack traces show the actual call arguments, so you immediately see which call failed – redirect('https://…', 302) instead of a bare redirect()
  • PHP 8.6 support

🐛 Bug Fixes

  • Assert::exception() and Assert::error() – an empty or '0' message is now really checked instead of silently disabling the message check; pass null if you don't want to verify the message
  • @phpVersion – boundaries and the == and != operators now work as documented: @phpVersion 8.4.3 runs on PHP 8.4.3, == 8.4.1 runs only on 8.4.1 and != 8.4.1 everywhere else. Common forms like @phpVersion 8.1 or < 8.4 behave as before; == and != compare the full version, so == 8.4 matches no release
  • @multiple0 or a non-numeric value is reported as an error instead of quietly running the test twice
  • --stop-on-fail with parallel jobs no longer returns while other tests are still running; Ctrl+C terminates running test processes and every output handler is always finalized
  • Environment::lock() no longer eats into the test time limit while waiting for the lock on Windows
  • @httpCode reads the right status even when php-cgi prints a warning before the headers
  • Environment variables of the runner are restored after starting a test, and a Job works without a temp directory and keeps its stderr
  • Dumper no longer changes data reachable through references while dumping it; INF and NAN are dumped as valid PHP
  • HttpAssert – with follow: true the headers come from the final response only, so the Location of a redirect no longer leaks through; a header sent several times (e.g. Set-Cookie) is joined with a comma instead of keeping the last value; header existence checks count as assertions
  • Masks in Assert::match() – patterns with non-ASCII text match whole UTF-8 characters, %f% rejects invalid numbers like .1.2, and a failing regular expression no longer leaves pcre.backtrack_limit changed
  • FileMock – appending through several handles, modes like rb+ and touch() now behave like a real file
  • DomQuery[attr$="value"], attribute values containing quotes and selector lists like a, b on PHP < 8.4 work correctly
  • JUnit report stays well-formed XML even when test output contains control characters or invalid UTF-8, and failed tests are counted in the failures attribute instead of errors (tools reading only errors now see 0)
  • Helpers::purge() refuses a path that resolves to the root directory, e.g. through .. or a symbolic link
  • Code coverage – the HTML report escapes file names, can be rendered repeatedly in one process, handles files with only dead code and numbers the last line of files without a trailing newline; Clover metrics include functions, enums and code outside classes; TAP or JUnit output on stdout is no longer polluted by the coverage summary, and tester exits with code 1 when the requested report cannot be generated
  • Clearer error messages, e.g. "No assertions were executed in this test." instead of "This test forgets to execute an assertion.", and Assert::contains() keeps your custom description