Optimize tests execution time (x10 / no need for a systematic check of date formats, which was ok as a first approach)

This commit is contained in:
Romain Quetiez
2023-10-25 22:59:03 +02:00
parent 7fbc211c43
commit b5c46ccd4a

View File

@@ -490,7 +490,7 @@ class ExpressionEvaluateTest extends ItopDataTestCase
{
$oExpression = new FunctionExpression('DATE_FORMAT', array(new ScalarExpression($sDate), new ScalarExpression("%$sFormat")));
$itopExpressionResult = $oExpression->Evaluate(array());
static::assertSame($aMysqlDateFormatRsultsForAllFormats[$sFormat], $itopExpressionResult, "Format %$sFormat not matching MySQL for '$sDate'");
$this->assertSame($aMysqlDateFormatRsultsForAllFormats[$sFormat], $itopExpressionResult, "Format %$sFormat not matching MySQL for '$sDate'");
}
}
}
@@ -536,7 +536,7 @@ class ExpressionEvaluateTest extends ItopDataTestCase
public function EveryTimeFormatOnDateRangeProvider()
{
return array(
'10 years, day by day' => array('2000-01-01', 'P1D', 365 * 10),
'10 years, each 17 days' => array('2000-01-01', 'P17D', 365 * 10 / 17),
'1 day, hour by hour' => array('2000-01-01 00:01:02', 'PT1H', 24),
'1 hour, minute by minute' => array('2000-01-01 00:01:02', 'PT1M', 60),
'1 minute, second by second' => array('2000-01-01 00:01:02', 'PT1S', 60),