diff options
author | vipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-04-08 04:51:36 +0400 |
---|---|---|
committer | vipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-04-08 04:51:36 +0400 |
commit | 2e7a60f7f1aaa30d944a7c2cdea3a84c3ac5f56b (patch) | |
tree | 95704908e0bd81c155f56b2b4c99dc298ae7a551 /plugins/SitesManager/tests | |
parent | 568b1aa7125a8ca1e0ebafeb011b6c08cf983de4 (diff) |
fixes #1261 - SitesManager: add getSitesIdFromSiteUrl( $url ) to API; add unit test
Diffstat (limited to 'plugins/SitesManager/tests')
-rw-r--r-- | plugins/SitesManager/tests/SitesManager.test.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/SitesManager/tests/SitesManager.test.php b/plugins/SitesManager/tests/SitesManager.test.php index 9eb4a8c5cd..86c0a53129 100644 --- a/plugins/SitesManager/tests/SitesManager.test.php +++ b/plugins/SitesManager/tests/SitesManager.test.php @@ -781,5 +781,19 @@ class Test_Piwik_SitesManager extends Test_Database $this->assertEqual($site->getExcludedQueryParameters(), ''); } -} + function test_getSitesIdFromSiteUrl() + { + $idsite = Piwik_SitesManager_API::getInstance()->addSite("site1",array("http://piwik.net","http://piwik.com")); + $idsite = Piwik_SitesManager_API::getInstance()->addSite("site2",array("http://piwik.com","http://piwik.net")); + $idsite = Piwik_SitesManager_API::getInstance()->addSite("site3",array("http://piwik.com","http://piwik.org")); + + $idsites = Piwik_SitesManager_API::getInstance()->getSitesIdFromSiteUrl('http://piwik.org'); + $this->assertTrue(count($idsites) == 1); + $idsites = Piwik_SitesManager_API::getInstance()->getSitesIdFromSiteUrl('http://piwik.net'); + $this->assertTrue(count($idsites) == 2); + + $idsites = Piwik_SitesManager_API::getInstance()->getSitesIdFromSiteUrl('http://piwik.com'); + $this->assertTrue(count($idsites) == 3); + } +} |