public function testSetGetBaseURLs() { $helper = new AssetsHelper(); $helper->setBaseURLs('http://www.example.com/'); $this->assertEquals(array('http://www.example.com'), $helper->getBaseURLs(), '->setBaseURLs() removes the / at the of an absolute base path'); $helper->setBaseURLs(array('http://www1.example.com/', 'http://www2.example.com/')); $URLs = array(); for ($i = 0; $i < 20; $i++) { $URLs[] = $helper->getBaseURL($i); } $URLs = array_values(array_unique($URLs)); sort($URLs); $this->assertEquals(array('http://www1.example.com', 'http://www2.example.com'), $URLs, '->getBaseURL() returns a random base URL if several are given'); $helper->setBaseURLs(''); $this->assertEquals('', $helper->getBaseURL(1), '->getBaseURL() returns an empty string if no base URL exist'); }