Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Tester Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Adoption of a lightweight, PHP-native testing framework for Laravel/PHP projects to reduce reliance on external tools like PHPUnit, especially for teams prioritizing performance, simplicity, and developer experience.
  • Roadmap item: Shift from PHPUnit to a more modern, actively maintained alternative—leveraging nette/tester's PHP 8.6 support, parallel execution, and IDE-friendly features (e.g., PHPDoc types, console-lines mode).
  • Build vs. Buy: Buy for teams needing a zero-config, fast, and opinionated testing solution with built-in coverage reporting (CloverXML, HTML) and DOM querying (DomQuery). Avoid reinventing wheels for assertions, mocking, or parallel test execution.
  • Use Cases:
    • Laravel microservices: Lightweight, parallel test execution reduces CI/CD feedback loops.
    • Legacy PHP modernization: Drop PHPUnit for a framework with PHP 8.5+/8.6 support and fewer breaking changes.
    • Frontend-heavy apps: DomQuery simplifies HTML/CSS assertions (e.g., testing Blade templates or SPAs).
    • Performance-critical projects: nette/tester avoids PHPUnit’s overhead (e.g., no XML config, faster bootstrapping).
    • Fast failure triage: 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.

When to Consider This Package

  • Adopt if:

    • Your team prioritizes speed (parallel execution, minimal setup) over PHPUnit’s extensibility.
    • You need PHP 8.3+ support with active maintenance (latest release: v2.6.2, PHP 8.6 support).
    • Your tests involve DOM manipulation (e.g., Blade templates, HTML assertions) or data providers (INI/array/Traversable).
    • You want built-in coverage reporting (CloverXML, HTML) without third-party tools.
    • Your CI/CD pipeline struggles with flaky tests—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.
    • You need correct JUnit output for CI—v2.6.2 fixes failed tests to be reported in the failures attribute (not errors), aligning with standard JUnit consumers.
  • Look elsewhere if:

    • You rely on PHPUnit’s ecosystem (e.g., phpunit/dbunit, phpunit/selenium).
    • Your project needs advanced mocking (e.g., Mockery integration) or legacy PHP <7.2 support.
    • You require JUnit XML output for legacy tools (use phpunit or wrap nette/tester with a custom reporter).
    • Your team is deeply invested in PHPUnit’s annotations (@dataProvider, @throws)—nette/tester uses method-level annotations.
    • You need Windows-specific features beyond what nette/tester’s parallel execution offers (e.g., WSL2 workarounds).
  • Migration watchlist (v2.6.2 behavior changes):

    • JUnit output: failed tests now count in 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).

How to Pitch It (Stakeholders)

For Executives:

"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)."

For Engineering:

"nette/tester gives us:

  • Faster tests: Parallel execution (even on Windows) and zero-config setup.
  • Modern PHP support: PHP 8.6 out of the box, no legacy baggage.
  • Better DX:
    • 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).
    • Stack traces include call arguments (e.g., redirect('https://…', 302)), so the failing call is obvious.
    • DomQuery for painless HTML/CSS assertions (bye, SimpleHTMLDom).
    • IDE hints via PHPDoc types and Assert::* autocompletion.
  • Coverage built-in: No need for 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).
  • Correct JUnit for CI: failed tests now reported under failures rather than errors—matches standard JUnit consumers. Action item: if any CI step reads only errors, update it on upgrade.
  • Robustness fixes: --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.
  • Lightweight: ~50% smaller footprint than PHPUnit, no XML config.

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).

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo
stevenay/myanfont
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin