-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(WPTestCase) update to support PHPUnit 10
- Loading branch information
Showing
10 changed files
with
511 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/_data/files/BackupControlTestCaseOverridingTestCasePHPUnit10.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use lucatume\WPBrowser\TestCase\WPTestCase; | ||
|
||
class BackupControlTestCaseOverridingStore | ||
{ | ||
public static $staticAttribute = 'initial_value'; | ||
} | ||
|
||
class BackupControlTestCaseOverridingTestCase extends WPTestCase | ||
{ | ||
protected $backupGlobals = false; | ||
protected $backupStaticProperties = false; | ||
|
||
/** | ||
* Override the method to avoid issues with Codeception specific meta data. | ||
*/ | ||
protected function _setUp() | ||
{ | ||
$this->_before(); | ||
} | ||
|
||
public function testBackupGlobalsIsFalse(): void | ||
{ | ||
$this->assertFalse($this->backupGlobals); | ||
} | ||
|
||
public function testWillAlterStoreStaticAttribute(): void | ||
{ | ||
BackupControlTestCaseOverridingStore::$staticAttribute = 'updated_value'; | ||
$this->assertTrue(true); // Useless assertion to avoid the test to be marked as risky. } | ||
} | ||
} |
Oops, something went wrong.