Merge pull request #78 from tractorcow/fix-tests
BUG Prevent subsites breaking travis tests
This commit is contained in:
commit
c73766b163
|
@ -48,15 +48,27 @@ class BatchedProcessorTest extends SapphireTest {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
public function setUpOnce() {
|
||||||
|
// Disable illegal extensions if skipping this test
|
||||||
|
if(class_exists('Subsite') || !interface_exists('QueuedJob')) {
|
||||||
|
$this->illegalExtensions = array();
|
||||||
|
}
|
||||||
|
parent::setUpOnce();
|
||||||
|
}
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
Config::nest();
|
Config::nest();
|
||||||
|
|
||||||
if (!interface_exists('QueuedJob')) {
|
if (!interface_exists('QueuedJob')) {
|
||||||
$this->markTestSkipped("These tests need the QueuedJobs module installed to run");
|
|
||||||
$this->skipTest = true;
|
$this->skipTest = true;
|
||||||
|
$this->markTestSkipped("These tests need the QueuedJobs module installed to run");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(class_exists('Subsite')) {
|
||||||
|
$this->skipTest = true;
|
||||||
|
$this->markTestSkipped(get_class() . ' skipped when running with subsites');
|
||||||
|
}
|
||||||
|
|
||||||
SS_Datetime::set_mock_now('2015-05-07 06:00:00');
|
SS_Datetime::set_mock_now('2015-05-07 06:00:00');
|
||||||
|
|
||||||
|
@ -76,10 +88,11 @@ class BatchedProcessorTest extends SapphireTest {
|
||||||
$this->oldProcessor = SearchUpdater::$processor;
|
$this->oldProcessor = SearchUpdater::$processor;
|
||||||
SearchUpdater::$processor = new SearchUpdateQueuedJobProcessor();
|
SearchUpdater::$processor = new SearchUpdateQueuedJobProcessor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown() {
|
public function tearDown() {
|
||||||
|
if($this->oldProcessor) {
|
||||||
SearchUpdater::$processor = $this->oldProcessor;
|
SearchUpdater::$processor = $this->oldProcessor;
|
||||||
|
}
|
||||||
Config::unnest();
|
Config::unnest();
|
||||||
Injector::inst()->unregisterNamedObject('QueuedJobService');
|
Injector::inst()->unregisterNamedObject('QueuedJobService');
|
||||||
FullTextSearch::force_index_list();
|
FullTextSearch::force_index_list();
|
||||||
|
|
Loading…
Reference in New Issue