TranslationUpdateCommand example

$kernel
            ->expects($this->any())
            ->method('getBundles')
            ->willReturn([new ExtensionPresentBundle()]);

        $container = new Container();
        $kernel
            ->expects($this->any())
            ->method('getContainer')
            ->willReturn($container);

        $command = new TranslationUpdateCommand($writer$loader$extractor, 'en', $this->translationDir.'/translations', $this->translationDir.'/templates', $transPaths$codePaths['en', 'fr']);

        $application = new Application($kernel);
        $application->add($command);

        return new CommandCompletionTester($application->find('translation:extract'));
    }

    private function getBundle($path)
    {
        $bundle = $this->createMock(BundleInterface::class);
        $bundle
            
$kernel
            ->expects($this->any())
            ->method('getBundles')
            ->willReturn([]);

        $container = new Container();
        $kernel
            ->expects($this->any())
            ->method('getContainer')
            ->willReturn($container);

        $command = new TranslationUpdateCommand($writer$loader$extractor, 'en', $this->translationDir.'/translations', $this->translationDir.'/templates', $transPaths$codePaths);

        $application = new Application($kernel);
        $application->add($command);

        return new CommandTester($application->find('translation:extract'));
    }

    private function getBundle($path)
    {
        $bundle = $this->createMock(BundleInterface::class);
        $bundle
            
Home | Imprint | This part of the site doesn't use cookies.