| @@ 19-27 (lines=9) @@ | ||
| 16 | ||
| 17 | final class DescriptionTest extends BasePHPVisitorTest |
|
| 18 | { |
|
| 19 | public function testExtract() |
|
| 20 | { |
|
| 21 | $collection = $this->getSourceLocations(new FormTypeLabelExplicit(), DescriptionType::class); |
|
| 22 | ||
| 23 | $this->assertCount(1, $collection); |
|
| 24 | $source = $collection->first(); |
|
| 25 | $this->assertEquals('test_label', $source->getMessage()); |
|
| 26 | $this->assertEquals('Foobar:', $source->getContext()['desc']); |
|
| 27 | } |
|
| 28 | } |
|
| 29 | ||
| @@ 30-38 (lines=9) @@ | ||
| 27 | $this->assertEquals('foobar', $source->getMessage()); |
|
| 28 | } |
|
| 29 | ||
| 30 | public function testDescExtract() |
|
| 31 | { |
|
| 32 | $collection = $this->getSourceLocations(TwigVisitorFactory::create(), 'Twig/TranslationFilter/desc.html.twig'); |
|
| 33 | ||
| 34 | $this->assertCount(1, $collection); |
|
| 35 | $source = $collection->first(); |
|
| 36 | $this->assertEquals('foobar', $source->getMessage()); |
|
| 37 | $this->assertEquals('baz', $source->getContext()['desc']); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testDescExtractError() |
|
| 41 | { |
|