Skip to content
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

Infinite recursion when "--static-backup --strict-global-state" is used #4470

Closed
wants to merge 1 commit into from

Conversation

5lava
Copy link
Contributor

@5lava 5lava commented Sep 26, 2020

To reproduce:

mkdir -p foo &&
pushd foo &&
cat <<PHP > SomeTest.php
<?php
class SomeTest extends \PHPUnit\Framework\TestCase {
    public function test_foo(): void { }
    public function test_bar(): void { }
}
PHP
composer require phpunit/phpunit:9.3.11 &&
vendor/bin/phpunit --static-backup --strict-global-state SomeTest.php &&
popd

Result:

PHPUnit 9.3.11 by Sebastian Bergmann and contributors.

RPHP Fatal error:  Nesting level too deep - recursive dependency? in /tmp/foo/vendor/phpunit/phpunit/src/Framework/TestCase.php on line 2369

I git-bisected the origin all the way to 9a7a667.
Sorry, not providing tests for this fix.

@codecov
Copy link

codecov bot commented Sep 26, 2020

Codecov Report

Merging #4470 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #4470   +/-   ##
=========================================
  Coverage     85.23%   85.23%           
  Complexity     4593     4593           
=========================================
  Files           245      245           
  Lines         12591    12592    +1     
=========================================
+ Hits          10732    10733    +1     
  Misses         1859     1859           
Impacted Files Coverage Δ Complexity Δ
src/Framework/TestCase.php 89.54% <100.00%> (+0.01%) 326.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c42c419...43161e6. Read the comment docs.

@sebastianbergmann sebastianbergmann changed the title Fix fatal error "Nesting level too deep" when being strict about static attributes Infinite recursion when "--static-backup --strict-global-state" is used Sep 27, 2020
@sebastianbergmann sebastianbergmann added feature/test-runner CLI test runner type/bug Something is broken labels Sep 27, 2020
@sebastianbergmann
Copy link
Owner

Cherry-picked into 8.5 and merged from there, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-runner CLI test runner type/bug Something is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants