Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2015-03-11 00:24:50 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-03-11 00:24:50 +0300
commit40067e7dcdcd6f7ad28918730de713a82c3e3f32 (patch)
tree13074580e119e45bf679e2e9c2e34699855417d1 /plugins/Live/tests/System
parent8b180a51e640dc84a06db2d221063231ea47b354 (diff)
refs #6758 Request less data in the actual counter widget.
* If we know there are 0 visits, do not execute any further query. * Added showColumns as it is more appropriate
Diffstat (limited to 'plugins/Live/tests/System')
-rw-r--r--plugins/Live/tests/System/APITest.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/plugins/Live/tests/System/APITest.php b/plugins/Live/tests/System/APITest.php
index 185d2d317e..4b65a5ae4e 100644
--- a/plugins/Live/tests/System/APITest.php
+++ b/plugins/Live/tests/System/APITest.php
@@ -73,16 +73,35 @@ class APITest extends SystemTestCase
public function test_GetCounters_ShouldHideAllColumnsIfRequested()
{
$exampleCounter = $this->buildCounter(0, 0, 0, 0);
- $counters = $this->api->getCounters($this->idSite, 5, false, array_keys($exampleCounter[0]));
+ $counters = $this->api->getCounters($this->idSite, 5, false, array(), array_keys($exampleCounter[0]));
$this->assertEquals(array(array()), $counters);
}
public function test_GetCounters_ShouldHideSomeColumnsIfRequested()
{
- $counters = $this->api->getCounters($this->idSite, 20, false, array('visitsConverted', 'visitors'));
+ $counters = $this->api->getCounters($this->idSite, 20, false, array(), array('visitsConverted', 'visitors'));
$this->assertEquals(array(array('visits' => 24, 'actions' => 60)), $counters);
}
+ public function test_GetCounters_ShouldShowAllColumnsIfRequested()
+ {
+ $counter = $this->buildCounter(24, 60, 20, 40);
+ $counters = $this->api->getCounters($this->idSite, 20, false, array_keys($counter[0]));
+ $this->assertEquals($counter, $counters);
+ }
+
+ public function test_GetCounters_ShouldShowSomeColumnsIfRequested()
+ {
+ $counters = $this->api->getCounters($this->idSite, 20, false, array('visits', 'actions'));
+ $this->assertEquals(array(array('visits' => 24, 'actions' => 60)), $counters);
+ }
+
+ public function test_GetCounters_ShouldHideColumnIfGivenInShowAndHide()
+ {
+ $counters = $this->api->getCounters($this->idSite, 20, false, array('visits', 'actions'), array('actions'));
+ $this->assertEquals(array(array('visits' => 24)), $counters);
+ }
+
private function trackSomeVisits()
{
$nowTimestamp = time();