From 12d63b0a3558b71fc418e196e78614a42ab34eb9 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 31 Jul 2013 14:40:38 +0200 Subject: [PATCH] Fix test --- tests/Composer/Test/Util/RemoteFilesystemTest.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/Composer/Test/Util/RemoteFilesystemTest.php b/tests/Composer/Test/Util/RemoteFilesystemTest.php index 4c841555c..eb8ebc07e 100644 --- a/tests/Composer/Test/Util/RemoteFilesystemTest.php +++ b/tests/Composer/Test/Util/RemoteFilesystemTest.php @@ -148,13 +148,18 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase public function testCaptureAuthenticationParamsFromUrl() { $io = $this->getMock('Composer\IO\IOInterface'); - $io - ->expects($this->once()) - ->method('setAuthentication') - ; + $io->expects($this->once()) + ->method('setAuthentication') + ->with($this->equalTo('example.com'), $this->equalTo('user'), $this->equalTo('pass')); $fs = new RemoteFilesystem($io); - $fs->getContents('example.com', 'http://user:pass@www.example.com/something'); + try { + $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()