mirror of
https://github.com/composer/composer
synced 2025-05-09 08:32:56 +00:00
Code tweaks, refs #4124
This commit is contained in:
parent
ddd140fd1c
commit
837fa805ec
2 changed files with 39 additions and 24 deletions
|
@ -350,7 +350,7 @@ class PluginInstallerTest extends TestCase
|
|||
|
||||
/**
|
||||
* @dataProvider invalidImplementationClassNames
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedException \UnexpectedValueException
|
||||
*/
|
||||
public function testQueryingWithInvalidCapabilityClassNameThrows($invalidImplementationClassNames)
|
||||
{
|
||||
|
@ -368,6 +368,22 @@ class PluginInstallerTest extends TestCase
|
|||
$this->pm->getPluginCapability($plugin, $capabilityApi);
|
||||
}
|
||||
|
||||
public function testQueryingNonProvidedCapabilityReturnsNullSafely()
|
||||
{
|
||||
$capabilityApi = 'Composer\Plugin\Capability\MadeUpCapability';
|
||||
|
||||
$plugin = $this->getMockBuilder('Composer\Test\Plugin\Mock\CapablePluginInterface')
|
||||
->getMock();
|
||||
|
||||
$plugin->expects($this->once())
|
||||
->method('getCapabilities')
|
||||
->will($this->returnCallback(function() {
|
||||
return array();
|
||||
}));
|
||||
|
||||
$this->assertNull($this->pm->getPluginCapability($plugin, $capabilityApi));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider nonExistingOrInvalidImplementationClassTypes
|
||||
* @expectedException \RuntimeException
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue