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