MediaWiki REL1_31
ReaderFactoryTest.php
Go to the documentation of this file.
1<?php
8namespace LocalisationUpdate;
9
13class ReaderFactoryTest extends \PHPUnit\Framework\TestCase {
17 public function testGetReader( $input, $expected, $comment ) {
18 $factory = new ReaderFactory();
19 $reader = $factory->getReader( $input );
20 $observed = get_class( $reader );
21 $this->assertEquals( $expected, $observed, $comment );
22 }
23
24 public function getReaderProvider() {
25 return [
26 [
27 'languages/messages/MessagesFi.php',
28 'LocalisationUpdate\PHPReader',
29 'core php file',
30 ],
31 [
32 'extensions/Translate/Translate.i18n.php',
33 'LocalisationUpdate\PHPReader',
34 'extension php file',
35 ],
36 [
37 'extension/Translate/i18n/core/de.json',
38 'LocalisationUpdate\JSONReader',
39 'extension json file',
40 ],
41 ];
42 }
43}
\LocalisationUpdate\ReaderFactory
testGetReader( $input, $expected, $comment)
getReaderProvider
Constructs readers for files based on the names.
if(is_array($mode)) switch( $mode) $input