diff --git a/tests/Composer/Test/Repository/ComposerRepositoryTest.php b/tests/Composer/Test/Repository/ComposerRepositoryTest.php index 39f916d121c0..ed5dbf93db03 100644 --- a/tests/Composer/Test/Repository/ComposerRepositoryTest.php +++ b/tests/Composer/Test/Repository/ComposerRepositoryTest.php @@ -217,21 +217,15 @@ public function testSearchWithSpecialChars() ), ); - $httpDownloader = $this->getHttpDownloaderMock(); - $httpDownloader->expects( - [ - ['url' => 'http://example.org/packages.json', 'body' => JsonFile::encode(array('search' => '/search.json?q=%query%&type=%type%'))], - ['url' => 'http://example.org/search.json?q=foo+bar&type=', 'body' => JsonFile::encode(array())], - ], - true - ); + $httpDownloader = new HttpDownloaderMock(array( + 'http://example.org/packages.json' => JsonFile::encode(array('search' => '/search.json?q=%query%&type=%type%')), + 'http://example.org/search.json?q=foo+bar&type=' => JsonFile::encode(array()), + )); $eventDispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher') ->disableOriginalConstructor() ->getMock(); - $config = FactoryMock::createConfig(); - $config->merge(['config' => ['cache-read-only' => true]]); - $repository = new ComposerRepository($repoConfig, new NullIO, $config, $httpDownloader, $eventDispatcher); + $repository = new ComposerRepository($repoConfig, new NullIO, FactoryMock::createConfig(), $httpDownloader, $eventDispatcher); $this->assertEmpty( $repository->search('foo bar', RepositoryInterface::SEARCH_FULLTEXT)