X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fcomposer%2Finstallers%2Ftests%2FComposer%2FInstallers%2FTest%2FMayaInstallerTest.php;fp=vendor%2Fcomposer%2Finstallers%2Ftests%2FComposer%2FInstallers%2FTest%2FMayaInstallerTest.php;h=f800c611627a2911992e06b19013dd1c7bf9e49d;hp=0000000000000000000000000000000000000000;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php b/vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php new file mode 100644 index 000000000..f800c6116 --- /dev/null +++ b/vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php @@ -0,0 +1,61 @@ +installer = new MayaInstaller( + new Package('NyanCat', '4.2', '4.2'), + new Composer() + ); + } + + /** + * @dataProvider packageNameInflectionProvider + */ + public function testInflectPackageVars($type, $name, $expected) + { + $this->assertEquals( + array('name' => $expected, 'type' => $type), + $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)) + ); + } + + public function packageNameInflectionProvider() + { + return array( + // Should keep module name StudlyCase + array( + 'maya-module', + 'user-profile', + 'UserProfile' + ), + array( + 'maya-module', + 'maya-module', + 'Maya' + ), + array( + 'maya-module', + 'blog', + 'Blog' + ), + // tests that exactly one '-module' is cut off + array( + 'maya-module', + 'some-module-module', + 'SomeModule', + ), + ); + } +}