diff --git a/tests/php-unit-tests/unitary-tests/application/MenuNodeTest.php b/tests/php-unit-tests/unitary-tests/application/MenuNodeTest.php index 056f163bb..4c9961ece 100644 --- a/tests/php-unit-tests/unitary-tests/application/MenuNodeTest.php +++ b/tests/php-unit-tests/unitary-tests/application/MenuNodeTest.php @@ -20,6 +20,17 @@ class MenuNodeTest extends ItopDataTestCase { $this->oUR = $this->CreateUserRequest(666, $aUserRequestCustomParams); } + private function StartStopwatchInThePast(\UserRequest $oTicket, string $sAttCode, int $iSecDelay) + { + $iStartDate = time() - $iSecDelay; + /** @var \ormStopWatch $oStopwatch */ + $oStopwatch = $oTicket->Get($sAttCode); + $oAttDef = \MetaModel::GetAttributeDef(get_class($oTicket), $sAttCode); + $oStopwatch->Start($oTicket, $oAttDef, $iStartDate); + $oStopwatch->ComputeDeadlines($oTicket, $oAttDef); + $oTicket->Set($sAttCode, $oStopwatch); + } + public function RenderOQLSearchProvider() { $aUseCases = []; @@ -59,13 +70,15 @@ OQL; */ public function testRenderOQLSearchOqlWithDateFormatOnDeadline() { + $this->StartStopwatchInThePast($this->oUR, 'ttr', 10); + $sOql = <<CallRenderOQLSearch(true, true, true, $sOql); - $this->assertTrue(true); + $sContent = $this->CallRenderOQLSearch(true, true, true, $sOql); + $this->assertTrue(false !== strpos($sContent, $this->oUR->Get('title')), $sContent); } catch(\Exception $e){ echo($e->getMessage()); $this->fail('Without N°7750 fix Exception raised => TypeError : date(): Argument #2 ($timestamp) must be of type ?int, string given');