Skip to content
Snippets Groups Projects
Commit ae70477a authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#26261-last-import-date-not-updated' into 'hotline-master'

Hotline#26261 last import date not updated

See merge request !959
parents 3550543f 3dc100d5
Branches
Tags 5.13.1
2 merge requests!964Master,!963Hotline master
- ticket #26261 : Cosmogramme : correction de la non mise à jour de la date de dernier import déclenchant les alertes de retard d'intégration
\ No newline at end of file
......@@ -66,9 +66,13 @@ abstract class Class_Cosmogramme_Integration_PhaseOnDataSource extends Class_Cos
$this->_runFile($data_source, $integration);
if (!$this->isTimeOut()) {
$integration->setTraite($this->getTimeSource()->dateYmd())
$date = $this->getTimeSource()->dateYmd();
$integration->setTraite($date)
->setPointeurReprise($this->_getData('nombre'))
->save();
$integration->getBib()
->setDernierAjout($date)
->save();
$this->_phase->incrementData('nb_fic');
}
}
......
......@@ -30,8 +30,10 @@ class PhaseNoticeImportTest extends PhaseNoticeTestCase {
'valeur' => Class_CosmoVar::DOUBLE_SEARCH_ALPHA_KEY]);
$this->fixture('Class_Exemplaire',
['id' => 889039,
'id_int_bib' => 2]);
['id' => 889039, 'id_int_bib' => 2]);
$time_source = $this->mock()->whenCalled('dateYmd')->answers('2015-06-26');
Class_Cosmogramme_Integration_PhaseNotice::setTimeSource($time_source);
}
......@@ -72,6 +74,15 @@ class PhaseNoticeImportTest extends PhaseNoticeTestCase {
public function logShouldContainsDeletedOneItemMessage() {
$this->assertLogContains('1 exemplaires supprimés');
}
/**
* @test
* @see http://forge.afi-sa.fr/issues/26261
*/
public function libraryLastImportDateShouldBeSet() {
$this->assertEquals('2015-06-26', Class_IntBib::find(2)->getDernierAjout());
}
}
......
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