| @@ 18-25 (lines=8) @@ | ||
| 15 | ||
| 16 | class TranslationFilterTest extends BaseTwigVisitorTest |
|
| 17 | { |
|
| 18 | public function testExtract() |
|
| 19 | { |
|
| 20 | $collection = $this->getSourceLocations(new TranslationFilter(), 'Twig/TranslationFilter/trans.html.twig'); |
|
| 21 | ||
| 22 | $this->assertCount(1, $collection); |
|
| 23 | $source = $collection->first(); |
|
| 24 | $this->assertEquals('foobar', $source->getMessage()); |
|
| 25 | } |
|
| 26 | } |
|
| 27 | ||
| @@ 36-43 (lines=8) @@ | ||
| 33 | $this->assertEquals('messages', $source->getContext()['domain']); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function testTranschoice() |
|
| 37 | { |
|
| 38 | $collection = $this->getSourceLocations(new TranslationBlock(), 'Twig/TranslationBlock/transchoice.html.twig'); |
|
| 39 | ||
| 40 | $this->assertCount(1, $collection); |
|
| 41 | $source = $collection->first(); |
|
| 42 | $this->assertEquals('foobar', $source->getMessage()); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| @@ 37-44 (lines=8) @@ | ||
| 34 | return $collection; |
|
| 35 | } |
|
| 36 | ||
| 37 | public function testExtractLang() |
|
| 38 | { |
|
| 39 | $collection = $this->getSourceLocations('Blade/lang.blade.php'); |
|
| 40 | ||
| 41 | $this->assertCount(1, $collection); |
|
| 42 | $source = $collection->first(); |
|
| 43 | $this->assertEquals('foo.bar', $source->getMessage()); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function testExtractTrans() |
|
| 47 | { |
|
| @@ 46-53 (lines=8) @@ | ||
| 43 | $this->assertEquals('foo.bar', $source->getMessage()); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function testExtractTrans() |
|
| 47 | { |
|
| 48 | $collection = $this->getSourceLocations('Blade/trans.blade.php'); |
|
| 49 | ||
| 50 | $this->assertCount(1, $collection); |
|
| 51 | $source = $collection->first(); |
|
| 52 | $this->assertEquals('foo.bar', $source->getMessage()); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testExtractTransChoice() |
|
| 56 | { |
|
| @@ 55-62 (lines=8) @@ | ||
| 52 | $this->assertEquals('foo.bar', $source->getMessage()); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testExtractTransChoice() |
|
| 56 | { |
|
| 57 | $collection = $this->getSourceLocations('Blade/trans_choice.blade.php'); |
|
| 58 | ||
| 59 | $this->assertCount(1, $collection); |
|
| 60 | $source = $collection->first(); |
|
| 61 | $this->assertEquals('foo.bar', $source->getMessage()); |
|
| 62 | } |
|
| 63 | } |
|
| 64 | ||