-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behaviour when $GLOBALS is deleted #4033
Comments
I will stitch this one up, I have unfinished business with global vars |
Same, I could not remove globals |
I had to add hacks to keep some globals listed here: And to keep some @sebastianbergmann what do you this about this issue ? |
I think that deleting |
Could you explain why ? For me keeping |
I totally agree with you. PHPUnit can make a backup of This backup/restore functionality is expensive and is not required for clean code that does not modify By the way: the |
Thank you for the feedback, I appreciate it !
I think the code I did in the setup/teardown will be good for us as we continue to remove By the way could you push a patch for a missing |
This is exactly what it is intended for. Do not always use this.
This is taken care of in PHPUnit 9.2. I will not backport this to PHPUnit 8.5. |
doctrine/instantiator 1.3.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
myclabs/deep-copy 1.9.5 Create deep copies (clones) of your objects
phar-io/manifest 1.0.3 Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version 2.0.1 Library for handling version information and constraints
phpdocumentor/reflection-common 2.0.0 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 4.3.4 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is ...
phpdocumentor/type-resolver 1.0.1 A PSR-5 based resolver of Class names, Types and Structural Element Names
phpspec/prophecy v1.10.2 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 7.0.10 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator 2.0.2 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 2.1.2 Utility class for timing
phpunit/php-token-stream 3.1.1 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 8.5.2 The PHP Unit Testing framework.
sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code belongs to
sebastian/comparator 3.0.2 Provides the functionality to compare PHP values for equality
sebastian/diff 3.0.2 Diff implementation
sebastian/environment 4.2.3 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 3.1.2 Provides the functionality to export PHP variables for visualization
sebastian/global-state 3.0.0 Snapshotting of global state
sebastian/object-enumerator 3.0.3 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector 1.1.1 Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context 3.0.0 Provides functionality to recursively process PHP variables
sebastian/resource-operations 2.0.1 Provides a list of PHP built-in functions that operate on resources
sebastian/type 1.1.3 Collection of value objects that represent the types of the PHP type system
sebastian/version 2.0.1 Library that helps with managing the version number of Git-hosted PHP projects
symfony/polyfill-ctype v1.13.1 Symfony polyfill for ctype functions
theseer/tokenizer 1.1.3 A small library for converting tokenized PHP source code into XML and potentially other formats
webmozart/assert 1.6.0 Assertions to validate method input/output with nice error messages.
Summary
If the $GLOBALS array is cleared and an error occured in the test a warning is triggered inside
of phpunit and the causing error is never shown.
How to reproduce
result:
Expected behavior
I would expect the following output.
The text was updated successfully, but these errors were encountered: