MediaWiki  1.34.0
ReaderFactoryTest.php
Go to the documentation of this file.
1 <?php
8 namespace LocalisationUpdate;
9 
13 class 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/i18n/fi.json',
28  'LocalisationUpdate\JSONReader',
29  'core json file',
30  ],
31  [
32  'extension/Translate/i18n/core/de.json',
33  'LocalisationUpdate\JSONReader',
34  'extension json file',
35  ],
36  ];
37  }
38 }
LocalisationUpdate
Definition: Fetcher.php:8
LocalisationUpdate\ReaderFactory
Constructs readers for files based on the names.
Definition: ReaderFactory.php:13
LocalisationUpdate\ReaderFactoryTest
@covers \LocalisationUpdate\ReaderFactory
Definition: ReaderFactoryTest.php:13
LocalisationUpdate\ReaderFactoryTest\testGetReader
testGetReader( $input, $expected, $comment)
@dataProvider getReaderProvider
Definition: ReaderFactoryTest.php:17
LocalisationUpdate\ReaderFactoryTest\getReaderProvider
getReaderProvider()
Definition: ReaderFactoryTest.php:24