| @@ 71-83 (lines=13) @@ | ||
| 68 | $this->assertEmpty($buttonView->vars['label_translation_arguments']); |
|
| 69 | } |
|
| 70 | ||
| 71 | public function testLabelPrefix() |
|
| 72 | { |
|
| 73 | $form = $this->factory |
|
| 74 | ->createBuilder(FormType::class, null, ['label_prefix' => $labelPrefix = 'prefix']) |
|
| 75 | ->add($buttonName = 'button', ButtonType::class) |
|
| 76 | ->getForm(); |
|
| 77 | ||
| 78 | $view = $form->createView(); |
|
| 79 | $buttonView = $view->children[$buttonName]; |
|
| 80 | ||
| 81 | $this->assertArrayHasKey('label', $buttonView->vars); |
|
| 82 | $this->assertSame($labelPrefix.'.'.$buttonName, $buttonView->vars['label']); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testLabelTranslationArguments() |
|
| 86 | { |
|
| @@ 71-83 (lines=13) @@ | ||
| 68 | $this->assertEmpty($buttonView->vars['label_translation_arguments']); |
|
| 69 | } |
|
| 70 | ||
| 71 | public function testLabelPrefix() |
|
| 72 | { |
|
| 73 | $form = $this->factory |
|
| 74 | ->createBuilder(FormType::class, null, ['label_prefix' => $labelPrefix = 'prefix']) |
|
| 75 | ->add($fieldName = 'field') |
|
| 76 | ->getForm(); |
|
| 77 | ||
| 78 | $view = $form->createView(); |
|
| 79 | $fieldView = $view->children[$fieldName]; |
|
| 80 | ||
| 81 | $this->assertArrayHasKey('label', $fieldView->vars); |
|
| 82 | $this->assertSame($labelPrefix.'.'.$fieldName, $fieldView->vars['label']); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testEmbedLabelPrefix() |
|
| 86 | { |
|