withUserInfo() public method

public withUserInfo ( $user, $password = null )
Exemplo n.º 1
0
 public function testWithUserInfoReturnsNewInstanceWithProvidedUserAndPassword()
 {
     $uri = new Uri('https://*****:*****@local.example.com:3001/foo?bar=baz#quz');
     $new = $uri->withUserInfo('matthew', 'zf2');
     $this->assertNotSame($uri, $new);
     $this->assertEquals('matthew:zf2', $new->getUserInfo());
     $this->assertEquals('https://*****:*****@local.example.com:3001/foo?bar=baz#quz', (string) $new);
 }
Exemplo n.º 2
0
 /**
  * @group 48
  */
 public function testWithUserInfoReturnsSameInstanceWhenUserInfoDoesNotChange()
 {
     $uri = new Uri('http://*****:*****@example.com');
     $test = $uri->withUserInfo('me', 'too');
     $this->assertSame($uri, $test);
 }