Merge "Enable APISandbox code on mobile"
[lhc/web/wiklou.git] / tests / phpunit / includes / libs / composer / ComposerLockTest.php
1 <?php
2
3 class ComposerLockTest extends MediaWikiTestCase {
4
5 private $lock;
6
7 public function setUp() {
8 parent::setUp();
9 global $IP;
10 $this->lock = "$IP/tests/phpunit/data/composer/composer.lock";
11 }
12
13 /**
14 * @covers ComposerLock::getHash
15 */
16 public function testGetHash() {
17 $lock = new ComposerLock( $this->lock );
18 $this->assertEquals( 'a3bb80b0ac4c4a31e52574d48c032923', $lock->getHash() );
19 }
20
21 /**
22 * @covers ComposerLock::__construct
23 * @covers ComposerLock::getInstalledDependencies
24 */
25 public function testGetInstalledDependencies() {
26 $lock = new ComposerLock( $this->lock );
27 $this->assertArrayEquals( [
28 'wikimedia/cdb' => [
29 'version' => '1.0.1',
30 'type' => 'library',
31 'licenses' => [ 'GPL-2.0' ],
32 'authors' => [
33 [
34 'name' => 'Tim Starling',
35 'email' => 'tstarling@wikimedia.org',
36 ],
37 [
38 'name' => 'Chad Horohoe',
39 'email' => 'chad@wikimedia.org',
40 ],
41 ],
42 'description' => 'Constant Database (CDB) wrapper library for PHP. '.
43 'Provides pure-PHP fallback when dba_* functions are absent.',
44 ],
45 'cssjanus/cssjanus' => [
46 'version' => '1.1.1',
47 'type' => 'library',
48 'licenses' => [ 'Apache-2.0' ],
49 'authors' => [],
50 'description' => 'Convert CSS stylesheets between left-to-right and right-to-left.',
51 ],
52 'leafo/lessphp' => [
53 'version' => '0.5.0',
54 'type' => 'library',
55 'licenses' => [ 'MIT', 'GPL-3.0' ],
56 'authors' => [
57 [
58 'name' => 'Leaf Corcoran',
59 'email' => 'leafot@gmail.com',
60 'homepage' => 'http://leafo.net',
61 ],
62 ],
63 'description' => 'lessphp is a compiler for LESS written in PHP.',
64 ],
65 'psr/log' => [
66 'version' => '1.0.0',
67 'type' => 'library',
68 'licenses' => [ 'MIT' ],
69 'authors' => [
70 [
71 'name' => 'PHP-FIG',
72 'homepage' => 'http://www.php-fig.org/',
73 ],
74 ],
75 'description' => 'Common interface for logging libraries',
76 ],
77 'oojs/oojs-ui' => [
78 'version' => '0.6.0',
79 'type' => 'library',
80 'licenses' => [ 'MIT' ],
81 'authors' => [],
82 'description' => '',
83 ],
84 'composer/installers' => [
85 'version' => '1.0.19',
86 'type' => 'composer-installer',
87 'licenses' => [ 'MIT' ],
88 'authors' => [
89 [
90 'name' => 'Kyle Robinson Young',
91 'email' => 'kyle@dontkry.com',
92 'homepage' => 'https://github.com/shama',
93 ],
94 ],
95 'description' => 'A multi-framework Composer library installer',
96 ],
97 'mediawiki/translate' => [
98 'version' => '2014.12',
99 'type' => 'mediawiki-extension',
100 'licenses' => [ 'GPL-2.0+' ],
101 'authors' => [
102 [
103 'name' => 'Niklas Laxström',
104 'email' => 'niklas.laxstrom@gmail.com',
105 'role' => 'Lead nitpicker',
106 ],
107 [
108 'name' => 'Siebrand Mazeland',
109 'email' => 's.mazeland@xs4all.nl',
110 'role' => 'Developer',
111 ],
112 ],
113 'description' => 'The only standard solution to translate any kind ' .
114 'of text with an avant-garde web interface within MediaWiki, ' .
115 'including your documentation and software',
116 ],
117 'mediawiki/universal-language-selector' => [
118 'version' => '2014.12',
119 'type' => 'mediawiki-extension',
120 'licenses' => [ 'GPL-2.0+', 'MIT' ],
121 'authors' => [],
122 'description' => 'The primary aim is to allow users to select a language ' .
123 'and configure its support in an easy way. ' .
124 'Main features are language selection, input methods and web fonts.',
125 ],
126 ], $lock->getInstalledDependencies(), false, true );
127 }
128
129 }