Skip to content

Commit

Permalink
fix tests for PHP 5
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl committed Jan 31, 2022
1 parent 0694cfb commit 9327f4e
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions tests/Composer/Test/Repository/ComposerRepositoryTest.php
Expand Up @@ -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)
Expand Down

0 comments on commit 9327f4e

Please sign in to comment.