withHost() public method

public withHost ( $host )
示例#1
0
文件: UriTest.php 项目: phly/http
 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);
 }
示例#2
0
 /**
  * @group 48
  */
 public function testWithHostReturnsSameInstanceWhenHostDoesNotChange()
 {
     $uri = new Uri('http://*****:*****@example.com');
     $test = $uri->withHost('example.com');
     $this->assertSame($uri, $test);
 }