1
0
Fork 0
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:
Jordi Boggiano 2016-01-22 19:09:44 +00:00
parent ddd140fd1c
commit 837fa805ec
2 changed files with 39 additions and 24 deletions

View file

@ -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