isAbsolute() public method

Checks if the Url instance is absolute or not.
public isAbsolute ( ) : boolean
return boolean
Beispiel #1
0
 public function testRelativeUrl()
 {
     // test all resource parts
     $url = new Url('/path1/path2?x=1&y=2#frag');
     $this->assertFalse($url->isAbsolute());
     $this->assertEquals('/path1/path2?x=1&y=2#frag', (string) $url);
     // test base path
     $url = new Url('/path1');
     $this->assertEquals('/path1', (string) $url);
     // test minimal path
     $url = new Url('/');
     $this->assertEquals('/', (string) $url);
     // test feature request
     $url = new Url('/events');
     $url->query->set('param1', 'value1');
     $this->assertEquals('/events?param1=value1', (string) $url);
 }
Beispiel #2
0
 public function testIsAbsolute()
 {
     $url1 = new Url('http://jwage.com');
     $this->assertTrue($url1->isAbsolute());
     $url2 = new Url('/about/me');
     $this->assertFalse($url2->isAbsolute());
 }