Fix test
parent
dc7b46a0cb
commit
12d63b0a35
|
@ -148,13 +148,18 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase
|
||||||
public function testCaptureAuthenticationParamsFromUrl()
|
public function testCaptureAuthenticationParamsFromUrl()
|
||||||
{
|
{
|
||||||
$io = $this->getMock('Composer\IO\IOInterface');
|
$io = $this->getMock('Composer\IO\IOInterface');
|
||||||
$io
|
$io->expects($this->once())
|
||||||
->expects($this->once())
|
|
||||||
->method('setAuthentication')
|
->method('setAuthentication')
|
||||||
;
|
->with($this->equalTo('example.com'), $this->equalTo('user'), $this->equalTo('pass'));
|
||||||
|
|
||||||
$fs = new RemoteFilesystem($io);
|
$fs = new RemoteFilesystem($io);
|
||||||
|
try {
|
||||||
$fs->getContents('example.com', 'http://user:pass@www.example.com/something');
|
$fs->getContents('example.com', 'http://user:pass@www.example.com/something');
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->assertInstanceOf('Composer\Downloader\TransportException', $e);
|
||||||
|
$this->assertEquals(404, $e->getCode());
|
||||||
|
$this->assertContains('404 Not Found', $e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetContents()
|
public function testGetContents()
|
||||||
|
|
Loading…
Reference in New Issue