|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
* This file is part of the Sonata Project package. |
|
7
|
|
|
* |
|
8
|
|
|
* (c) Thomas Rabaix <[email protected]> |
|
9
|
|
|
* |
|
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
11
|
|
|
* file that was distributed with this source code. |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
namespace Sonata\AdminBundle\Tests\Functional\Translator\Extractor; |
|
15
|
|
|
|
|
16
|
|
|
use Sonata\AdminBundle\Tests\App\AppKernel; |
|
17
|
|
|
use Symfony\Bundle\FrameworkBundle\Console\Application; |
|
18
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; |
|
19
|
|
|
use Symfony\Component\Console\Tester\CommandTester; |
|
20
|
|
|
|
|
21
|
|
|
final class AdminExtractorTest extends KernelTestCase |
|
22
|
|
|
{ |
|
23
|
|
|
public function testDebugMissingMessages(): void |
|
24
|
|
|
{ |
|
25
|
|
|
$tester = $this->createCommandTester(); |
|
26
|
|
|
$tester->execute(['locale' => 'en']); |
|
27
|
|
|
|
|
28
|
|
|
$this->assertRegExp('/group_label/', $tester->getDisplay()); |
|
29
|
|
|
$this->assertRegExp('/admin_label/', $tester->getDisplay()); |
|
30
|
|
|
$this->assertRegExp('/Name Show/', $tester->getDisplay()); |
|
31
|
|
|
$this->assertRegExp('/Name List/', $tester->getDisplay()); |
|
32
|
|
|
$this->assertRegExp('/Name Form/', $tester->getDisplay()); |
|
33
|
|
|
$this->assertRegExp('/Date Published/', $tester->getDisplay()); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
protected static function getKernelClass(): string |
|
37
|
|
|
{ |
|
38
|
|
|
return AppKernel::class; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
private function createCommandTester(): CommandTester |
|
42
|
|
|
{ |
|
43
|
|
|
$kernel = static::createKernel(); |
|
44
|
|
|
$application = new Application($kernel); |
|
45
|
|
|
|
|
46
|
|
|
return new CommandTester($application->find('debug:translation')); |
|
47
|
|
|
} |
|
48
|
|
|
} |
|
49
|
|
|
|