Skip to content

Commit a87c51c

Browse files
committed
feature #21780 [DX] [Form] Add helper method to register form extensions during unit testing (pierredup)
This PR was squashed before being merged into the 3.3-dev branch (closes #21780). Discussion ---------- [DX] [Form] Add helper method to register form extensions during unit testing | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | symfony/symfony-docs#7578 Add helper method to register form extensions during unit testing, so it's easier to register custom form type extensions, form types, or type guessers Commits ------- bab562a987 [DX] [Form] Add helper method to register form extensions during unit testing
2 parents 0bd163c + 107b469 commit a87c51c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Test/FormIntegrationTestCase.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,29 @@ protected function setUp()
2929
{
3030
$this->factory = Forms::createFormFactoryBuilder()
3131
->addExtensions($this->getExtensions())
32+
->addTypeExtensions($this->getTypedExtensions())
33+
->addTypes($this->getTypes())
34+
->addTypeGuessers($this->getTypeGuessers())
3235
->getFormFactory();
3336
}
3437

3538
protected function getExtensions()
3639
{
3740
return array();
3841
}
42+
43+
protected function getTypedExtensions()
44+
{
45+
return array();
46+
}
47+
48+
protected function getTypes()
49+
{
50+
return array();
51+
}
52+
53+
protected function getTypeGuessers()
54+
{
55+
return array();
56+
}
3957
}

0 commit comments

Comments
 (0)