withHost() 공개 메소드

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
파일: UriTest.php 프로젝트: easySuite/ding2
 /**
  * @group 48
  */
 public function testWithHostReturnsSameInstanceWhenHostDoesNotChange()
 {
     $uri = new Uri('http://*****:*****@example.com');
     $test = $uri->withHost('example.com');
     $this->assertSame($uri, $test);
 }