From 14f74d141ab5580688bfd46d2f74c026e43ed967 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 1 Apr 2015 06:11:44 +0200 Subject: Update to MediaWiki 1.24.2 --- tests/phpunit/includes/config/MultiConfigTest.php | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/phpunit/includes/config/MultiConfigTest.php (limited to 'tests/phpunit/includes/config/MultiConfigTest.php') diff --git a/tests/phpunit/includes/config/MultiConfigTest.php b/tests/phpunit/includes/config/MultiConfigTest.php new file mode 100644 index 00000000..158da466 --- /dev/null +++ b/tests/phpunit/includes/config/MultiConfigTest.php @@ -0,0 +1,38 @@ + 'bar' ) ), + new HashConfig( array( 'foo' => 'baz', 'bar' => 'foo' ) ), + new HashConfig( array( 'bar' => 'baz' ) ), + ) ); + + $this->assertEquals( 'bar', $multi->get( 'foo' ) ); + $this->assertEquals( 'foo', $multi->get( 'bar' ) ); + $this->setExpectedException( 'ConfigException', 'MultiConfig::get: undefined option:' ); + $multi->get( 'notset' ); + } + + /** + * @covers MultiConfig::has + */ + public function testHas() { + $conf = new MultiConfig( array( + new HashConfig( array( 'foo' => 'foo' ) ), + new HashConfig( array( 'something' => 'bleh' ) ), + new HashConfig( array( 'meh' => 'eh' ) ), + ) ); + + $this->assertTrue( $conf->has( 'foo' ) ); + $this->assertTrue( $conf->has( 'something' ) ); + $this->assertTrue( $conf->has( 'meh' ) ); + $this->assertFalse( $conf->has( 'what' ) ); + } +} -- cgit v1.2.3-54-g00ecf