parent
c2a2198089
commit
1ba1463013
|
@ -249,6 +249,8 @@ class PluginInstallerTest extends TestCase
|
||||||
/**
|
/**
|
||||||
* @param string $newPluginApiVersion
|
* @param string $newPluginApiVersion
|
||||||
* @param CompletePackage[] $plugins
|
* @param CompletePackage[] $plugins
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function setPluginApiVersionWithPlugins($newPluginApiVersion, array $plugins = array())
|
private function setPluginApiVersionWithPlugins($newPluginApiVersion, array $plugins = array())
|
||||||
{
|
{
|
||||||
|
@ -351,7 +353,7 @@ class PluginInstallerTest extends TestCase
|
||||||
{
|
{
|
||||||
$plugin = $this->getMockBuilder('Composer\Plugin\PluginInterface')
|
$plugin = $this->getMockBuilder('Composer\Plugin\PluginInterface')
|
||||||
->getMock();
|
->getMock();
|
||||||
|
/** @phpstan-ignore-next-line */
|
||||||
$this->assertNull($this->pm->getPluginCapability($plugin, 'Fake\Ability'));
|
$this->assertNull($this->pm->getPluginCapability($plugin, 'Fake\Ability'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,6 +379,7 @@ class PluginInstallerTest extends TestCase
|
||||||
$this->assertSame(array('a' => 1, 'b' => 2, 'plugin' => $plugin), $capability->args);
|
$this->assertSame(array('a' => 1, 'b' => 2, 'plugin' => $plugin), $capability->args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return mixed[] */
|
||||||
public function invalidImplementationClassNames()
|
public function invalidImplementationClassNames()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
@ -391,6 +394,7 @@ class PluginInstallerTest extends TestCase
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return mixed[] */
|
||||||
public function nonExistingOrInvalidImplementationClassTypes()
|
public function nonExistingOrInvalidImplementationClassTypes()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
@ -401,6 +405,10 @@ class PluginInstallerTest extends TestCase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider invalidImplementationClassNames
|
* @dataProvider invalidImplementationClassNames
|
||||||
|
* @param callable $invalidImplementationClassNames
|
||||||
|
* @param string $expect
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testQueryingWithInvalidCapabilityClassNameThrows($invalidImplementationClassNames, $expect = 'UnexpectedValueException')
|
public function testQueryingWithInvalidCapabilityClassNameThrows($invalidImplementationClassNames, $expect = 'UnexpectedValueException')
|
||||||
{
|
{
|
||||||
|
@ -420,6 +428,7 @@ class PluginInstallerTest extends TestCase
|
||||||
$this->pm->getPluginCapability($plugin, $capabilityApi);
|
$this->pm->getPluginCapability($plugin, $capabilityApi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return void */
|
||||||
public function testQueryingNonProvidedCapabilityReturnsNullSafely()
|
public function testQueryingNonProvidedCapabilityReturnsNullSafely()
|
||||||
{
|
{
|
||||||
$capabilityApi = 'Composer\Plugin\Capability\MadeUpCapability';
|
$capabilityApi = 'Composer\Plugin\Capability\MadeUpCapability';
|
||||||
|
@ -433,11 +442,15 @@ class PluginInstallerTest extends TestCase
|
||||||
return array();
|
return array();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
/** @phpstan-ignore-next-line */
|
||||||
$this->assertNull($this->pm->getPluginCapability($plugin, $capabilityApi));
|
$this->assertNull($this->pm->getPluginCapability($plugin, $capabilityApi));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider nonExistingOrInvalidImplementationClassTypes
|
* @dataProvider nonExistingOrInvalidImplementationClassTypes
|
||||||
|
* @param callable $wrongImplementationClassTypes
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testQueryingWithNonExistingOrWrongCapabilityClassTypesThrows($wrongImplementationClassTypes)
|
public function testQueryingWithNonExistingOrWrongCapabilityClassTypesThrows($wrongImplementationClassTypes)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue