Mercurial > hg > isophonics-drupal-site
comparison vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.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\OctoberInstaller; | |
5 use Composer\Package\Package; | |
6 use Composer\Composer; | |
7 | |
8 class OctoberInstallerTest extends \PHPUnit_Framework_TestCase | |
9 { | |
10 /** | |
11 * @var OctoberInstaller | |
12 */ | |
13 private $installer; | |
14 | |
15 public function setUp() | |
16 { | |
17 $this->installer = new OctoberInstaller( | |
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 $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)), | |
30 array('name' => $expected, 'type' => $type) | |
31 ); | |
32 } | |
33 | |
34 public function packageNameInflectionProvider() | |
35 { | |
36 return array( | |
37 array( | |
38 'october-plugin', | |
39 'subpagelist', | |
40 'subpagelist', | |
41 ), | |
42 array( | |
43 'october-plugin', | |
44 'subpagelist-plugin', | |
45 'subpagelist', | |
46 ), | |
47 array( | |
48 'october-plugin', | |
49 'semanticoctober', | |
50 'semanticoctober', | |
51 ), | |
52 // tests that exactly one '-theme' is cut off | |
53 array( | |
54 'october-theme', | |
55 'some-theme-theme', | |
56 'some-theme', | |
57 ), | |
58 // tests that names without '-theme' suffix stay valid | |
59 array( | |
60 'october-theme', | |
61 'someothertheme', | |
62 'someothertheme', | |
63 ), | |
64 ); | |
65 } | |
66 } |