public function testWithUserInfoWithUserAndPassword() { $uri = new Uri('ftp://*****:*****@local.example.com/readme.txt'); $new = $uri->withUserInfo('anonymous', '*****@*****.**'); $this->assertNotSame($uri, $new); $this->assertSame($new->getUserInfo(), 'anonymous:damon.easy.system@gmail.com'); $this->assertSame('ftp://*****:*****@gmail.com@local.example.com/readme.txt', (string) $new); }