public function testDomainAndPath() { $url = new Url('http://example.com/'); $this->assertEquals('example.com', $url->getDomain()); $this->assertEquals('', $url->getPath()); $url = new Url('http://example.com/Test'); $this->assertEquals('example.com', $url->getDomain()); $this->assertEquals('Test', $url->getPath()); $url = new Url('http://example.com/Second/Test/?a=asfd'); $this->assertEquals('example.com', $url->getDomain()); $this->assertEquals('Second/Test/?a=asfd', $url->getPath()); $this->assertEquals(false, $url->isRouted()); }
public function testTargetPathAndParams() { return false; $this->insertFixtures(); $lang = 1; $url = new Url('http://example.com/testpage1/testpage1_child/?foo=test'); $resolver = new Resolver($url, $lang, self::$em, '', $this->mockFallbackLanguages); $resolver->resolve(); $this->assertEquals('testpage1/testpage1_child/', $url->getTargetPath()); $this->assertEquals('?foo=test', $url->getParams()); $this->assertEquals(true, $url->isRouted()); }