public function testWithHostReturnsNewInstanceWithProvidedHost() { $uri = new Uri('https://*****:*****@local.example.com:3001/foo?bar=baz#quz'); $new = $uri->withHost('framework.zend.com'); $this->assertNotSame($uri, $new); $this->assertEquals('framework.zend.com', $new->getHost()); $this->assertEquals('https://*****:*****@framework.zend.com:3001/foo?bar=baz#quz', (string) $new); }
/** * @group 48 */ public function testWithHostReturnsSameInstanceWhenHostDoesNotChange() { $uri = new Uri('http://*****:*****@example.com'); $test = $uri->withHost('example.com'); $this->assertSame($uri, $test); }