diff --git a/tests/FixtureApp/Resources/translations/test_icu+intl-icu.en.yml b/tests/FixtureApp/Resources/translations/test_icu+intl-icu.en.yml new file mode 100644 index 0000000..9f8a633 --- /dev/null +++ b/tests/FixtureApp/Resources/translations/test_icu+intl-icu.en.yml @@ -0,0 +1,2 @@ +first: This is the first message. +second: This is the second message. diff --git a/tests/FixtureApp/Resources/translations/test_icu+intl-icu.fr.yml b/tests/FixtureApp/Resources/translations/test_icu+intl-icu.fr.yml new file mode 100644 index 0000000..b03232c --- /dev/null +++ b/tests/FixtureApp/Resources/translations/test_icu+intl-icu.fr.yml @@ -0,0 +1,2 @@ +first: Ceci est le premier message. +second: Ceci est le second message. diff --git a/tests/FunctionalTest.php b/tests/FunctionalTest.php index 4d1b0dc..065667b 100644 --- a/tests/FunctionalTest.php +++ b/tests/FunctionalTest.php @@ -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(