Skip to content

Instantly share code, notes, and snippets.

@desrosj
Created January 9, 2018 19:40
Show Gist options
  • Save desrosj/57e66b86c1c130cf53bd37e37b8e2c65 to your computer and use it in GitHub Desktop.
Save desrosj/57e66b86c1c130cf53bd37e37b8e2c65 to your computer and use it in GitHub Desktop.
Class structure for WordPress unit tests where constants need to be tested
class Tests_For_Stupid_Constants extends WP_UnitTestCase {
/**
* Do not preserve global state between test methods.
*
* @var bool
*/
protected $preserveGlobalState = false;
/**
* Run each test method in a separate, isolated process.
*
* This ensures constants are properly set and tested.
*
* @var bool
*/
protected $runTestInSeparateProcess = true;
function test_this_in_isolated_process() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment