Skip to content

Commit

Permalink
refs #57 fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed Mar 4, 2014
1 parent 8daa186 commit 6034c0e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 46 deletions.
80 changes: 40 additions & 40 deletions plugins/Insights/tests/ApiTest.php
Expand Up @@ -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%
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down
12 changes: 6 additions & 6 deletions tests/PHPUnit/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php
Expand Up @@ -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
));
}
Expand Down

0 comments on commit 6034c0e

Please sign in to comment.