MINOR: don't trigger notice but Debug::show it

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@113936 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andreas Piening 2010-11-19 01:04:30 +00:00 committed by Sam Minnee
parent 1fb51c6c5d
commit fdebd72e97

View File

@ -7,7 +7,6 @@ class DbDatetimeTest extends FunctionalTest {
private static $offset = 0; // number of seconds of php and db time are out of sync private static $offset = 0; // number of seconds of php and db time are out of sync
private static $offset_thresholds = array( // throw an error if the offset exceeds 30 minutes private static $offset_thresholds = array( // throw an error if the offset exceeds 30 minutes
E_USER_ERROR => 1800, E_USER_ERROR => 1800,
E_USER_WARNING => 60,
E_USER_NOTICE => 5, E_USER_NOTICE => 5,
); );
@ -35,7 +34,11 @@ class DbDatetimeTest extends FunctionalTest {
self::$offset = time() - strtotime(DB::query('SELECT ' . DB::getConn()->now())->value()); self::$offset = time() - strtotime(DB::query('SELECT ' . DB::getConn()->now())->value());
foreach(self::$offset_thresholds as $code => $offset) { foreach(self::$offset_thresholds as $code => $offset) {
if(abs(self::$offset) > $offset) { if(abs(self::$offset) > $offset) {
trigger_error('The time of the databse is out of sync with the webserver by ' . abs(self::$offset) . ' seconds.', $code); if($code == E_USER_ERROR) {
Debug::show('The time of the database is out of sync with the webserver by ' . abs(self::$offset) . ' seconds.');
} else {
trigger_error('The time of the database is out of sync with the webserver by ' . abs(self::$offset) . ' seconds.', $code);
}
break; break;
} }
} }