Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add docs to register custom form extensions and types for unit testing#7578

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
pierredup wants to merge3 commits intosymfony:masterfrompierredup:forms-testing

Conversation

@pierredup
Copy link
Contributor

@pierreduppierredup commentedMar 6, 2017
edited
Loading

Docs forsymfony/symfony#21780 to register custom extensions and types

If your forms uses the ``invalid_message`` or ``constraints`` option for validation, you need to
register the validation extension which provides this options.
Luckily Symfony provides a custom test class which does this for you.
In order to have this option registered, your test needs to extend from the
Copy link
Contributor

Choose a reason for hiding this comment

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

to extend the .. class would be better, no ? (Without from)

}

Forms Using Validation
------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

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

please keep the underline as long as the title

}

It is also possible to load custom form types, form type extensions or type guessers using the
``getTypedExtensions``, ``getTypes`` and ``getTypeGuessers`` methods.
Copy link
Member

Choose a reason for hiding this comment

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

This should be part of a separate pull request as we will have to merge it into themaster branch (the rest can be merged into the docs for Symfony 2.7).

HeahDude and roman-1983 reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

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

One thing I forgot: Can you also add aversionadded directive that mentions the introduction of the new methods?

fabpot added a commit to symfony/symfony that referenced this pull requestMar 6, 2017
…ons 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#7578Add helper method to register form extensions during unit testing, so it's easier to register custom form type extensions, form types, or type guessersCommits-------bab562a [DX] [Form] Add helper method to register form extensions during unit testing
symfony-splitter pushed a commit to symfony/form that referenced this pull requestMar 6, 2017
…ons 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#7578Add helper method to register form extensions during unit testing, so it's easier to register custom form type extensions, form types, or type guessersCommits-------bab562a987 [DX] [Form] Add helper method to register form extensions during unit testing
Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

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

Thanks for that PR! Can you please separate the changes as@xabbuh asked?

Forms Using Validation
----------------------

If your forms uses the ``invalid_message`` or ``constraints`` option for validation, you need to
Copy link
Contributor

Choose a reason for hiding this comment

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

It should either beIf your form uses orIf your forms use.

----------------------

If your forms uses the ``invalid_message`` or ``constraints`` option for validation, you need to
register the validation extension which provides this options.
Copy link
Contributor

Choose a reason for hiding this comment

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

this =>these


If your forms uses the ``invalid_message`` or ``constraints`` option for validation, you need to
register the validation extension which provides this options.
Luckily Symfony provides a custom test class which does this for you.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggestLuckily Symfony provides a base test class which takes care of it, just extend [class].

And get rid of the following sentence, what do you think?

:class:`Symfony\\Component\\Form\\Tests\\Extension\\Validator\\Type\\TypeTestCase`
class::

// tests/AppBundle/Form/Type/TestedTypeTests.php
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the lasts inTestedTypeTest.php.

@pierredup
Copy link
ContributorAuthor

pierredup commentedMar 7, 2017
edited
Loading

I created a separate PR for 2.7#7587.

When that is merged, it should squash this diff to only leave the sentence for the new methods addedsymfony/symfony#21780 (I'll just resolve any conflicts there might be after that PR is merged)

HeahDude reacted with thumbs up emoji

@pierreduppierredup changed the titleAdd docs about the validator TypeTestCase classAdd docs to register custom form extensions and types for unit testingMar 8, 2017
@pierredup
Copy link
ContributorAuthor

I removed the validator extension part in this docs, so it's not dependent on other changes, and can be merged to document the new methods added

``getTypedExtensions``, ``getTypes`` and ``getTypeGuessers`` methods.

..versionadded::3.3
The ``getTypedExtensions``, ``getTypes`` and ``getTypeGuessers`` was introduced in Symfony 3.3.
Copy link
Contributor

Choose a reason for hiding this comment

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

"The [...] methods were introduced [...]."

Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

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

👍

xabbuh added a commit that referenced this pull requestApr 15, 2017
@xabbuh
Copy link
Member

Thank you@pierredup. FYI, I have taken the proposed changes fromsymfony/symfony#22445 taken into account in68bcaa0.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh left review comments

@OskarStarkOskarStarkOskarStark approved these changes

+3 more reviewers

@atailoulouteatailoulouteatailouloute left review comments

@roman-1983roman-1983roman-1983 approved these changes

@HeahDudeHeahDudeHeahDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@pierredup@xabbuh@OskarStark@roman-1983@HeahDude@atailouloute@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp