diff options
Diffstat (limited to 'www/wiki/extensions/LocalisationUpdate/tests/phpunit/reader/ReaderFactoryTest.php')
-rw-r--r-- | www/wiki/extensions/LocalisationUpdate/tests/phpunit/reader/ReaderFactoryTest.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/www/wiki/extensions/LocalisationUpdate/tests/phpunit/reader/ReaderFactoryTest.php b/www/wiki/extensions/LocalisationUpdate/tests/phpunit/reader/ReaderFactoryTest.php new file mode 100644 index 00000000..86776395 --- /dev/null +++ b/www/wiki/extensions/LocalisationUpdate/tests/phpunit/reader/ReaderFactoryTest.php @@ -0,0 +1,43 @@ +<?php +/** + * @file + * @author Niklas Laxström + * @license GPL-2.0-or-later + */ + +namespace LocalisationUpdate; + +/** + * @covers \LocalisationUpdate\ReaderFactory + */ +class ReaderFactoryTest extends \PHPUnit\Framework\TestCase { + /** + * @dataProvider getReaderProvider + */ + public function testGetReader( $input, $expected, $comment ) { + $factory = new ReaderFactory(); + $reader = $factory->getReader( $input ); + $observed = get_class( $reader ); + $this->assertEquals( $expected, $observed, $comment ); + } + + public function getReaderProvider() { + return [ + [ + 'languages/messages/MessagesFi.php', + 'LocalisationUpdate\PHPReader', + 'core php file', + ], + [ + 'extensions/Translate/Translate.i18n.php', + 'LocalisationUpdate\PHPReader', + 'extension php file', + ], + [ + 'extension/Translate/i18n/core/de.json', + 'LocalisationUpdate\JSONReader', + 'extension json file', + ], + ]; + } +} |