mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fixed RequirementsTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66265 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
adb03a1d88
commit
4f84e92dbf
@ -755,7 +755,7 @@ class Requirements_Backend {
|
||||
*
|
||||
*/
|
||||
function process_combined_files() {
|
||||
if(Director::isDev()) {
|
||||
if(Director::isDev() && !SapphireTest::is_running_test()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -22,19 +22,31 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
protected $originalMailer;
|
||||
protected $originalMemberPasswordValidator;
|
||||
protected $originalRequirements;
|
||||
protected $originalIsRunningTest;
|
||||
|
||||
protected $mailer;
|
||||
|
||||
protected static $is_running_test = false;
|
||||
|
||||
public static function is_running_test() {
|
||||
return self::$is_running_test;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var YamlFixture
|
||||
*/
|
||||
protected $fixture;
|
||||
|
||||
function setUp() {
|
||||
// Mark test as being run
|
||||
$this->originalIsRunningTest = self::$is_running_test;
|
||||
self::$is_running_test = true;
|
||||
|
||||
// Remove password validation
|
||||
$this->originalMemberPasswordValidator = Member::password_validator();
|
||||
$this->originalRequirements = Requirements::backend();
|
||||
Member::set_password_validator(null);
|
||||
Cookie::set_report_errors(false);
|
||||
|
||||
$className = get_class($this);
|
||||
$fixtureFile = eval("return {$className}::\$fixture_file;");
|
||||
@ -127,6 +139,10 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
// Restore requirements
|
||||
Requirements::set_backend($this->originalRequirements);
|
||||
|
||||
// Mark test as no longer being run - we use originalIsRunningTest to allow for nested SapphireTest calls
|
||||
self::$is_running_test = $this->originalIsRunningTest;
|
||||
$this->originalIsRunningTest = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user