aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-10-01 02:15:26 +0200
committerAndreas Fischer <bantu@phpbb.com>2014-10-01 02:15:26 +0200
commit7c8b8877dfe41a5e785532ccad3d4e74e56cc25b (patch)
tree194477a6e10e2ed6c47f3e0032adc8595c7831a6
parent236f75c6cbc833195135cf0ab801d523b4fcfdfb (diff)
parent8fef959418fa43e04be051012c97657225644893 (diff)
downloadforums-7c8b8877dfe41a5e785532ccad3d4e74e56cc25b.tar
forums-7c8b8877dfe41a5e785532ccad3d4e74e56cc25b.tar.gz
forums-7c8b8877dfe41a5e785532ccad3d4e74e56cc25b.tar.bz2
forums-7c8b8877dfe41a5e785532ccad3d4e74e56cc25b.tar.xz
forums-7c8b8877dfe41a5e785532ccad3d4e74e56cc25b.zip
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/13122] Make phpbb_wrapper_gmgetdate_test more reliable
-rw-r--r--tests/wrapper/gmgetdate_test.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/wrapper/gmgetdate_test.php b/tests/wrapper/gmgetdate_test.php
index dc0e38544d..2e55a78d21 100644
--- a/tests/wrapper/gmgetdate_test.php
+++ b/tests/wrapper/gmgetdate_test.php
@@ -50,7 +50,18 @@ class phpbb_wrapper_gmgetdate_test extends phpbb_test_case
$date_array['year']
);
- $this->assertEquals($expected, $actual);
+ // Calling second-granularity time functions twice isn't guaranteed to
+ // give the same results. As long as they're in the right order, allow
+ // a 1 second difference.
+ $this->assertGreaterThanOrEqual(
+ $expected, $actual,
+ 'Expected second time to be after (or equal to) the previous one'
+ );
+ $this->assertLessThanOrEqual(
+ 1,
+ abs($actual - $expected),
+ "Expected $actual to be within 1 second of $expected."
+ );
if (isset($current_timezone))
{