public function testGetAllCachedSiteUrls_ShouldReturnCorrectResultEvenIfItIsCachedAsWeClearTheCacheOnAnyChange()
{
$this->addSite('http://www.example.com');
// only one main URL
$this->assertCachedSiteUrls(array(1 => array('http://www.example.com')));
$this->addSite('http://www.example.com', 'http://www.piwik.org');
// main URL and alias URL
$this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://www.piwik.org')));
$this->api->addSiteAliasUrls(2, 'http://piwik.org');
$this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://piwik.org', 'http://www.piwik.org')));
$this->api->setSiteAliasUrls(2, array());
$this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com')));
$this->api->updateSite(1, 'siteName3', array('http://updated.example.com', 'http://2.example.com'));
$this->assertCachedSiteUrls(array(1 => array('http://updated.example.com', 'http://2.example.com'), 2 => array('http://www.example.com')));
}