From: daniel Date: Fri, 20 Apr 2012 19:44:21 +0000 (+0200) Subject: test ContentHandler::getForTitle() X-Git-Tag: 1.31.0-rc.0~22097^2^2~229 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=2e8e6be0aad032aab34ca664703849a3bc041c85;p=lhc%2Fweb%2Fwiklou.git test ContentHandler::getForTitle() --- 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;