nette/tester
Nette Tester is a lightweight, enjoyable PHP testing framework with expressive assertions, mocks, code coverage, and parallel test execution. It requires no annotations or complex setup, making it a fast, practical choice for testing PHP projects.
nette/tester's PHP 8.6 support, parallel execution, and IDE-friendly features (e.g., PHPDoc types, console-lines mode).DomQuery). Avoid reinventing wheels for assertions, mocking, or parallel test execution.DomQuery simplifies HTML/CSS assertions (e.g., testing Blade templates or SPAs).nette/tester avoids PHPUnit’s overhead (e.g., no XML config, faster bootstrapping).TestCase::run() (v2.6.2) now runs every test method even after a failure, surfacing all failures in a single run—reduces dev/CI round-trips.Adopt if:
console-lines mode, richer stack traces (now showing call arguments, e.g., redirect('https://…', 302)), and correct --stop-on-fail handling with parallel jobs improve debugging.failures attribute (not errors), aligning with standard JUnit consumers.Look elsewhere if:
phpunit/dbunit, phpunit/selenium).Mockery integration) or legacy PHP <7.2 support.phpunit or wrap nette/tester with a custom reporter).@dataProvider, @throws)—nette/tester uses method-level annotations.nette/tester’s parallel execution offers (e.g., WSL2 workarounds).Migration watchlist (v2.6.2 behavior changes):
failures instead of errors. If your CI gate reads only errors, update it before upgrading.Assert::exception() / Assert::error(): message checks now also run when the expected message is '' or '0'; pass null to skip the message check.@phpVersion boundaries: @phpVersion 8.4.3 and < 8.0 now behave precisely (common forms like @phpVersion 8.1 unchanged)."We’re replacing PHPUnit with nette/tester to cut CI/CD test times (parallel execution) and reduce maintenance overhead. It’s actively maintained, supports PHP 8.6, and includes built-in coverage reporting—eliminating dependencies on external tools like Xdebug. Latest release (v2.6.2) ships meaningful DX and reliability improvements: a single test run now surfaces all failures at once, stack traces show the exact call and arguments that broke, and JUnit reporting is now correct for CI dashboards. For frontend-heavy apps, it simplifies HTML assertions with DomQuery. Migration risk is low: it’s PHP-native, no vendor lock-in, and any behavior changes are documented (JUnit failures vs errors, Assert::exception() message handling)."
"nette/tester gives us:
console-lines mode for instant feedback.TestCase::run() runs every test even after a failure—one run shows all failures: results first, details after (v2.6.2).redirect('https://…', 302)), so the failing call is obvious.DomQuery for painless HTML/CSS assertions (bye, SimpleHTMLDom).Assert::* autocompletion.phpunit/phpunit + php-coveralls—just --coverage-src. v2.6.2 fixes HTML report and Clover metrics, keeps summaries out of TAP/JUnit stdout, and exits with code 1 when a requested report can’t be generated (fail-loud in CI).failures rather than errors—matches standard JUnit consumers. Action item: if any CI step reads only errors, update it on upgrade.--stop-on-fail with parallel jobs now cleanly finishes running tests and respects Ctrl+C; @phpVersion boundary handling corrected; Assert::exception()/error() message checks now apply to ''/'0' (pass null to skip); HttpAssert with follow: true uses final-response headers only.Tradeoff: Loses some PHPUnit plugins (e.g., Selenium), but gains speed and simplicity. Migration path: Start with critical test suites, then expand; audit CI for JUnit errors→failures and any Assert::exception() message assertions.*
Key Metric to Track: CI test suite execution time (target: <10% slower than PHPUnit after migration), and mean time to first failure diagnosis (expect improvement from all-failures-in-one-run and call-argument stack traces).
How can I help you explore Laravel packages today?