@backupGlobals
The backup and restore operations for global variables can be completely disabled for all tests of a test case class like this
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:
use PHPUnit\Framework\TestCase; /** * @backupGlobals disabled */ class MyTest extends TestCase { /** * @backupGlobals enabled */ public function testThatInteractsWithGlobalVariables() { // ... } }
Please login to continue.