Beispiel #1
0
 public function testBasename()
 {
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper')->init();
     $this->assertSame('ueper', $this->uri->basename());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper:xxx')->init();
     $this->assertSame('it', $this->uri->basename());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper:xxx/test:yyy')->init();
     $this->assertSame('it', $this->uri->basename());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper?test=x')->init();
     $this->assertSame('ueper', $this->uri->basename());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper?test=x&test2=y')->init();
     $this->assertSame('ueper', $this->uri->basename());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper?test=x&test2=y&test3=x&test4=y')->init();
     $this->assertSame('ueper', $this->uri->basename());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper?test=x&test2=y&test3=x&test4=y/test')->init();
     $this->assertSame('ueper', $this->uri->basename());
     $this->uri->initializeWithURL('http://localhost:8080/a/b/c/d')->init();
     $this->assertSame('d', $this->uri->basename());
     $this->uri->initializeWithURL('http://localhost:8080/a/b/c/d/e/f/a/b/c/d/e/f/a/b/c/d/e/f')->init();
     $this->assertSame('f', $this->uri->basename());
     $this->uri->initializeWithURL('http://localhost/')->init();
     $this->assertSame('', $this->uri->basename());
     $this->uri->initializeWithURL('http://localhost/test.xml')->init();
     $this->assertSame('test.xml', $this->uri->basename());
 }