* Test that getFromTo returns the correct dates.
*
* @dataProvider fromToData
- * @param $expectedFrom
- * @param $expectedTo
- * @param $relative
- * @param $from
- * @param $to
+ *
+ * @param string $expectedFrom
+ * @param string $expectedTo
+ * @param string $relative
+ * @param string $from
+ * @param string $to
*/
public function testGetFromTo($expectedFrom, $expectedTo, $relative, $from, $to) {
$obj = new CRM_Report_Form();
+ if (date('H-i') === '00:00') {
+ $this->markTestIncomplete('The date might have changed since the dataprovider was called. Skip to avoid flakiness');
+ }
list($calculatedFrom, $calculatedTo) = $obj->getFromTo($relative, $from, $to);
$this->assertEquals([$expectedFrom, $expectedTo], [$calculatedFrom, $calculatedTo], "fail on data set [ $relative , $from , $to ]. Local php time is " . date('Y-m-d H:i:s') . ' and mysql time is ' . CRM_Core_DAO::singleValueQuery('SELECT NOW()'));
}