Add 3D filetype for STL files
[lhc/web/wiklou.git] / tests / phpunit / includes / config / MultiConfigTest.php
1 <?php
2
3 class MultiConfigTest extends MediaWikiTestCase {
4
5 /**
6 * Tests that settings are fetched in the right order
7 *
8 * @covers MultiConfig::get
9 */
10 public function testGet() {
11 $multi = new MultiConfig( [
12 new HashConfig( [ 'foo' => 'bar' ] ),
13 new HashConfig( [ 'foo' => 'baz', 'bar' => 'foo' ] ),
14 new HashConfig( [ 'bar' => 'baz' ] ),
15 ] );
16
17 $this->assertEquals( 'bar', $multi->get( 'foo' ) );
18 $this->assertEquals( 'foo', $multi->get( 'bar' ) );
19 $this->setExpectedException( 'ConfigException', 'MultiConfig::get: undefined option:' );
20 $multi->get( 'notset' );
21 }
22
23 /**
24 * @covers MultiConfig::has
25 */
26 public function testHas() {
27 $conf = new MultiConfig( [
28 new HashConfig( [ 'foo' => 'foo' ] ),
29 new HashConfig( [ 'something' => 'bleh' ] ),
30 new HashConfig( [ 'meh' => 'eh' ] ),
31 ] );
32
33 $this->assertTrue( $conf->has( 'foo' ) );
34 $this->assertTrue( $conf->has( 'something' ) );
35 $this->assertTrue( $conf->has( 'meh' ) );
36 $this->assertFalse( $conf->has( 'what' ) );
37 }
38 }