@backupGlobals
The backup and restore operations for global variables can be completely disabled for all tests of a test case class like this
1 2 3 4 5 6 7 8 9 | use PHPUnit\Framework\TestCase; /** * @backupGlobals disabled */ class MyTest extends TestCase { // ... } |
The @backupGlobals
annotation can also be used on the test method level. This allows for a fine-grained configuration of the backup and restore operations:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | use PHPUnit\Framework\TestCase; /** * @backupGlobals disabled */ class MyTest extends TestCase { /** * @backupGlobals enabled */ public function testThatInteractsWithGlobalVariables() { // ... } } |
Please login to continue.