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
v2.6.2

✨ New Features

  • TestCase::run() runs every test method even after one fails, so a single run shows you all failures at once: results first, details of each failure after them (#469)
  • Stack traces show call arguments, so you see right away which call failed: redirect('https://…', 302) instead of a bare redirect()
  • PHP 8.6 support

🐛 Bug Fixes

  • [@phpVersion](https://github.com/phpVersion) handles the boundary versions correctly: [@phpVersion](https://github.com/phpVersion) 8.4.3 runs on PHP 8.4.3 and < 8.0 no longer runs on 8.0; common forms like [@phpVersion](https://github.com/phpVersion) 8.1 behave as before
  • Assert::exception() and Assert::error() check the message also when it is '' or '0'; to skip the message check, pass null
  • JUnit report counts failed tests in the failures attribute instead of errors; update your CI if it reads only errors
  • With --stop-on-fail and parallel jobs, running tests are finished before the runner exits, and Ctrl+C terminates them
  • Environment::lock() on Windows leaves the test its full time limit after waiting for the lock
  • HttpAssert with follow: true takes headers from the final response only
  • Code coverage: fixes in the HTML report and Clover metrics, the summary line no longer mixes into TAP or JUnit output on stdout, and tester exits with code 1 when the requested report cannot be generated

🛡️ Robustness

  • Fixes in edge cases of Assert::match() masks (UTF-8, %f%), FileMock (append, rb+, touch()), DomQuery selectors on PHP < 8.4, Dumper with references and the JUnit report with invalid UTF-8 in the output
  • [@multiple](https://github.com/multiple) with an invalid value and Helpers::purge() on a path resolving to the root directory are reported as errors
v2.6.1
  • PhpInterpreter now passes the command to proc_open() as an array, so PHP handles argument escaping itself and the subshell is bypassed on Linux too – fewer surprises with paths and arguments containing spaces or special characters
  • Test::getResult() throws a LogicException instead of silently returning an unset value when the test hasn't finished running yet – mistakes surface immediately rather than turning into puzzling downstream errors
  • Improved PHPDoc types and descriptions throughout the framework for better IDE hints and static analysis
v2.6.0

This release brings true parallel test execution on Windows, smarter PHP configuration handling, and a bunch of quality-of-life improvements. The headline: Tester now respects your system php.ini by default, which is a breaking change but makes the "it works on my machine" debugging sessions a lot shorter.

Breaking Changes

  • Tester now uses system php.ini by default (#465)

Improvements

  • Parallel execution on Windows finally works properly – PHP 8.5's stream_select() fix means Windows users can now enjoy actual parallelism, not just the illusion of it.
  • Fixed output loss on fast-exiting processes – A race condition could swallow test output when processes finished too quickly. Your test results now survive speed.

New Features

  • test() and testException() lifecycle improvements – Both functions now properly call setUp() and tearDown(), and tearDown() runs even when tests fail. Your cleanup code will actually clean up.
  • Added global function testNoError()
v2.5.7

support for PHP 8.5

v2.5.6
  • support for PHP 8.5
  • added HttpAssert
  • added Assert::notMatch()
v2.5.5
  • Dumper::toPhp() prints enum case directly (#457)
  • DomQuery: uses PHP 8.4 HTML DOM
  • added DomQuery::closest()
  • DomQuery:: fixed UTF-8 handling
  • DomQuery:: supports :scope
  • optimized global function calls
v2.5.4
  • supports PHP 8.4
  • TestHandler: improve cache file uniqueness (#454)
  • DataProvider: parses INI files using INI_SCANNER_TYPED mode (BC break)
v2.5.3
  • Add testcase method's name to the test's title. (#451)
  • TestCase: removed NULL byte from class names, thx @smuuf #450 #449
  • added DomQuery::matches()
  • code coverage: fix compatibility with PHP 8.3 #446
  • test(): checks count of arguments
v2.5.2
  • Implemented console-lines mode which prints each test on separate line. (#443)
  • DomQuery: searches starting from current node
  • Environment::setupFunctions() creates global functions testException()
v2.5.1
  • support for PHP 8.3
  • fixed accessed property before initialization (#441) (#442)
  • used get_debug_type()
v2.5.0
  • requires PHP 8.0
  • added PHP 8 typehints
  • Capture stderr of test via temp file and output it in test results [Closes #420] (#438)
  • Environment::setupFunctions() creates global functions test(), setUp() & tearDown()
  • TestCase: lists the running methods
  • Assert::equal() added flags $matchOrder & $matchIdentity
  • constants are PascalCase
  • Dumper & Assert: dumps true/false/null in lowercase
v2.4.3
  • PHP 8.2 Support
  • CloverXMLGenerator: reports file name is case of parse error
  • Assert::exception() prints stack of unexpected exception
v2.4.2
  • interrupt signal is converted to InterruptException and handled by CliTester
  • Dumper::dumpException() added option to change output file name via AssertException::$outputName
  • Environment: improved color detection
  • Dumper: improved encoding of strings, added colors
  • improved coding style
v2.4.1
  • support for PHP 8.1
  • TestCase:prepareTestData(): check that every data provider item is array #431
  • added Assert::$expandPatterns to disable patterns expansion
  • TestHandler: mark tests with empty data provider as failed/skipped
  • template.phtml: uses native directory separator
v2.4.0
  • requires PHP 7.2
  • TestCase: added method skip() for skipping tests [Closes #379]
  • DataProvider::load() may return empty data set (BC break)
  • TestHandler: initiateTestCase() caching (#378)
  • TestCase: list all possible TestCase class dependencies (#378)
  • TestCase: list methods in format 'Method:testName' (#378)
  • CliTester: option --log replaced by -o log (#329)
  • CliTester: option -o is repeatable and accepts file name parameter (#329)
  • CommandLine: added NORMALIZER (#329)
  • Test: measure run time duration (#426)
  • Asssert: add hasKey and hasNotKey assertions (#427)
  • code coverage: improved coverage report template (#422)
v2.3.5
  • Environment::loadData(): --dataprovider arg is exact key, not query (BC break) [Closes #428]
  • CliTester: added missing newline (#429)
  • PhpInterpreter: enables register_argc_argv for info.php
  • Assert::contains() & notContains() check needle type
  • fix Assert::type() failure error when expected $type is object (#425)
  • CodeCoverage: support Xdebug 3 (#424)
v2.3.4
  • compatible with PHP 8.0
  • Dumper: keep full data provider name in output files
  • Show @dataProvider data set name in assertion error #293 #377
  • Runner: fixed waiting for last async Job #415
  • CloverXMLGenerator, DomQuery: checks for PHP extensions #401 #419
  • FileMutator: fixes 'touch() expects parameter 2 to be int, null given' #403
  • @dataProvider file may return integer-indexed data #418
  • Dumper: clickable links in PhpStorm terminal with plugin Awesome Console #313
  • Environment: improved color detection
  • Drop create-phar tool #276

For the details you can have a look at the diff.

v2.3.3
  • Dumper: keep full data provider name in output files
  • Show @dataProvider data set name in assertion error #293 #377
  • Drop create-phar tool #276
  • readme: added with() (#410)
  • Runner: fixed waiting for last async Job #415
  • CloverXMLGenerator, DomQuery: checks for PHP extensions #401 #419
  • FileMutator: fixes 'touch() expects parameter 2 to be int, null given' #403
  • @dataProvider file may return integer-indexed data #418
  • Dumper: clickable links in PhpStorm terminal with plugin Awesome Console #313
  • Environment: improved color detection, supports https://no-color.org/

For the details you can have a look at the diff.

v2.3.2
  • Runner: added support for CTRL-C
  • DomQuery: removed warning for invalid tags #354[Closes #416
  • Runner: pcntl_signal() can be disabled
  • Runner: ignores directory /vendor
  • fixes for PHP 7.4

For the details you can have a look at the diff.

v2.3.1
  • supports PHP 7.4
  • Environment: 'file' can be undefined when is test called via register_shutdown_function() (#411)

For the details you can have a look at the diff.

v2.3.0
  • watch mode: changed files are detected by filemtime
  • added Assert::notNull()
  • FileMutator fixes
  • test result is printed when run as a standalone script
v2.2.0
  • --watch mode recovers from errors (e.g. missing file)
  • fixes in FileMutator (during scandir() or recursive mkdir())
  • Assert::noError() throws exception when called with more than one parameter
  • added Expect for complex assertions formulation (#398)
  • Helper::purge() protection to not purge root directory (#392)
  • added method Runner::addPhpIniOption() to be able set PHP INI option from --setup script
  • added PCOV support (#396) (thanks to @trejjam)

For more information see documentation and changelog.

v2.1.0

Minimal PHP version since this release is 7.1. That's actually the main reason for this release.

  • Internal code improvements

    • used PHP 7.1 features
    • added PHP 7.1 typehints
    • strict types usage
  • Bypass finals respects final as a literal

  • Added notification when empty code coverage report data

  • The --coverage-src option is repeatable (#388)

For more information see documentation and changelog.

v2.0.2
  • FileMutator: fixes
  • Assert::error() accepts array of E_XXXX without error message
  • DomQuery: added missing error suppression for (#385)

For more information see documentation and changelog.

v1.7.2
  • fixed PHP 7.2 compatibility

This release is the last in the 1.x series. It is compatible with PHP 5.4 - 7.2.

The following 2.0 series, even marked as compatibility breaking, has very good compatibility, but supports PHP from version 5.6.

For more information see documentation and changelog.

v2.0.1
  • fixed FileMutator

For more information see documentation and changelog.

v2.0.0
  • Compatibility
    • required PHP 5.6 and supports PHP up to 7.2
    • dropped support for HHVM
    • default interpreter is CLI, used to be CGI
  • Handle *Test.php as a test files too
  • Added -C option to use system-wide php.ini
  • Added --temp option
  • Last time failing tests run as first
  • Fixed FileMock in append mode
  • Added environmental variable Environment::THREAD
  • Added [@phpExtension](https://github.com/phpExtension) test file annotation
  • Added %w% and %% modifiers for Assert::match()
  • Assert::match() replaces modifiers by matching values in output
  • Assert::exception() prints stack trace when unexpected exception is thrown
  • TestCase::tearDown() called even after test method error
  • TestCase::run() does not accept arguments, use TestCase::runTest() instead
  • Added CodeCoverage\Collector::flush()
  • Code coverage HTML template facelift
  • (many other small fixes and improvements)

For more information see documentation and changelog.

v1.7.1
  • Tester itself is tested on AppVeyor (Windows CI)
  • Dumper
    • dumpException() stores strings when maxLength is exceeded
    • dumpException() improved searching for Assert method invocation
    • Dumper::color() uses simple color escape codes (AppVeyor compatibility)
  • Environment: removes output buffers on shutdown before error message is print
  • Assert::error() fixed that restore_error_handler() isn't working when called from the error handler which throws exception
  • FileMock: read/write modes behave more like ordinary filesystem

For more information see documentation and changelog.

v1.7.0
  • HtmlGenerator: not evaluated sources are counted as not covered #248
  • TestCase
    • data provider can return Traversable #272
    • error handler is registered only once #268
    • data provider file may start by dot
  • Dumper
    • print object hash #277
    • fixed dumping INF in PHP 7.0.2
    • toLine() improved empty array dump
    • dumpException() prints source line where Assert is called
  • Added support for PHPDBG SAPI #258
  • CodeCoverage: added support for PHPDBG collector as Xdebug alternative
  • DataProvider: added support for .php provider #280
  • Environment: variable term=xterm-256color enables colors
  • FileMock: added unlink()

For more information see documentation and changelog.

v1.6.1

This release fixes issue of TestCase::tearDown() double calling:

  • TestCase: ignore muted errors in testMethod() #266

For more information see documentation and changelog.

v1.6.0
  • Assert: added noError() assertion #250
  • Assert: added custom fail descriptions
  • TestCase: annotation [@throws](https://github.com/throws) is applied to testMethods() only, not to setUp() nor tearDown() (BC break) #238
  • TestCase: is not masking setUp() and tearDown() exceptions
  • TestCase: tearDown() is called even on error in test method #254 #255
  • CliTester: explicit html_errors=off for TAP & Junit outputs #256
  • Dumper::toPhp() better support for anonymous classes and Closures

For more information see documentation and changelog.

v1.5.0
  • support for PHP7 Throwable
  • added Job::getErrorOutput() & PhpInterpreter::getErrorOutput() for PHP startup errors [Closes #229][Closes #230]
  • CloverXMLGenerator: fixed report statements from not loaded files [Closes #220]
  • DomQuery: fixed css2xpath for brackets in selector [Closes #235]

For more information see documentation and changelog.

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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings