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); }
/** * @group 48 */ public function testWithUserInfoReturnsSameInstanceWhenUserInfoDoesNotChange() { $uri = new Uri('http://*****:*****@example.com'); $test = $uri->withUserInfo('me', 'too'); $this->assertSame($uri, $test); }