From 6034c0ead3016b0369e0bdcd0a8a252564aa88d7 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Tue, 4 Mar 2014 02:57:22 +0100 Subject: [PATCH] refs #57 fix tests --- plugins/Insights/tests/ApiTest.php | 80 +++++++++---------- .../SomeVisitsDifferentPathsOnTwoDays.php | 12 +-- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/plugins/Insights/tests/ApiTest.php b/plugins/Insights/tests/ApiTest.php index e73623fb800..c62a20aab46 100644 --- a/plugins/Insights/tests/ApiTest.php +++ b/plugins/Insights/tests/ApiTest.php @@ -39,10 +39,10 @@ public function setUp() } /** - '/category/Mover1' => 2, +8 // 400% - '/category/Old1' => 9, -9 // -100% + '//Mover1' => 2, +8 // 400% + '//Old1' => 9, -9 // -100% '/Mover2' => 24, -11 // -50% - '/category/Mover3' => 21, -1 // -5% + '//Mover3' => 21, -1 // -5% '/Old2' => 3 -3 // -100% New1, +5 // 100% New2 +2 // 100% @@ -94,13 +94,13 @@ public function test_getInsights_ShouldReturnAllRowsIfMinValuesArelow() $insights = $this->requestInsights(array('minVisitsPercent' => 0, 'minGrowthPercent' => 1)); $expectedLabels = array( - 'category/Mover1', - 'category/New1', - 'New2', - 'Mover2', - 'category/Old1', - 'Old2', - 'category/Mover3' + '/Mover1', + '/New1', + '/New2', + '/Mover2', + '/Old1', + '/Old2', + '/Mover3' ); $this->assertRows($expectedLabels, $insights); } @@ -124,13 +124,13 @@ public function test_getInsights_ShouldOrderAbsoluteByDefault() $insights = $this->requestInsights(array('minVisitsPercent' => 0, 'minGrowthPercent' => 0)); $expectedLabels = array( - 'category/Mover1', - 'category/New1', - 'New2', - 'Mover2', - 'category/Old1', - 'Old2', - 'category/Mover3' + '/Mover1', + '/New1', + '/New2', + '/Mover2', + '/Old1', + '/Old2', + '/Mover3' ); $this->assertRows($expectedLabels, $insights); } @@ -140,13 +140,13 @@ public function test_getInsights_ShouldBeAbleToOrderRelative() $insights = $this->requestInsights(array('minVisitsPercent' => 0, 'minGrowthPercent' => 0, 'orderBy' => 'relative')); $expectedLabels = array( - 'category/Mover1', - 'category/New1', - 'New2', - 'category/Old1', - 'Old2', - 'Mover2', - 'category/Mover3' + '/Mover1', + '/New1', + '/New2', + '/Old1', + '/Old2', + '/Mover2', + '/Mover3' ); $this->assertRows($expectedLabels, $insights); } @@ -156,13 +156,13 @@ public function test_getInsights_ShouldBeAbleToOrderByImportance() $insights = $this->requestInsights(array('minVisitsPercent' => 0, 'minGrowthPercent' => 0, 'orderBy' => 'importance')); $expectedLabels = array( - 'Mover2', - 'category/Old1', - 'category/Mover1', - 'category/New1', - 'Old2', - 'New2', - 'category/Mover3' + '/Mover2', + '/Old1', + '/Mover1', + '/New1', + '/Old2', + '/New2', + '/Mover3' ); $this->assertRows($expectedLabels, $insights); } @@ -172,8 +172,8 @@ public function test_getInsights_ShouldApplyTheLimit() $insights = $this->requestInsights(array('limitIncreaser' => 1, 'limitDecreaser' => 1)); $expectedLabels = array( - 'category/Mover1', - 'Mover2' + '/Mover1', + '/Mover2' ); $this->assertRows($expectedLabels, $insights); } @@ -183,9 +183,9 @@ public function test_getInsights_ShouldBeAbleToShowOnlyMovers() $insights = $this->requestInsights(array('minVisitsPercent' => 0, 'minGrowthPercent' => 0, 'filterBy' => 'movers')); $expectedLabels = array( - 'category/Mover1', - 'Mover2', - 'category/Mover3' + '/Mover1', + '/Mover2', + '/Mover3' ); $this->assertRows($expectedLabels, $insights); } @@ -195,8 +195,8 @@ public function test_getInsights_ShouldBeAbleToShowOnlyNew() $insights = $this->requestInsights(array('minVisitsPercent' => 0, 'minGrowthPercent' => 0, 'filterBy' => 'new')); $expectedLabels = array( - 'category/New1', - 'New2' + '/New1', + '/New2' ); $this->assertRows($expectedLabels, $insights); } @@ -206,8 +206,8 @@ public function test_getInsights_ShouldBeAbleToShowOnlyDisappeared() $insights = $this->requestInsights(array('minVisitsPercent' => 0, 'minGrowthPercent' => 0, 'filterBy' => 'disappeared')); $expectedLabels = array( - 'category/Old1', - 'Old2' + '/Old1', + '/Old2' ); $this->assertRows($expectedLabels, $insights); } diff --git a/tests/PHPUnit/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php b/tests/PHPUnit/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php index 6e681f5c04e..2486dcf6492 100644 --- a/tests/PHPUnit/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php +++ b/tests/PHPUnit/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php @@ -38,18 +38,18 @@ private function setUpWebsitesAndGoals() private function trackVisits() { $this->trackPageViews($this->date2, array( - '/category/Mover1' => 2, - '/category/Old1' => 9, + '/Mover1' => 2, + '/Old1' => 9, '/Mover2' => 24, - '/category/Mover3' => 21, + '/Mover3' => 21, '/Old2' => 3 )); $this->trackPageViews($this->date1, array( - '/category/Mover1' => 10, - '/category/New1' => 5, + '/Mover1' => 10, + '/New1' => 5, '/Mover2' => 13, - '/category/Mover3' => 20, + '/Mover3' => 20, '/New2' => 2 )); }