public function supports($packageType)
{
$frameworkType = $this->findFrameworkType($packageType);
if ($frameworkType === false) {
return false;
}
$locationPattern = $this->getLocationPattern($frameworkType);
return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
}
/** * testSupports * * @return void * * @dataProvider dataForTestSupport */ public function testSupports($type, $expected) { $installer = new Installer($this->io, $this->composer); $this->assertSame($expected, $installer->supports($type), sprintf('Failed to show support for %s', $type)); }