DtdFFSTest.php

Go to the documentation of this file.
00001 <?php
00012 class DtdFFSTest extends MediaWikiTestCase {
00013 
00014     protected $groupConfiguration = array(
00015         'BASIC' => array(
00016             'class' => 'FileBasedMessageGroup',
00017             'id' => 'test-id',
00018             'label' => 'Test Label',
00019             'namespace' => 'NS_MEDIAWIKI',
00020             'description' => 'Test description',
00021         ),
00022         'FILES' => array(
00023             'class' => 'DtdFFS',
00024         ),
00025     );
00026 
00027     public function testParsing() {
00028         $file =
00029             <<<DTD
00030             <!--
00031 # Messages for Interlingua (interlingua)
00032 # Exported from translatewiki.net
00033 
00034 # Author: McDutchie
00035 -->
00036 <!ENTITY okawix.title "Okawix &okawix.vernum; - Navigator de Wikipedia">
00037 <!ENTITY okawix.back
00038 "Retro">
00039 DTD;
00040 
00044         $group = MessageGroupBase::factory( $this->groupConfiguration );
00045         $ffs = new DtdFFS( $group );
00046         $parsed = $ffs->readFromVariable( $file );
00047         $expected = array(
00048             'okawix.title' => 'Okawix &okawix.vernum; - Navigator de Wikipedia',
00049             'okawix.back' => 'Retro',
00050         );
00051         $expected = array( 'MESSAGES' => $expected, 'AUTHORS' => array( 'McDutchie' ) );
00052         $this->assertEquals( $expected, $parsed );
00053     }
00054 }
Generated on Tue Oct 29 00:00:24 2013 for MediaWiki Translate Extension by  doxygen 1.6.3