Add tests for #8861
parent
a9affa8413
commit
537402f814
|
@ -1648,7 +1648,7 @@ EOF;
|
||||||
/**
|
/**
|
||||||
* @dataProvider platformCheckProvider
|
* @dataProvider platformCheckProvider
|
||||||
*/
|
*/
|
||||||
public function testGeneratesPlatformCheck(array $requires, $expectedFixture, array $provides = array(), array $replaces = array())
|
public function testGeneratesPlatformCheck(array $requires, $expectedFixture, array $provides = array(), array $replaces = array(), $ignorePlatformReqs = false)
|
||||||
{
|
{
|
||||||
$package = new Package('a', '1.0', '1.0');
|
$package = new Package('a', '1.0', '1.0');
|
||||||
$package->setRequires($requires);
|
$package->setRequires($requires);
|
||||||
|
@ -1665,6 +1665,7 @@ EOF;
|
||||||
->method('getCanonicalPackages')
|
->method('getCanonicalPackages')
|
||||||
->will($this->returnValue(array()));
|
->will($this->returnValue(array()));
|
||||||
|
|
||||||
|
$this->generator->setIgnorePlatformRequirements($ignorePlatformReqs);
|
||||||
$this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', true, '_1');
|
$this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', true, '_1');
|
||||||
|
|
||||||
if (null === $expectedFixture) {
|
if (null === $expectedFixture) {
|
||||||
|
@ -1714,6 +1715,29 @@ EOF;
|
||||||
),
|
),
|
||||||
'no_php_required'
|
'no_php_required'
|
||||||
),
|
),
|
||||||
|
'Ignoring all platform requirements skips check completely' => array(
|
||||||
|
array(
|
||||||
|
new Link('a', 'php', $versionParser->parseConstraints('^7.2')),
|
||||||
|
new Link('a', 'ext-xml', $versionParser->parseConstraints('*')),
|
||||||
|
new Link('a', 'ext-json', $versionParser->parseConstraints('*'))
|
||||||
|
),
|
||||||
|
null,
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
true
|
||||||
|
),
|
||||||
|
'Ignored platform requirements are not checked for' => array(
|
||||||
|
array(
|
||||||
|
new Link('a', 'php', $versionParser->parseConstraints('^7.2.8')),
|
||||||
|
new Link('a', 'ext-xml', $versionParser->parseConstraints('*')),
|
||||||
|
new Link('a', 'ext-json', $versionParser->parseConstraints('*')),
|
||||||
|
new Link('a', 'ext-pdo', $versionParser->parseConstraints('*'))
|
||||||
|
),
|
||||||
|
'no_php_required',
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
array('php', 'ext-pdo')
|
||||||
|
),
|
||||||
'No extensions required' => array(
|
'No extensions required' => array(
|
||||||
array(
|
array(
|
||||||
new Link('a', 'php', $versionParser->parseConstraints('^7.2')),
|
new Link('a', 'php', $versionParser->parseConstraints('^7.2')),
|
||||||
|
|
Loading…
Reference in New Issue