Skip to content

[Form] Hardened form type tests #21877

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

Merged
merged 1 commit into from
Mar 5, 2017
Merged

Conversation

HeahDude
Copy link
Contributor

@HeahDude HeahDude commented Mar 5, 2017

Q A
Branch? 2.7
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets ~
License MIT
Doc PR ~

This one the PRs to come targeting 2.7 needed to harden the code base before doing some changes in master.

It takes care of the form types tests part (even if some other tests will be added later, it will also be easier after it), and unlocks merging #21481.
It also back ports tests added in #18357 for the TextType.

Since it's very hard to merge branches when modifying tests because of BC, and making every test type extend the base type test would involve many function calls to get the tested type, the function getTestedType is no longer abstract and return a constant to override instead, it's much better for performance, I didn't change the call in the base type test to keep BC but I suggest to deprecate it in master. Even if those are tests I really think it is worth keeping BC here.

The constants also ease testing in the ecosystem of form related libraries that need to be compatible with Symfony 2.7 and 3. I think using "test" as both prefix and suffix on namespaces, classes and names of the constants should discourage using them in real application code. Since this is just about our test suite, I don't think this should be considered a feature, so tis change should be good for 2.7.

Two other PRs will follow to solve conflicts in 2.8 and 3.2.

I missed last month patches, I hope I won't this time :).

@fabpot
Copy link
Member

fabpot commented Mar 5, 2017

Thank you @HeahDude.

@fabpot fabpot merged commit 8cfc3e9 into symfony:2.7 Mar 5, 2017
fabpot added a commit that referenced this pull request Mar 5, 2017
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Hardened form type tests

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

This one the PRs to come targeting 2.7 needed to harden the code base before doing some changes in master.

It takes care of the form types tests part (even if some other tests will be added later, it will also be easier after it), and unlocks merging #21481.
It also back ports tests added in #18357 for the TextType.

Since it's very hard to merge branches when modifying tests because of BC, and making every test type extend the base type test would involve many function calls to get the tested type, the function `getTestedType` is no longer abstract and return a constant to override instead, it's much better for performance, I didn't change the call in the base type test to keep BC but I suggest to deprecate it in master. Even if those are tests I really think it is worth keeping BC here.

The constants also ease testing in the ecosystem of form related libraries that need to be compatible with Symfony 2.7 and 3. I think using "test" as both prefix and suffix on namespaces, classes and names of the constants should discourage using them in real application code. Since this is just about our test suite, I don't think this should be considered a feature, so tis change should be good for 2.7.

Two other PRs will follow to solve conflicts in 2.8 and 3.2.

I missed last month patches, I hope I won't this time :).

Commits
-------

8cfc3e9 [Form] Hardened form type tests
@HeahDude
Copy link
Contributor Author

HeahDude commented Mar 5, 2017

Thank you for merging.

@HeahDude HeahDude deleted the test/submit-null branch March 5, 2017 17:39
HeahDude added a commit to HeahDude/symfony that referenced this pull request Mar 5, 2017
fabpot added a commit that referenced this pull request Mar 5, 2017
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed typo in a test after #21877

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Reviewing the diff on GitHub, I realized I've missed some typos in a new test of #21877. Sorry!

Commits
-------

b21a097 [Form] Fixed typo in a test after #21877
fabpot added a commit that referenced this pull request Mar 5, 2017
* 2.7:
  [Form] backport DependencyInjectionExtension tests
  [Form] Fixed typo in a test after #21877
fabpot added a commit that referenced this pull request Mar 5, 2017
* 2.8:
  [Form] backport DependencyInjectionExtension tests
  [Form] Fixed typo in a test after #21877
fabpot added a commit that referenced this pull request Mar 5, 2017
* 3.2:
  [Form] backport DependencyInjectionExtension tests
  [Form] Fixed typo in a test after #21877
nicolas-grekas added a commit that referenced this pull request Nov 11, 2018
This PR was merged into the 2.8 branch.

Discussion
----------

[Form] Hardened test suite for empty data

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #
| License       | MIT
| Doc PR        | ~

Finally the continuation of #21877, giving some more love to 2.8 before it is not maintained anymore <3.

Commits
-------

b0dab62 [Form] Hardened test suite for empty data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants