diff options
Diffstat (limited to 'tests/PHPUnit/Unit/Tracker/RequestTest.php')
-rw-r--r-- | tests/PHPUnit/Unit/Tracker/RequestTest.php | 137 |
1 files changed, 0 insertions, 137 deletions
diff --git a/tests/PHPUnit/Unit/Tracker/RequestTest.php b/tests/PHPUnit/Unit/Tracker/RequestTest.php index c21df6d0d5..62b285247d 100644 --- a/tests/PHPUnit/Unit/Tracker/RequestTest.php +++ b/tests/PHPUnit/Unit/Tracker/RequestTest.php @@ -109,123 +109,6 @@ class RequestTest extends UnitTestCase $this->assertFalse($request->getForcedUserId()); } - public function test_getDaysSinceFirstVisit_shouldReturnZeroIfNow() - { - $this->assertEquals(0.0, $this->request->getDaysSinceFirstVisit()); - } - - public function test_getDaysSinceFirstVisit_ShouldNotReturnMinusValue() - { - $request = $this->buildRequest(array('_idts' => '' . ($this->time + 43200))); - $request->setIsAuthenticated(); - $this->assertEquals(0.0, $request->getDaysSinceFirstVisit()); - } - - public function test_getDaysSinceFirstVisit_TodayMinusHalfDay() - { - $request = $this->buildRequest(array('_idts' => '' . ($this->time - 43200))); - $request->setIsAuthenticated(); - $this->assertEquals(0.0, $request->getDaysSinceFirstVisit()); - } - - public function test_getDaysSinceFirstVisit_Yesterday() - { - $request = $this->buildRequest(array('_idts' => '' .($this->time - 86400))); - $request->setIsAuthenticated(); - $this->assertEquals(1.0, $request->getDaysSinceFirstVisit()); - } - - public function test_getDaysSinceFirstVisit_12Days() - { - $request = $this->buildRequest(array('_idts' => '' . ($this->time - (86400 * 12)))); - $request->setIsAuthenticated(); - $this->assertEquals(12.0, $request->getDaysSinceFirstVisit()); - } - - public function test_getDaysSinceFirstVisit_IfTimestampIsNotValidShouldIgnoreParam() - { - $request = $this->buildRequest(array('_idts' => '' . ($this->time - (86400 * 25 * 365)))); - $this->assertEquals(0.0, $request->getDaysSinceFirstVisit()); - } - - public function test_getDaysSinceLastOrder_shouldReturnZeroIfNow() - { - $this->assertEquals(0.0, $this->request->getDaysSinceLastOrder()); - } - - public function test_getDaysSinceLastOrder_ShouldNotReturnMinusValue() - { - $request = $this->buildRequest(array('_ects' => '' . ($this->time + 43200))); - $request->setIsAuthenticated(); - $this->assertEquals(0.0, $request->getDaysSinceLastOrder()); - } - - public function test_getDaysSinceLastOrder_TodayMinusHalfDay() - { - $request = $this->buildRequest(array('_ects' => '' . ($this->time - 43200))); - $request->setIsAuthenticated(); - $this->assertEquals(1.0, $request->getDaysSinceLastOrder()); - } - - public function test_getDaysSinceLastOrder_Yesterday() - { - $request = $this->buildRequest(array('_ects' => '' . ($this->time - 86400))); - $request->setIsAuthenticated(); - $this->assertEquals(1.0, $request->getDaysSinceLastOrder()); - } - - public function test_getDaysSinceLastOrder_12Days() - { - $request = $this->buildRequest(array('_ects' => '' . ($this->time - (86400 * 12)))); - $request->setIsAuthenticated(); - $this->assertEquals(12.0, $request->getDaysSinceLastOrder()); - } - - public function test_getDaysSinceLastOrder_ShouldIgnoreParamIfInvalid() - { - $request = $this->buildRequest(array('_ects' => 5)); - $this->assertFalse($request->getDaysSinceLastOrder()); - } - - public function test_getDaysSinceLastVisit_shouldReturnZeroIfNow() - { - $this->assertEquals(0.0, $this->request->getDaysSinceLastVisit()); - } - - public function test_getDaysSinceLastVisit_ShouldNotReturnMinusValue() - { - $request = $this->buildRequest(array('_viewts' => '' . ($this->time + 43200))); - $request->setIsAuthenticated(); - $this->assertEquals(0.0, $request->getDaysSinceLastVisit()); - } - - public function test_getDaysSinceLastVisit_TodayMinusHalfDay() - { - $request = $this->buildRequest(array('_viewts' => '' . ($this->time - 43200))); - $request->setIsAuthenticated(); - $this->assertEquals(1.0, $request->getDaysSinceLastVisit()); - } - - public function test_getDaysSinceLastVisit_Yesterday() - { - $request = $this->buildRequest(array('_viewts' => '' . ($this->time - 86400))); - $request->setIsAuthenticated(); - $this->assertEquals(1.0, $request->getDaysSinceLastVisit()); - } - - public function test_getDaysSinceLastVisit_12Days() - { - $request = $this->buildRequest(array('_viewts' => '' . ($this->time - (86400 * 12)))); - $request->setIsAuthenticated(); - $this->assertEquals(12.0, $request->getDaysSinceLastVisit()); - } - - public function test_getDaysSinceLastVisit_ShouldIgnoreParamIfInvalid() - { - $request = $this->buildRequest(array('_viewts' => '' . 5)); - $this->assertSame(0, $request->getDaysSinceLastVisit()); - } - public function test_getGoalRevenue_ShouldReturnDefaultValue_IfNothingSet() { $this->assertFalse($this->request->getGoalRevenue(false)); @@ -248,26 +131,6 @@ class RequestTest extends UnitTestCase $this->assertEquals('da4b9237bacccdf1', $this->request->getUserIdHashed(2)); } - public function test_getVisitCount_shouldReturnOne_IfNotSet() - { - $this->assertEquals(1, $this->request->getVisitCount()); - } - - public function test_getVisitCount_shouldReturnTheSetValue_IfHigherThanOne() - { - $request = $this->buildRequest(array('_idvc' => 13)); - $this->assertEquals(13, $request->getVisitCount()); - } - - public function test_getVisitCount_shouldReturnAtLEastOneEvenIfLowerValueIsSet() - { - $request = $this->buildRequest(array('_idvc' => 0)); - $this->assertEquals(1, $request->getVisitCount()); - - $request = $this->buildRequest(array('_idvc' => -1)); - $this->assertEquals(1, $request->getVisitCount()); - } - public function test_getLocalTime_shouldFallbackToCurrentDate_IfNoParamIsSet() { $this->assertEquals('02:20:17', $this->request->getLocalTime()); |