Skip to content

Commit

Permalink
Add a test covering the usage of translation files in the ICU format
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Jan 16, 2024
1 parent e01331a commit 4788a04
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
first: This is the first message.
second: This is the second message.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
first: Ceci est le premier message.
second: Ceci est le second message.
19 changes: 19 additions & 0 deletions tests/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,25 @@ public function testCompareCommand(string $locale, bool $valid)
$this->assertSame($expectedExitCode, $application->run($input, $output));
}

/**
* @dataProvider provideComparisonCases
*/
public function testCompareCommandWithIcuTranslations(string $locale, bool $valid)
{
self::bootKernel();

$application = new Application(self::$kernel);
$application->setAutoExit(false);
$application->setCatchExceptions(false);

$input = new ArrayInput(array('command' => 'incenteev:translation:compare', 'locale' => $locale, '-d' => array('test_icu')));
$output = new NullOutput();

$expectedExitCode = $valid ? 0 : 1;

$this->assertSame($expectedExitCode, $application->run($input, $output));
}

public static function provideComparisonCases(): iterable
{
return array(
Expand Down

0 comments on commit 4788a04

Please sign in to comment.