composer = new Composer(); } /** * @param string $vars * @param string $expectedVars * * @covers ::inflectPackageVars * * @dataProvider provideExpectedInflectionResults */ final public function testInflectPackageVars($vars, $expectedVars) { $this->installer = new BitrixInstaller( new Package($vars['name'], '4.2', '4.2'), $this->composer ); $actual = $this->installer->inflectPackageVars($vars); $this->assertEquals($actual, $expectedVars); } /** * Provides various parameters for packages and the expected result after inflection * * @return array */ final public function provideExpectedInflectionResults() { return array( //check bitrix-dir is correct array( array('name' => 'Nyan/Cat'), array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix') ), array( array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix'), array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix') ), array( array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local'), array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local') ), ); } }