summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/libs/composer/ComposerLockTest.php
blob: cac3b10145827e192b1fc98b1c311c8165c83c9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php

class ComposerLockTest extends MediaWikiTestCase {

	private $lock;

	public function setUp() {
		parent::setUp();
		global $IP;
		$this->lock = "$IP/tests/phpunit/data/composer/composer.lock";
	}

	/**
	 * @covers ComposerLock::getHash
	 */
	public function testGetHash() {
		$lock = new ComposerLock( $this->lock );
		$this->assertEquals( 'a3bb80b0ac4c4a31e52574d48c032923', $lock->getHash() );
	}

	/**
	 * @covers ComposerLock::getInstalledDependencies
	 */
	public function testGetInstalledDependencies() {
		$lock = new ComposerLock( $this->lock );
		$this->assertArrayEquals( array(
			'wikimedia/cdb' => array(
				'version' => '1.0.1',
				'type' => 'library',
				'licenses' => array( 'GPL-2.0' ),
				'authors' => array(
					array(
						'name' => 'Tim Starling',
						'email' => 'tstarling@wikimedia.org',
					),
					array(
						'name' => 'Chad Horohoe',
						'email' => 'chad@wikimedia.org',
					),
				),
				'description' => 'Constant Database (CDB) wrapper library for PHP. Provides pure-PHP fallback when dba_* functions are absent.',
			),
			'cssjanus/cssjanus' => array(
				'version' => '1.1.1',
				'type' => 'library',
				'licenses' => array( 'Apache-2.0' ),
				'authors' => array(),
				'description' => 'Convert CSS stylesheets between left-to-right and right-to-left.',
			),
			'leafo/lessphp' => array(
				'version' => '0.5.0',
				'type' => 'library',
				'licenses' => array( 'MIT', 'GPL-3.0' ),
				'authors' => array(
					array(
						'name' => 'Leaf Corcoran',
						'email' => 'leafot@gmail.com',
						'homepage' => 'http://leafo.net',
					),
				),
				'description' => 'lessphp is a compiler for LESS written in PHP.',
			),
			'psr/log' => array(
				'version' => '1.0.0',
				'type' => 'library',
				'licenses' => array( 'MIT' ),
				'authors' => array(
					array(
						'name' => 'PHP-FIG',
						'homepage' => 'http://www.php-fig.org/',
					),
				),
				'description' => 'Common interface for logging libraries',
			),
			'oojs/oojs-ui' => array(
				'version' => '0.6.0',
				'type' => 'library',
				'licenses' => array( 'MIT' ),
				'authors' => array(),
				'description' => '',
			),
			'composer/installers' => array(
				'version' => '1.0.19',
				'type' => 'composer-installer',
				'licenses' => array( 'MIT' ),
				'authors' => array(
					array(
						'name' => 'Kyle Robinson Young',
						'email' => 'kyle@dontkry.com',
						'homepage' => 'https://github.com/shama',
					),
				),
				'description' => 'A multi-framework Composer library installer',
			),
			'mediawiki/translate' => array(
				'version' => '2014.12',
				'type' => 'mediawiki-extension',
				'licenses' => array( 'GPL-2.0+' ),
				'authors' => array(
					array(
						'name' => 'Niklas Laxström',
						'email' => 'niklas.laxstrom@gmail.com',
						'role' => 'Lead nitpicker',
					),
					array(
						'name' => 'Siebrand Mazeland',
						'email' => 's.mazeland@xs4all.nl',
						'role' => 'Developer',
					),
				),
				'description' => 'The only standard solution to translate any kind of text with an avant-garde web interface within MediaWiki, including your documentation and software',
			),
			'mediawiki/universal-language-selector' => array(
				'version' => '2014.12',
				'type' => 'mediawiki-extension',
				'licenses' => array( 'GPL-2.0+', 'MIT' ),
				'authors' => array(),
				'description' => 'The primary aim is to allow users to select a language and configure its support in an easy way. Main features are language selection, input methods and web fonts.',
			),
		), $lock->getInstalledDependencies(), false, true );
	}

}