From 2e8e6be0aad032aab34ca664703849a3bc041c85 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 20 Apr 2012 21:44:21 +0200 Subject: [PATCH] test ContentHandler::getForTitle() --- tests/phpunit/includes/ContentHandlerTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/phpunit/includes/ContentHandlerTest.php b/tests/phpunit/includes/ContentHandlerTest.php index 9bc34cbc5d..6deed47d6b 100644 --- a/tests/phpunit/includes/ContentHandlerTest.php +++ b/tests/phpunit/includes/ContentHandlerTest.php @@ -29,6 +29,14 @@ class ContentHandlerTest extends MediaWikiTestCase { $title = Title::newFromText( $title ); $this->assertEquals( $expectedModelName, ContentHandler::getDefaultModelFor( $title ) ); } + /** + * @dataProvider dataGetDefaultModelFor + */ + public function testGetForTitle( $title, $expectedContentModel ) { + $title = Title::newFromText( $title ); + $handler = ContentHandler::getForTitle( $title ); + $this->assertEquals( $expectedContentModel, $handler->getModelName() ); + } public function testGetContentText_Null( ) { global $wgContentHandlerTextFallback; -- 2.20.1