Skip to content
Extraits de code Groupes Projets
Valider b71fc053 rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Add addSite & updateSite test for exclude_unknown_urls setting.

parent 756e8eee
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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?",
......
......@@ -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
......
......@@ -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 />
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter