More updates to stop using dev or alpha or beta versions.
[yaffs-website] / vendor / composer / installers / tests / Composer / Installers / Test / VgmcpInstallerTest.php
1 <?php
2 namespace Composer\Installers\Test;
3
4 use Composer\Installers\VgmcpInstaller;
5 use Composer\Package\Package;
6 use Composer\Composer;
7 use PHPUnit\Framework\TestCase as BaseTestCase;
8
9 class VgmcpInstallerTest extends BaseTestCase
10 {
11     /**
12      * @var VgmcpInstaller
13      */
14     private $installer;
15
16     public function setUp()
17     {
18         $this->installer = new VgmcpInstaller(
19             new Package('NyanCat', '4.2', '4.2'),
20             new Composer()
21         );
22     }
23
24     /**
25      * @dataProvider packageNameInflectionProvider
26      */
27     public function testInflectPackageVars($type, $name, $expected)
28     {
29         $this->assertEquals(
30             array('name' => $expected, 'type' => $type),
31             $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32         );
33     }
34
35     public function packageNameInflectionProvider()
36     {
37         return array(
38             // Should keep bundle name StudlyCase
39             array(
40                 'vgmcp-bundle',
41                 'user-profile',
42                 'UserProfile'
43             ),
44             array(
45                 'vgmcp-bundle',
46                 'vgmcp-bundle',
47                 'Vgmcp'
48             ),
49             array(
50                 'vgmcp-bundle',
51                 'blog',
52                 'Blog'
53             ),
54             // tests that exactly one '-bundle' is cut off
55             array(
56                 'vgmcp-bundle',
57                 'some-bundle-bundle',
58                 'SomeBundle',
59             ),
60             // tests that exactly one '-theme' is cut off
61             array(
62                 'vgmcp-theme',
63                 'some-theme-theme',
64                 'SomeTheme',
65             ),
66             // tests that names without '-theme' suffix stay valid
67             array(
68                 'vgmcp-theme',
69                 'someothertheme',
70                 'Someothertheme',
71             ),
72             // Should keep theme name StudlyCase
73             array(
74                 'vgmcp-theme',
75                 'adminlte-advanced',
76                 'AdminlteAdvanced'
77             ),
78         );
79     }
80 }