Mercurial > hg > isophonics-drupal-site
annotate vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php @ 7:848c88cfe644
More layout
author | Chris Cannam |
---|---|
date | Fri, 05 Jan 2018 13:59:44 +0000 |
parents | 4c8ae668cc8c |
children | 7a779792577d |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 namespace Composer\Installers\Test; |
Chris@0 | 3 |
Chris@0 | 4 use Composer\Installers\VgmcpInstaller; |
Chris@0 | 5 use Composer\Package\Package; |
Chris@0 | 6 use Composer\Composer; |
Chris@0 | 7 |
Chris@0 | 8 class VgmcpInstallerTest extends \PHPUnit_Framework_TestCase |
Chris@0 | 9 { |
Chris@0 | 10 /** |
Chris@0 | 11 * @var VgmcpInstaller |
Chris@0 | 12 */ |
Chris@0 | 13 private $installer; |
Chris@0 | 14 |
Chris@0 | 15 public function setUp() |
Chris@0 | 16 { |
Chris@0 | 17 $this->installer = new VgmcpInstaller( |
Chris@0 | 18 new Package('NyanCat', '4.2', '4.2'), |
Chris@0 | 19 new Composer() |
Chris@0 | 20 ); |
Chris@0 | 21 } |
Chris@0 | 22 |
Chris@0 | 23 /** |
Chris@0 | 24 * @dataProvider packageNameInflectionProvider |
Chris@0 | 25 */ |
Chris@0 | 26 public function testInflectPackageVars($type, $name, $expected) |
Chris@0 | 27 { |
Chris@0 | 28 $this->assertEquals( |
Chris@0 | 29 array('name' => $expected, 'type' => $type), |
Chris@0 | 30 $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)) |
Chris@0 | 31 ); |
Chris@0 | 32 } |
Chris@0 | 33 |
Chris@0 | 34 public function packageNameInflectionProvider() |
Chris@0 | 35 { |
Chris@0 | 36 return array( |
Chris@0 | 37 // Should keep bundle name StudlyCase |
Chris@0 | 38 array( |
Chris@0 | 39 'vgmcp-bundle', |
Chris@0 | 40 'user-profile', |
Chris@0 | 41 'UserProfile' |
Chris@0 | 42 ), |
Chris@0 | 43 array( |
Chris@0 | 44 'vgmcp-bundle', |
Chris@0 | 45 'vgmcp-bundle', |
Chris@0 | 46 'Vgmcp' |
Chris@0 | 47 ), |
Chris@0 | 48 array( |
Chris@0 | 49 'vgmcp-bundle', |
Chris@0 | 50 'blog', |
Chris@0 | 51 'Blog' |
Chris@0 | 52 ), |
Chris@0 | 53 // tests that exactly one '-bundle' is cut off |
Chris@0 | 54 array( |
Chris@0 | 55 'vgmcp-bundle', |
Chris@0 | 56 'some-bundle-bundle', |
Chris@0 | 57 'SomeBundle', |
Chris@0 | 58 ), |
Chris@0 | 59 // tests that exactly one '-theme' is cut off |
Chris@0 | 60 array( |
Chris@0 | 61 'vgmcp-theme', |
Chris@0 | 62 'some-theme-theme', |
Chris@0 | 63 'SomeTheme', |
Chris@0 | 64 ), |
Chris@0 | 65 // tests that names without '-theme' suffix stay valid |
Chris@0 | 66 array( |
Chris@0 | 67 'vgmcp-theme', |
Chris@0 | 68 'someothertheme', |
Chris@0 | 69 'Someothertheme', |
Chris@0 | 70 ), |
Chris@0 | 71 // Should keep theme name StudlyCase |
Chris@0 | 72 array( |
Chris@0 | 73 'vgmcp-theme', |
Chris@0 | 74 'adminlte-advanced', |
Chris@0 | 75 'AdminlteAdvanced' |
Chris@0 | 76 ), |
Chris@0 | 77 ); |
Chris@0 | 78 } |
Chris@0 | 79 } |