|
|
@ -12,6 +12,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace Composer\Test\Repository;
|
|
|
|
namespace Composer\Test\Repository;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use Composer\Package\Link;
|
|
|
|
use Composer\Package\Package;
|
|
|
|
use Composer\Package\Package;
|
|
|
|
use Composer\Package\PackageInterface;
|
|
|
|
use Composer\Package\PackageInterface;
|
|
|
|
use Composer\Repository\PlatformRepository;
|
|
|
|
use Composer\Repository\PlatformRepository;
|
|
|
@ -35,7 +36,7 @@ class PlatformRepositoryTest extends TestCase
|
|
|
|
self::assertSame('2.1.0', $hhvm->getPrettyVersion());
|
|
|
|
self::assertSame('2.1.0', $hhvm->getPrettyVersion());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function getPhpFlavorTestCases()
|
|
|
|
public function providePhpFlavorTestCases()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
return array(
|
|
|
|
array(
|
|
|
|
array(
|
|
|
@ -112,7 +113,13 @@ class PlatformRepositoryTest extends TestCase
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** @dataProvider getPhpFlavorTestCases */
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @dataProvider providePhpFlavorTestCases
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param array<string, mixed> $constants
|
|
|
|
|
|
|
|
* @param array<string, string> $packages
|
|
|
|
|
|
|
|
* @param array<string, mixed> $functions
|
|
|
|
|
|
|
|
*/
|
|
|
|
public function testPhpVersion(array $constants, array $packages, array $functions = array())
|
|
|
|
public function testPhpVersion(array $constants, array $packages, array $functions = array())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$runtime = $this->getMockBuilder('Composer\Platform\Runtime')->getMock();
|
|
|
|
$runtime = $this->getMockBuilder('Composer\Platform\Runtime')->getMock();
|
|
|
@ -178,7 +185,7 @@ class PlatformRepositoryTest extends TestCase
|
|
|
|
self::assertNull($package);
|
|
|
|
self::assertNull($package);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static function getLibraryTestCases()
|
|
|
|
public static function provideLibraryTestCases()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
return array(
|
|
|
|
'amqp' => array(
|
|
|
|
'amqp' => array(
|
|
|
@ -1074,7 +1081,7 @@ Linked Version => 1.2.11',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @dataProvider getLibraryTestCases
|
|
|
|
* @dataProvider provideLibraryTestCases
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param string|string[] $extensions
|
|
|
|
* @param string|string[] $extensions
|
|
|
|
* @param string|null $info
|
|
|
|
* @param string|null $info
|
|
|
@ -1190,6 +1197,13 @@ Linked Version => 1.2.11',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @param string $context
|
|
|
|
|
|
|
|
* @param string[] $expectedLinks
|
|
|
|
|
|
|
|
* @param Link[] $links
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return void
|
|
|
|
|
|
|
|
*/
|
|
|
|
private function assertPackageLinks($context, array $expectedLinks, PackageInterface $sourcePackage, array $links)
|
|
|
|
private function assertPackageLinks($context, array $expectedLinks, PackageInterface $sourcePackage, array $links)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
self::assertCount(count($expectedLinks), $links, sprintf('%s: expected package count to match', $context));
|
|
|
|
self::assertCount(count($expectedLinks), $links, sprintf('%s: expected package count to match', $context));
|
|
|
@ -1206,6 +1220,13 @@ class ResourceBundleStub
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const STUB_VERSION = '32.0.1';
|
|
|
|
const STUB_VERSION = '32.0.1';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @param string $locale
|
|
|
|
|
|
|
|
* @param string $bundleName
|
|
|
|
|
|
|
|
* @param bool $fallback
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return ResourceBundleStub
|
|
|
|
|
|
|
|
*/
|
|
|
|
public static function create($locale, $bundleName, $fallback)
|
|
|
|
public static function create($locale, $bundleName, $fallback)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Assert::assertSame(3, func_num_args());
|
|
|
|
Assert::assertSame(3, func_num_args());
|
|
|
@ -1216,6 +1237,11 @@ class ResourceBundleStub
|
|
|
|
return new self();
|
|
|
|
return new self();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @param string|int $field
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return string
|
|
|
|
|
|
|
|
*/
|
|
|
|
public function get($field)
|
|
|
|
public function get($field)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Assert::assertSame(1, func_num_args());
|
|
|
|
Assert::assertSame(1, func_num_args());
|
|
|
@ -1227,13 +1253,23 @@ class ResourceBundleStub
|
|
|
|
|
|
|
|
|
|
|
|
class ImagickStub
|
|
|
|
class ImagickStub
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @var string
|
|
|
|
|
|
|
|
*/
|
|
|
|
private $versionString;
|
|
|
|
private $versionString;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @param string $versionString
|
|
|
|
|
|
|
|
*/
|
|
|
|
public function __construct($versionString)
|
|
|
|
public function __construct($versionString)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->versionString = $versionString;
|
|
|
|
$this->versionString = $versionString;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @return array<string, string>
|
|
|
|
|
|
|
|
* @phpstan-return array{versionString: string}
|
|
|
|
|
|
|
|
*/
|
|
|
|
public function getVersion()
|
|
|
|
public function getVersion()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Assert::assertSame(0, func_num_args());
|
|
|
|
Assert::assertSame(0, func_num_args());
|
|
|
|