Chris@0: installer = new OctoberInstaller( Chris@0: new Package('NyanCat', '4.2', '4.2'), Chris@0: new Composer() Chris@0: ); Chris@0: } Chris@0: Chris@0: /** Chris@0: * @dataProvider packageNameInflectionProvider Chris@0: */ Chris@0: public function testInflectPackageVars($type, $name, $expected) Chris@0: { Chris@0: $this->assertEquals( Chris@0: $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)), Chris@0: array('name' => $expected, 'type' => $type) Chris@0: ); Chris@0: } Chris@0: Chris@0: public function packageNameInflectionProvider() Chris@0: { Chris@0: return array( Chris@0: array( Chris@0: 'october-plugin', Chris@0: 'subpagelist', Chris@0: 'subpagelist', Chris@0: ), Chris@0: array( Chris@0: 'october-plugin', Chris@0: 'subpagelist-plugin', Chris@0: 'subpagelist', Chris@0: ), Chris@0: array( Chris@0: 'october-plugin', Chris@0: 'semanticoctober', Chris@0: 'semanticoctober', Chris@0: ), Chris@0: // tests that exactly one '-theme' is cut off Chris@0: array( Chris@0: 'october-theme', Chris@0: 'some-theme-theme', Chris@0: 'some-theme', Chris@0: ), Chris@0: // tests that names without '-theme' suffix stay valid Chris@0: array( Chris@0: 'october-theme', Chris@0: 'someothertheme', Chris@0: 'someothertheme', Chris@0: ), Chris@0: ); Chris@0: } Chris@0: }