| Total Complexity | 8 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class FunctionalTest extends KernelTestCase |
||
| 12 | { |
||
| 13 | public static function setUpBeforeClass() |
||
| 16 | } |
||
| 17 | |||
| 18 | public static function tearDownAfterClass() |
||
| 19 | { |
||
| 20 | self::deleteTmpDir(); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @dataProvider provideComparisonCases |
||
| 25 | */ |
||
| 26 | public function testCompareCommand($locale, $valid) |
||
| 27 | { |
||
| 28 | self::bootKernel(); |
||
| 29 | |||
| 30 | $application = new Application(self::$kernel); |
||
| 31 | $application->setAutoExit(false); |
||
| 32 | $application->setCatchExceptions(false); |
||
| 33 | |||
| 34 | $input = new ArrayInput(array('command' => 'incenteev:translation:compare', 'locale' => $locale, '-d' => array('test'))); |
||
| 35 | $output = new NullOutput(); |
||
| 36 | |||
| 37 | $expectedExitCode = $valid ? 0 : 1; |
||
| 38 | |||
| 39 | $this->assertSame($expectedExitCode, $application->run($input, $output)); |
||
| 40 | } |
||
| 41 | |||
| 42 | public static function provideComparisonCases() |
||
| 43 | { |
||
| 44 | return array( |
||
| 45 | array('fr', true), |
||
| 46 | array('de', false), |
||
| 47 | ); |
||
| 48 | } |
||
| 49 | |||
| 50 | protected static function getKernelClass() |
||
| 51 | { |
||
| 52 | return 'Incenteev\TranslationCheckerBundle\Tests\FixtureApp\TestKernel'; |
||
| 53 | } |
||
| 54 | |||
| 55 | private static function deleteTmpDir() |
||
| 63 | } |
||
| 64 | } |
||
| 65 |