From 694daa01dd67f03af1d3178676e130ce58ae1758 Mon Sep 17 00:00:00 2001 From: Jeff Chan Date: Fri, 14 Mar 2014 20:00:19 +0000 Subject: [PATCH] Cache date in ConfigGenerator unit test Occasionally we run into timing issues. For example, if the config is generated at 12:00:59PM and the assertion is at 12:01:00PM, then the test will fail. This should bring the expected $date closer to when the config is generated. Signed-off-by: Jeff Chan --- test/libraries/PMA_ConfigGenerator_test.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/libraries/PMA_ConfigGenerator_test.php b/test/libraries/PMA_ConfigGenerator_test.php index adb82d689b..6e78e8764b 100644 --- a/test/libraries/PMA_ConfigGenerator_test.php +++ b/test/libraries/PMA_ConfigGenerator_test.php @@ -44,6 +44,7 @@ class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase $cf->setPersistKeys(array("1/", 2)); + $date = date(DATE_RFC1123); $result = ConfigGenerator::getConfigFile($cf); $this->assertContains( @@ -52,7 +53,7 @@ class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase " * Generated configuration file\n" . " * Generated by: phpMyAdmin " . $GLOBALS['PMA_Config']->get('PMA_VERSION') . " setup script\n" . - " * Date: " . date(DATE_RFC1123) . "\n" . + " * Date: " . $date . "\n" . " */\n\n", $result );