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

rel #21286 : prepare to migrate one cosmogramme integration phase in object mode

parent 81c49dc8
Branches
Tags
3 merge requests!780Master,!755Stable,!750Hotline#21286 holds not deleted with full import
......@@ -127,7 +127,7 @@ class Class_Cosmogramme_Integration_TransactionDateFormat {
public function format($value) {
$value = str_replace('/', '-', $value);
$parts = explode('-', $value);
if (4 == $parts[0])
if (4 == strlen($parts[0]))
return implode('-', $parts);
$year = $parts[2];
......
......@@ -199,4 +199,56 @@ class PhaseReservationValidCronFirstRunTest extends PhaseReservationTestCase {
public function shouldNotImportPergameHeader() {
$this->assertNull(Class_Reservation::findFirstBy(['id_pergame' => 'BIB_T_RESERVE']));
}
/** @test */
public function shouldHaveImportedFirstHold() {
$this->assertNotNull($hold = Class_Reservation::findFirstBy(['id_pergame' => '26798']));
return $hold;
}
/**
* @test
* @depends shouldHaveImportedFirstHold
*/
public function firstHoldUserShouldBe3429($hold) {
$this->assertEquals(3429, $hold->getIdabon());
}
/**
* @test
* @depends shouldHaveImportedFirstHold
*/
public function firstHoldOrderShouldBe1($hold) {
$this->assertEquals(1, $hold->getOrdreabon());
}
/**
* @test
* @depends shouldHaveImportedFirstHold
*/
public function firstHoldSupportShouldBe1($hold) {
$this->assertEquals(1, $hold->getSupport());
}
/**
* @test
* @depends shouldHaveImportedFirstHold
*/
public function firstHoldNoticeShouldBe190003($hold) {
$this->assertEquals(190003, $hold->getIdNoticeOrigine());
}
/**
* @test
* @depends shouldHaveImportedFirstHold
*/
public function firstHoldDateShouldBeFebruary032015($hold) {
$this->assertEquals('2015-02-03', $hold->getDateResa());
}
}
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