We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems that @backupGlobals cannot be enabled for methods if it is disabled for the class. Consider the following test class.
@backupGlobals
/** * @backupGlobals disabled */ class Test extends \PHPUnit\Framework\TestCase { /** * @backupGlobals enabled */ public function test1() { $GLOBALS['foo'] = 'bar'; self::assertTrue(true); } public function test2() { self::assertFalse(isset($GLOBALS['foo'])); } }
Expected result: Both tests pass. Actual result:
Test::test2() Failed asserting that true is false.
If @backupGlobals is not disabled for the class by using the annotation, but just because it is disabled by default, both tests pass.
The text was updated successfully, but these errors were encountered:
The same issue occurs when @backupGlobals is enabled for the class, but disabled for a method:
/** * @backupGlobals enabled */ class Test extends TestCase { /** * @backupGlobals disabled */ public function test1() { $GLOBALS['foo'] = 'bar'; self::assertTrue(true); } public function test2() { self::assertTrue(isset($GLOBALS['foo'])); } }
Test::test2() Failed asserting that false is true.
Sorry, something went wrong.
526470b
Successfully merging a pull request may close this issue.
It seems that
@backupGlobals
cannot be enabled for methods if it is disabled for the class. Consider the following test class.Expected result: Both tests pass.
Actual result:
If
@backupGlobals
is not disabled for the class by using the annotation, but just because it is disabled by default, both tests pass.The text was updated successfully, but these errors were encountered: