Skip to content

[DX] [Form] Add helper method to register form extensions during unit testing #21780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/Symfony/Component/Form/Test/FormIntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,29 @@ protected function setUp()
{
$this->factory = Forms::createFormFactoryBuilder()
->addExtensions($this->getExtensions())
->addTypeExtensions($this->getTypedExtensions())
->addTypes($this->getTypes())
->addTypeGuessers($this->getTypeGuessers())
->getFormFactory();
}

protected function getExtensions()
{
return array();
}

protected function getTypedExtensions()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the method should IMO be named getTypeExtensions()

{
return array();
}

protected function getTypes()
{
return array();
}

protected function getTypeGuessers()
{
return array();
}
}