MediaWiki  1.28.0
ComposerLockTest.php
Go to the documentation of this file.
1 <?php
2 
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 
17  public function testGetInstalledDependencies() {
18  $lock = new ComposerLock( $this->lock );
19  $this->assertArrayEquals( [
20  'wikimedia/cdb' => [
21  'version' => '1.0.1',
22  'type' => 'library',
23  'licenses' => [ 'GPL-2.0' ],
24  'authors' => [
25  [
26  'name' => 'Tim Starling',
27  'email' => 'tstarling@wikimedia.org',
28  ],
29  [
30  'name' => 'Chad Horohoe',
31  'email' => 'chad@wikimedia.org',
32  ],
33  ],
34  'description' => 'Constant Database (CDB) wrapper library for PHP. '.
35  'Provides pure-PHP fallback when dba_* functions are absent.',
36  ],
37  'cssjanus/cssjanus' => [
38  'version' => '1.1.1',
39  'type' => 'library',
40  'licenses' => [ 'Apache-2.0' ],
41  'authors' => [],
42  'description' => 'Convert CSS stylesheets between left-to-right and right-to-left.',
43  ],
44  'leafo/lessphp' => [
45  'version' => '0.5.0',
46  'type' => 'library',
47  'licenses' => [ 'MIT', 'GPL-3.0' ],
48  'authors' => [
49  [
50  'name' => 'Leaf Corcoran',
51  'email' => 'leafot@gmail.com',
52  'homepage' => 'http://leafo.net',
53  ],
54  ],
55  'description' => 'lessphp is a compiler for LESS written in PHP.',
56  ],
57  'psr/log' => [
58  'version' => '1.0.0',
59  'type' => 'library',
60  'licenses' => [ 'MIT' ],
61  'authors' => [
62  [
63  'name' => 'PHP-FIG',
64  'homepage' => 'http://www.php-fig.org/',
65  ],
66  ],
67  'description' => 'Common interface for logging libraries',
68  ],
69  'oojs/oojs-ui' => [
70  'version' => '0.6.0',
71  'type' => 'library',
72  'licenses' => [ 'MIT' ],
73  'authors' => [],
74  'description' => '',
75  ],
76  'composer/installers' => [
77  'version' => '1.0.19',
78  'type' => 'composer-installer',
79  'licenses' => [ 'MIT' ],
80  'authors' => [
81  [
82  'name' => 'Kyle Robinson Young',
83  'email' => 'kyle@dontkry.com',
84  'homepage' => 'https://github.com/shama',
85  ],
86  ],
87  'description' => 'A multi-framework Composer library installer',
88  ],
89  'mediawiki/translate' => [
90  'version' => '2014.12',
91  'type' => 'mediawiki-extension',
92  'licenses' => [ 'GPL-2.0+' ],
93  'authors' => [
94  [
95  'name' => 'Niklas Laxström',
96  'email' => 'niklas.laxstrom@gmail.com',
97  'role' => 'Lead nitpicker',
98  ],
99  [
100  'name' => 'Siebrand Mazeland',
101  'email' => 's.mazeland@xs4all.nl',
102  'role' => 'Developer',
103  ],
104  ],
105  'description' => 'The only standard solution to translate any kind ' .
106  'of text with an avant-garde web interface within MediaWiki, ' .
107  'including your documentation and software',
108  ],
109  'mediawiki/universal-language-selector' => [
110  'version' => '2014.12',
111  'type' => 'mediawiki-extension',
112  'licenses' => [ 'GPL-2.0+', 'MIT' ],
113  'authors' => [],
114  'description' => 'The primary aim is to allow users to select a language ' .
115  'and configure its support in an easy way. ' .
116  'Main features are language selection, input methods and web fonts.',
117  ],
118  ], $lock->getInstalledDependencies(), false, true );
119  }
120 
121 }
$IP
Definition: WebStart.php:58
assertArrayEquals(array $expected, array $actual, $ordered=false, $named=false)
Assert that two arrays are equal.
testGetInstalledDependencies()
ComposerLock::__construct ComposerLock::getInstalledDependencies.
when a variable name is used in a it is silently declared as a new local masking the global
Definition: design.txt:93
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
Definition: hooks.txt:1936
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
Reads a composer.lock file and provides accessors to get its hash and what is installed.
Definition: ComposerLock.php:9