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:
authordiosmosis <benaka@piwik.pro>2015-08-26 20:58:27 +0300
committerdiosmosis <benaka@piwik.pro>2015-08-26 20:58:27 +0300
commitb71fc05371a8d2bd22cd428d7ecf481d825d60fd (patch)
tree23af555b112f75c579ed3a5314664ff317cf7373 /plugins/SitesManager
parent756e8eee18340da26a14395ef55cbe19125ac90e (diff)
Add addSite & updateSite test for exclude_unknown_urls setting.
Diffstat (limited to 'plugins/SitesManager')
-rw-r--r--plugins/SitesManager/lang/en.json4
-rw-r--r--plugins/SitesManager/tests/Integration/ApiTest.php27
-rw-r--r--plugins/SitesManager/tests/System/expected/test_SitesManagerwithLimit__SitesManager.getPatternMatchSites.xml2
3 files changed, 31 insertions, 2 deletions
diff --git a/plugins/SitesManager/lang/en.json b/plugins/SitesManager/lang/en.json
index 218140c307..e3ae0d3feb 100644
--- a/plugins/SitesManager/lang/en.json
+++ b/plugins/SitesManager/lang/en.json
@@ -74,8 +74,8 @@
"TrackingTags": "Tracking code for %s",
"Urls": "URLs",
"UTCTimeIs": "UTC time is %s.",
- "OnlyMatchedUrlsAllowed": "Only track visits for actions on any of the website URLs",
- "OnlyMatchedUrlsAllowedHelp": "When enabled, Piwik will only track the data when the Page URL is one of the known URLs for your website.",
+ "OnlyMatchedUrlsAllowed": "Only track visits and actions when the action URL starts with one of the above URLs.",
+ "OnlyMatchedUrlsAllowedHelp": "When enabled, Piwik will only track internal actions when the Page URL is one of the known URLs for your website. This prevents people from spamming your analytics with URLs for other websites.",
"WebsitesManagement": "Websites Management",
"XManagement": "Manage %s",
"ChooseMeasurableTypeHeadline": "What would you like to measure?",
diff --git a/plugins/SitesManager/tests/Integration/ApiTest.php b/plugins/SitesManager/tests/Integration/ApiTest.php
index 9d8542526d..f1863b612c 100644
--- a/plugins/SitesManager/tests/Integration/ApiTest.php
+++ b/plugins/SitesManager/tests/Integration/ApiTest.php
@@ -442,6 +442,17 @@ class ApiTest extends IntegrationTestCase
$this->fail('Expected exception not raised');
}
+ public function test_addSite_CorrectlySavesExcludeUnknownUrlsSetting()
+ {
+ $idSite = API::getInstance()->addSite("site", array("http://piwik.net"), $ecommerce = null, $siteSearch = null,
+ $searchKeywordParams = null, $searchCategoryParams = null, $excludedIps = null, $excludedQueryParams = null,
+ $timezone = null, $currency = null, $group = null, $startDate = null, $excludedUserAgents = null,
+ $keepUrlFragments = null, $type = null, $settings = null, $excludeUnknownUrls = true);
+
+ $site = API::getInstance()->getSiteFromId($idSite);
+ $this->assertEquals(1, $site['exclude_unknown_urls']);
+ }
+
/**
* no Id -> empty array
*/
@@ -907,6 +918,22 @@ class ApiTest extends IntegrationTestCase
$this->assertSame('org.piwik.mobile2', $measurable->getSettingValue('app_id'));
}
+ public function test_updateSite_CorreclySavesExcludedUnknownUrlSettings()
+ {
+ $idSite = API::getInstance()->addSite("site1", array("http://piwik.net"));
+
+ $site = API::getInstance()->getSiteFromId($idSite);
+ $this->assertEquals(0, $site['exclude_unknown_urls']);
+
+ API::getInstance()->updateSite($idSite, $siteName = null, $urls = null, $ecommerce = null, $siteSearch = null,
+ $searchKeywordParams = null, $searchCategoryParams = null, $excludedIps = null, $excludedQueryParameters = null,
+ $timzeone = null, $currency = null, $group = null, $startDate = null, $excludedUserAgents = null,
+ $keepUrlFragments = null, $type = null, $settings = null, $excludeUnknownUrls = true);
+
+ $site = API::getInstance()->getSiteFromId($idSite);
+ $this->assertEquals(1, $site['exclude_unknown_urls']);
+ }
+
/**
* @expectedException Exception
* @expectedExceptionMessage SitesManager_ExceptionDeleteSite
diff --git a/plugins/SitesManager/tests/System/expected/test_SitesManagerwithLimit__SitesManager.getPatternMatchSites.xml b/plugins/SitesManager/tests/System/expected/test_SitesManagerwithLimit__SitesManager.getPatternMatchSites.xml
index 19de347831..31601184b7 100644
--- a/plugins/SitesManager/tests/System/expected/test_SitesManagerwithLimit__SitesManager.getPatternMatchSites.xml
+++ b/plugins/SitesManager/tests/System/expected/test_SitesManagerwithLimit__SitesManager.getPatternMatchSites.xml
@@ -11,6 +11,7 @@
<sitesearch_category_parameters />
<timezone>UTC</timezone>
<currency>USD</currency>
+ <exclude_unknown_urls>0</exclude_unknown_urls>
<excluded_ips />
<excluded_parameters />
<excluded_user_agents />
@@ -29,6 +30,7 @@
<sitesearch_category_parameters />
<timezone>UTC</timezone>
<currency>USD</currency>
+ <exclude_unknown_urls>0</exclude_unknown_urls>
<excluded_ips />
<excluded_parameters />
<excluded_user_agents />