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 <jefftchan@gmail.com>
This commit is contained in:
Jeff Chan 2014-03-14 20:00:19 +00:00
parent 9290c6857e
commit 694daa01dd

View File

@ -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
);