Skip to content

Instantly share code, notes, and snippets.

@desrosj
Created January 9, 2018 19:40
Embed
What would you like to do?
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