Skip to content
Snippets Groups Projects
Commit 1b511a8e authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #32070 activate Novelty facet batch in cosmo cron phase batch

parent 16722249
Branches
Tags
2 merge requests!1824Dev#32070 novelty by items with thesaurus,!1811Dev#32070 novelty by items with thesaurus
......@@ -38,7 +38,7 @@ class Class_Cosmogramme_Integration_PhaseBatchs
return;
}
foreach(Class_Batch::findAllBy(['order' => 'id']) as $batch) {
foreach(Class_Batch::findAllWithDefaults(['order' => 'id']) as $batch) {
if ($this->_getData('pointeur_reprise') > $batch->getId())
continue;
......
......@@ -23,9 +23,18 @@
abstract class PhaseBatchsTestCase extends Class_Cosmogramme_Integration_PhaseTestCase {
protected $_batch, $_registry_http_client, $_mock_http_client;
protected function _buildPhase($name) {
$phase = parent::_buildPhase($name);
$phase->setMemoryCleaner(function() {});
return $phase;
}
protected function _prepareFixtures() {
$this->fixture('Class_Batch',
['id' => 34, 'type' => 'TestingTest']);
['id' => 34,
'type' => 'TestingTest']);
$this->_batch = $this->mock();
$this->_batch
......@@ -79,7 +88,7 @@ class PhaseBatchsManualRunTest extends PhaseBatchsTestCase {
/** @test */
public function shouldHaveNotRunAnyBatch() {
$this->assertFalse(Class_Batch::methodHasBeenCalled('findAllBy'));
$this->assertFalse(Class_Batch::methodHasBeenCalled('findAllWithDefaults'));
}
}
......@@ -136,9 +145,9 @@ class PhaseBatchsCronRunWithLoggerTest extends PhaseBatchsTestCase {
protected function _prepareFixtures() {
$this->fixture('Class_Batch',
['id' => 34,
'type' => 'TestingTest']);
$testing_batch = $this->fixture('Class_Batch',
['id' => 34,
'type' => 'TestingTest']);
$this->_batch = new Class_Cosmogramme_Integration_PhaseTestingBatch();
......@@ -165,4 +174,20 @@ class Class_Cosmogramme_Integration_PhaseTestingBatch extends Class_Batch_Abstra
public function run() {
$this->getLogger()->log('Testing test log');
}
}
\ No newline at end of file
}
class PhaseBatchsCronRunWithDefaultsTest extends PhaseBatchsTestCase {
protected function _getPreviousPhase() {
return (new Class_Cosmogramme_Integration_Phase(0))
->beCron();
}
/** @test */
public function shouldFindAllWithDefaults() {
$this->assertTrue(Class_Batch::methodHasBeenCalled('findAllWithDefaults'));
}
}
......@@ -52,7 +52,6 @@ abstract class Class_Cosmogramme_Integration_PhaseTestCase extends ModelTestCase
$this->fixture('Class_CosmoVar',
['id' => 'integration_path', 'valeur' => realpath(dirname(__FILE__)) . '/']);
$this->fixture('Class_CosmoVar', ['id' => 'import_type_operation', 'liste' => '']);
Class_CosmoVar::addLabelInList('import_type_operation',
Class_Cosmogramme_Integration::TYPE_OPERATION_TOTAL,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment