public function testFragment() { $this->uri->initializeWithURL('http://localhost:8080/a/b/c#my-fragment'); $this->assertSame('my-fragment', $this->uri->fragment()); $this->uri->initializeWithURL('http://localhost:8080/a/b/c'); $this->uri->fragment('something-new'); $this->assertSame('something-new', $this->uri->fragment()); }