/** * testWithUserInfo * * @return void */ public function testWithUserInfo() { // User $uri = new PsrUri('https://*****:*****@local.example.com:3001/foo?bar=baz#quz'); $new = $uri->withUserInfo('flower'); $this->assertNotSame($uri, $new); $this->assertEquals('flower', $new->getUserInfo()); $this->assertEquals('https://flower@local.example.com:3001/foo?bar=baz#quz', (string) $new); // User & Password $uri = new PsrUri('https://*****:*****@local.example.com:3001/foo?bar=baz#quz'); $new = $uri->withUserInfo('flower', 'sakura'); $this->assertNotSame($uri, $new); $this->assertEquals('flower:sakura', $new->getUserInfo()); $this->assertEquals('https://*****:*****@local.example.com:3001/foo?bar=baz#quz', (string) $new); }