1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 00:53:06 +00:00

Merge branch '2.2' into main

This commit is contained in:
Jordi Boggiano 2022-02-04 16:31:14 +01:00
commit 3446091027
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
28 changed files with 255 additions and 163 deletions

View file

@ -200,6 +200,36 @@ class ComposerRepositoryTest extends TestCase
);
}
public function testSearchWithSpecialChars()
{
$repoConfig = array(
'url' => 'http://example.org',
);
$result = array(
'results' => array(
array(
'name' => 'foo',
'description' => null,
),
),
);
$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();
$repository = new ComposerRepository($repoConfig, new NullIO, FactoryMock::createConfig(), $httpDownloader, $eventDispatcher);
$this->assertEmpty(
$repository->search('foo bar', RepositoryInterface::SEARCH_FULLTEXT)
);
}
public function testSearchWithAbandonedPackages()
{
$repoConfig = array(