diff options
author | mattab <matthieu.aubry@gmail.com> | 2015-11-26 06:09:54 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2015-11-26 06:09:54 +0300 |
commit | 92ef31deffbf4a9c44276370dc32df1419c796be (patch) | |
tree | 82eb94c03e32911e7dadb8e937fd792d6def503d /tests | |
parent | 926af9c74c67afc924e60fd6619ca499d1baab58 (diff) |
Make sure local time has valid time format fixes #9052
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PHPUnit/Unit/Tracker/RequestTest.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/PHPUnit/Unit/Tracker/RequestTest.php b/tests/PHPUnit/Unit/Tracker/RequestTest.php index 3db5c22a4a..7eb38059a2 100644 --- a/tests/PHPUnit/Unit/Tracker/RequestTest.php +++ b/tests/PHPUnit/Unit/Tracker/RequestTest.php @@ -470,6 +470,25 @@ class RequestTest extends UnitTestCase $this->assertContains($needle, $cookie . ''); } + public function test_getLocalTime() + { + $request = $this->buildRequest(array('h' => '12', 'm' => '34', 's' => '3')); + $this->assertSame('12:34:03', $request->getLocalTime()); + + + $request = $this->buildRequest(array('h' => '23', 'm' => '59', 's' => '59')); + $this->assertSame('23:59:59', $request->getLocalTime()); + } + + public function test_getLocalTime_shouldReturnValidTime_whenTimeWasInvalid() + { + $request = $this->buildRequest(array('h' => '26', 'm' => '60', 's' => '333')); + $this->assertSame('00:00:00', $request->getLocalTime()); + + $request = $this->buildRequest(array('h' => '-26', 'm' => '-60', 's' => '-333')); + $this->assertSame('00:00:00', $request->getLocalTime()); + } + public function test_getIdSite() { $request = $this->buildRequest(array('idsite' => '14')); |