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
path: root/tests
diff options
context:
space:
mode:
authordiosmosis <benaka.moorthi@gmail.com>2013-04-08 09:22:43 +0400
committerdiosmosis <benaka.moorthi@gmail.com>2013-04-08 09:22:43 +0400
commit5879fbd3746e142f36351d5392b584c6f5ac8fdb (patch)
treea30269e9a8edf4905c1fc6f7f0c3cd4e0ea8fb74 /tests
parent95dc8d9834bf72d1838e0e6143fb67b51fe0e295 (diff)
Refs #3781, fixing build, revert last change and add getSuperUserLogin to Piwik_Access (so FakeAccess can mock it). Modified PDFReports to use Piwik::getSuperUserLogin instead of accessing config directly.
Diffstat (limited to 'tests')
-rw-r--r--tests/PHPUnit/FakeAccess.php6
-rwxr-xr-xtests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php11
-rwxr-xr-xtests/PHPUnit/IntegrationTestCase.php3
-rw-r--r--tests/PHPUnit/Plugins/UsersManagerTest.php1
4 files changed, 18 insertions, 3 deletions
diff --git a/tests/PHPUnit/FakeAccess.php b/tests/PHPUnit/FakeAccess.php
index 2f2dba4043..5b14a25c41 100644
--- a/tests/PHPUnit/FakeAccess.php
+++ b/tests/PHPUnit/FakeAccess.php
@@ -14,6 +14,7 @@ class FakeAccess
public static $idSitesAdmin = array();
public static $idSitesView = array();
public static $identity = 'superUserLogin';
+ public static $superUserLogin = 'superUserLogin';
public function __construct()
{
@@ -155,4 +156,9 @@ class FakeAccess
}
return $result;
}
+
+ public function getSuperUserLogin()
+ {
+ return self::$superUserLogin;
+ }
}
diff --git a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php b/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php
index 677c5c3ff7..0c01c81f8f 100755
--- a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php
+++ b/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php
@@ -73,6 +73,17 @@ class Test_Piwik_Integration_ManyVisitorsOneWebsiteTest extends IntegrationTestC
'periods' => array('month'),
'otherRequestParameters' => array('ip' => '194.57.91.215')
)),
+
+ // test filter_sort_column w/ processed metric
+ array('API.getProcessedReport', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => 'day',
+ 'apiModule' => 'UserCountry',
+ 'apiAction' => 'getCity',
+ 'testSuffix' => '_filterSortProcessed',
+ 'otherRequestParameters' => array(
+ //'filter_sort_column' => 'bounce_rate'
+ ))),
);
}
}
diff --git a/tests/PHPUnit/IntegrationTestCase.php b/tests/PHPUnit/IntegrationTestCase.php
index 8647ea4c56..b3f25de242 100755
--- a/tests/PHPUnit/IntegrationTestCase.php
+++ b/tests/PHPUnit/IntegrationTestCase.php
@@ -146,9 +146,6 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase
// Usually these modules either return random changing data, or are already tested in specific unit tests.
self::setApiNotToCall(self::$defaultApiNotToCall);
self::setApiToCall(array());
-
- // set config superuser login to test login
- Piwik_Config::getInstance()->superuser['login'] = 'superUserLogin';
}
public static function tearDownAfterClass()
diff --git a/tests/PHPUnit/Plugins/UsersManagerTest.php b/tests/PHPUnit/Plugins/UsersManagerTest.php
index 48d3f17390..ee36e68751 100644
--- a/tests/PHPUnit/Plugins/UsersManagerTest.php
+++ b/tests/PHPUnit/Plugins/UsersManagerTest.php
@@ -21,6 +21,7 @@ class UsersManagerTest extends DatabaseTestCase
//finally we set the user as a super user by default
FakeAccess::$superUser = true;
+ FakeAccess::$superUserLogin = 'superusertest';
Zend_Registry::set('access', $pseudoMockAccess);
// we make sure the tests don't depend on the config file content