+ /**
+ * @dataProvider dataGetLocalizedNameName
+ */
+ public function testGetLocalizedName( $id, $expected ) {
+ try{
+ $name = ContentHandler::getLocalizedName( $id );
+
+ if ( !$expected ) $this->fail("should not have a name for content id #$id");
+
+ $this->assertNotNull( $name, "no name found for content model #$id" );
+ $this->assertTrue( preg_match( $expected, $name ) > 0 , "content model name for #$id did not match pattern $expected" );
+ } catch (MWException $e) {
+ if ( $expected ) $this->fail("failed to get name for content id #$id");
+ }
+ }
+
+ public function dataGetContentModelName() {
+ return array(
+ array( 0, null ),
+ array( null, null ),
+ array( 99887766, null ),
+
+ array( CONTENT_MODEL_JAVASCRIPT, 'javascript' ),
+ );
+ }
+