You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
myclabs/deep-copy 1.12.0 Create deep copies (clones) of your objects
nikic/php-parser 5.0.2 A PHP parser written in PHP
phar-io/manifest 2.0.4 Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version 3.2.1 Library for handling version information and constraints
phpunit/php-code-coverage 11.0.3 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator 5.0.0 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker 5.0.0 Invoke callables with a timeout
phpunit/php-text-template 4.0.0 Simple template engine.
phpunit/php-timer 7.0.0 Utility class for timing
phpunit/phpunit 11.2.1 The PHP Unit Testing framework.
sebastian/cli-parser 3.0.1 Library for parsing CLI options
sebastian/code-unit 3.0.0 Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup 4.0.0 Looks up which function or method a line of code belongs to
sebastian/comparator 6.0.0 Provides the functionality to compare PHP values for equality
sebastian/complexity 4.0.0 Library for calculating the complexity of PHP code units
sebastian/diff 6.0.1 Diff implementation
sebastian/environment 7.1.0 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 6.0.1 Provides the functionality to export PHP variables for visualization
sebastian/global-state 7.0.1 Snapshotting of global state
sebastian/lines-of-code 3.0.0 Library for counting the lines of code in PHP source code
sebastian/object-enumerator 6.0.0 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector 4.0.0 Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context 6.0.0 Provides functionality to recursively process PHP variables
sebastian/type 5.0.0 Collection of value objects that represent the types of the PHP type system
sebastian/version 5.0.0 Library that helps with managing the version number of Git-hosted PHP projects
theseer/tokenizer 1.2.3 A small library for converting tokenized PHP source code into XML and potentially other formats
Summary
The PHPUnit\Runner\ErrorHandler#trigger() method fails the assert(isset($trace[1]['file'])); call if a PHP deprecation is triggered inside a Closure.
Current behavior
The following code, if covered by a PHPUnit test, causes an internal PHPUnit assert to fail, when:
assuming that declare(strict_types=1); is not set
we pass [456, '123', null] as argument to the sort method
the default phpunit.xml generated by vendor/bin/phpunit -generate-configuration is used
composer info | sort
outputSummary
The
PHPUnit\Runner\ErrorHandler#trigger()
method fails theassert(isset($trace[1]['file']));
call if a PHP deprecation is triggered inside a Closure.Current behavior
The following code, if covered by a PHPUnit test, causes an internal PHPUnit
assert
to fail, when:declare(strict_types=1);
is not set[456, '123', null]
as argument to thesort
methodphpunit.xml
generated byvendor/bin/phpunit -generate-configuration
is used/vendor/bin/phpunit
outputvar_dump($trace);
outputHow to reproduce
Please see https://github.com/DominicLuidold/phpunit-deprecation-trigger-closure-reproducer for a minimal, self-contained, reproducing test case.
Expected behavior
The
PHPUnit\Runner\ErrorHandler#trigger()
method correctly handles PHP deprecations triggered within a Closure and reports them.The text was updated successfully, but these errors were encountered: