private function getLoadedConfig($url) { $aetherUrl = new AetherUrlParser(); $aetherUrl->parse($url); $conf = $this->getConfig(); $conf->matchUrl($aetherUrl); return $conf; }
public function testParser() { $url = 'http://aether.raymond.raw.no/foobar/hello?foo'; $parser = new AetherUrlParser(); $parser->parse($url); $this->assertEquals($parser->get('scheme'), 'http'); $user = $parser->get('user'); $this->assertTrue(empty($user)); $url2 = 'ftp://*****:*****@hw.no/world?bar'; $parser = new AetherUrlParser(); $parser->parse($url2); $this->assertEquals($parser->get('scheme'), 'ftp'); $this->assertEquals($parser->get('user'), 'foo'); $this->assertEquals($parser->get('pass'), 'bar'); $this->assertEquals($parser->get('path'), '/world'); $this->assertEquals($parser->__toString(), preg_replace('/\\?.*/', '', $url2)); }
public function testMatchWithMinusInItWorks() { $aetherUrl = new AetherUrlParser(); $cat = "hifi-produkter"; $url = 'http://raw.no/unittest/' . $cat; $aetherUrl->parse($url); $conf = $this->getConfig(); $conf->matchUrl($aetherUrl); $this->assertEquals($conf->getUrlVariable('catName'), $cat); }