Skip to content

Commit cfde7a1

Browse files
committed
[Form] Improve test
1 parent c8316f4 commit cfde7a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Component/Form/Tests/Extension/Core/Type/EnumTypeTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
2121
use Symfony\Component\OptionsResolver\Exception\MissingOptionsException;
2222
use Symfony\Contracts\Translation\TranslatableInterface;
23+
use Symfony\Contracts\Translation\TranslatorInterface;
2324

2425
class EnumTypeTest extends BaseTypeTestCase
2526
{
@@ -269,8 +270,12 @@ public function testChoiceLabelTranslatable()
269270

270271
$view = $form->createView();
271272

272-
$this->assertInstanceOf(\UnitEnum::class, $view->children[0]->vars['label']);
273273
$this->assertInstanceOf(TranslatableInterface::class, $view->children[0]->vars['label']);
274+
275+
$translator = $this->createMock(TranslatorInterface::class);
276+
$translator->expects($this->once())->method('trans');
277+
278+
$view->children[0]->vars['label']->trans($translator);
274279
}
275280

276281
protected function getTestOptions(): array

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy