annotate vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php @ 2:92f882872392
Trusted hosts, + remove migration modules
author |
Chris Cannam |
date |
Tue, 05 Dec 2017 09:26:43 +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\OctoberInstaller;
|
Chris@0
|
5 use Composer\Package\Package;
|
Chris@0
|
6 use Composer\Composer;
|
Chris@0
|
7
|
Chris@0
|
8 class OctoberInstallerTest extends \PHPUnit_Framework_TestCase
|
Chris@0
|
9 {
|
Chris@0
|
10 /**
|
Chris@0
|
11 * @var OctoberInstaller
|
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 OctoberInstaller(
|
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 $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)),
|
Chris@0
|
30 array('name' => $expected, '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 array(
|
Chris@0
|
38 'october-plugin',
|
Chris@0
|
39 'subpagelist',
|
Chris@0
|
40 'subpagelist',
|
Chris@0
|
41 ),
|
Chris@0
|
42 array(
|
Chris@0
|
43 'october-plugin',
|
Chris@0
|
44 'subpagelist-plugin',
|
Chris@0
|
45 'subpagelist',
|
Chris@0
|
46 ),
|
Chris@0
|
47 array(
|
Chris@0
|
48 'october-plugin',
|
Chris@0
|
49 'semanticoctober',
|
Chris@0
|
50 'semanticoctober',
|
Chris@0
|
51 ),
|
Chris@0
|
52 // tests that exactly one '-theme' is cut off
|
Chris@0
|
53 array(
|
Chris@0
|
54 'october-theme',
|
Chris@0
|
55 'some-theme-theme',
|
Chris@0
|
56 'some-theme',
|
Chris@0
|
57 ),
|
Chris@0
|
58 // tests that names without '-theme' suffix stay valid
|
Chris@0
|
59 array(
|
Chris@0
|
60 'october-theme',
|
Chris@0
|
61 'someothertheme',
|
Chris@0
|
62 'someothertheme',
|
Chris@0
|
63 ),
|
Chris@0
|
64 );
|
Chris@0
|
65 }
|
Chris@0
|
66 } |