MediaWiki  1.33.0
LicensesTest.php
Go to the documentation of this file.
1 <?php
2 
7 
8  public function testLicenses() {
9  $str = "
10 * Free licenses:
11 ** GFDL|Debian disagrees
12 ";
13 
14  $lc = new Licenses( [
15  'fieldname' => 'FooField',
16  'type' => 'select',
17  'section' => 'description',
18  'id' => 'wpLicense',
19  'label' => 'A label text', # Note can't test label-message because $wgOut is not defined
20  'name' => 'AnotherName',
21  'licenses' => $str,
22  ] );
23  $this->assertThat( $lc, $this->isInstanceOf( Licenses::class ) );
24  }
25 }
LicensesTest\testLicenses
testLicenses()
Definition: LicensesTest.php:8
Licenses
A License class for use on Special:Upload.
Definition: Licenses.php:31
php
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
name
and how to run hooks for an and one after Each event has a name
Definition: hooks.txt:6
MediaWikiTestCase
Definition: MediaWikiTestCase.php:17
licenses
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses
Definition: COPYING.txt:43
LicensesTest
Licenses.
Definition: LicensesTest.php:6