MediaWiki REL1_33
MultiConfigTest.php
Go to the documentation of this file.
1<?php
2
4
11 public function testGet() {
12 $multi = new MultiConfig( [
13 new HashConfig( [ 'foo' => 'bar' ] ),
14 new HashConfig( [ 'foo' => 'baz', 'bar' => 'foo' ] ),
15 new HashConfig( [ 'bar' => 'baz' ] ),
16 ] );
17
18 $this->assertEquals( 'bar', $multi->get( 'foo' ) );
19 $this->assertEquals( 'foo', $multi->get( 'bar' ) );
20 $this->setExpectedException( ConfigException::class, 'MultiConfig::get: undefined option:' );
21 $multi->get( 'notset' );
22 }
23
27 public function testHas() {
28 $conf = new MultiConfig( [
29 new HashConfig( [ 'foo' => 'foo' ] ),
30 new HashConfig( [ 'something' => 'bleh' ] ),
31 new HashConfig( [ 'meh' => 'eh' ] ),
32 ] );
33
34 $this->assertTrue( $conf->has( 'foo' ) );
35 $this->assertTrue( $conf->has( 'something' ) );
36 $this->assertTrue( $conf->has( 'meh' ) );
37 $this->assertFalse( $conf->has( 'what' ) );
38 }
39}
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 and(2) offer you this license which gives you legal permission to copy
A Config instance which stores all settings as a member variable.
testHas()
MultiConfig::has.
testGet()
Tests that settings are fetched in the right order.
Provides a fallback sequence for Config objects.