@@ -615,9 +615,6 @@ public function testOlaTtrComputation()
615615 $ ticket = $ this ->updateItem (Ticket::class, $ ticket ->getID (), ['_la_update ' => true , '_olas_id ' => [(int ) $ ola_id ]]);
616616 $ _SESSION ['glpi_currenttime ' ] = $ currenttime_bak ;
617617 $ this ->assertTrue ($ ticket ->getFromDB ($ ticket_id ));
618- $ this ->assertEquals ($ ola_id , (int ) $ ticket ->fields ['olas_id_ttr ' ]);
619- $ this ->assertEquals ($ update_time , strtotime ($ ticket ->fields ['ola_ttr_begin_date ' ]), 'OLA begin date should be time of assignment of OLA to the ticket ' );
620- $ this ->assertEquals ($ tomorrow_1pm , $ ticket ->fields ['internal_time_to_resolve ' ]);
621618
622619 $ ola_ttr = $ ticket ->getOlasTTRData ()[0 ];
623620 $ this ->assertEquals ($ ola_id , (int ) $ ola_ttr ['olas_id ' ]);
@@ -2333,48 +2330,6 @@ public function testEscalationLevelsChangesWithMultiplesOlas(): void
23332330 // - when ticket status is CLOSED or CLOSED
23342331 // - when levelAgreement is an TTO and takeintoaccount_delay_stat is > 0
23352332
2336- /**
2337- * Ola begin date values business logic test
2338- *
2339- * ola begin date fields (ola_tto_begin_date, ola_ttr_begin_date) logic is as follows:
2340- * - ola is set on ticket creation : ola begin date is set ticket.date field
2341- * - ola is set on ticket update : ola begin date is set to the current time
2342- */
2343- public function testOlaBeginDate (): void
2344- {
2345- $ this ->login ();
2346-
2347- // on creation, the OLA begin date is set to the ticket date
2348- $ provided_date = '2025-05-26 10:00:00 ' ;
2349- foreach ([\SLM ::TTR , \SLM ::TTO ] as $ type ) {
2350- ['ola ' => $ ola ] = $ this ->createOLA (ola_type: $ type );
2351- [$ olas_id_fk , $ olas_begin_field ] = match ($ type ) {
2352- \SLM ::TTO => ['olas_id_tto ' , 'ola_tto_begin_date ' ],
2353- \SLM ::TTR => ['olas_id_ttr ' , 'ola_ttr_begin_date ' ],
2354- };
2355- // create ticket with OLA set on creation + provided date
2356- $ ticket = $ this ->createTicket (['date ' => $ provided_date , $ olas_id_fk => $ ola ->getID ()]);
2357-
2358- $ this ->assertEquals ($ provided_date , $ ticket ->fields [$ olas_begin_field ]);
2359- }
2360-
2361- // on update, the OLA begin date is set to the current time
2362- $ now = $ this ->setCurrentTime ('09:00:00 ' , '2022-05-26 ' );
2363- $ provided_date = '2022-05-01 10:00:00 ' ;
2364- foreach ([\SLM ::TTR , \SLM ::TTO ] as $ type ) {
2365- ['ola ' => $ ola ] = $ this ->createOLA (ola_type: $ type );
2366- [$ olas_id_fk , $ olas_begin_field ] = match ($ type ) {
2367- \SLM ::TTO => ['olas_id_tto ' , 'ola_tto_begin_date ' ],
2368- \SLM ::TTR => ['olas_id_ttr ' , 'ola_ttr_begin_date ' ],
2369- };
2370- // create ticket with OLA set on creation + provided date
2371- $ ticket = $ this ->createTicket (['date ' => $ provided_date ]);
2372- $ ticket = $ this ->updateItem ($ ticket ::class, $ ticket ->getID (), [$ olas_id_fk => $ ola ->getID (),]);
2373-
2374- $ this ->assertEquals ($ now ->format ('Y-m-d H:i:s ' ), $ ticket ->fields [$ olas_begin_field ]);
2375- }
2376- }
2377-
23782333 /**
23792334 * Check recalculating the SLA when the SLA is changed to an SLA with a different calendar
23802335 *
0 commit comments