Exemple #1
0
 public function testPath()
 {
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper')->init();
     $this->assertSame('/grav/it/ueper', $this->uri->path());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper:xxx')->init();
     $this->assertSame('/grav/it', $this->uri->path());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper:xxx/test:yyy')->init();
     $this->assertSame('/grav/it', $this->uri->path());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper?test=x')->init();
     $this->assertSame('/grav/it/ueper', $this->uri->path());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper?test=x&test2=y')->init();
     $this->assertSame('/grav/it/ueper', $this->uri->path());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper?test=x&test2=y&test3=x&test4=y')->init();
     $this->assertSame('/grav/it/ueper', $this->uri->path());
     $this->uri->initializeWithURL('http://localhost:8080/grav/it/ueper?test=x&test2=y&test3=x&test4=y/test')->init();
     $this->assertSame('/grav/it/ueper', $this->uri->path());
     $this->uri->initializeWithURL('http://localhost:8080/a/b/c/d')->init();
     $this->assertSame('/a/b/c/d', $this->uri->path());
     $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('/a/b/c/d/e/f/a/b/c/d/e/f/a/b/c/d/e/f', $this->uri->path());
     $this->uri->initializeWithURL('http://localhost/')->init();
     $this->assertSame('/', $this->uri->path());
 }