Skip to content
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

[Testing] Explain how to add or remove data in a collection of forms #6427

Merged

Conversation

alexislefebvre
Copy link
Contributor

Q A
Doc fix? no
New docs? no
Applies to all (based on 2.3)
Fixed tickets -

I added a part that explain how to test a Collection of Forms.

@HeahDude
Copy link
Contributor

HeahDude commented Apr 2, 2016

Great, thanks!

@alexislefebvre alexislefebvre force-pushed the test-form-with-collection-2.3 branch from 37c7ce5 to b645f0e Compare April 2, 2016 18:28
@alexislefebvre alexislefebvre changed the title Tests: Explain how to add or remove data in a collection of forms [Testing] Explain how to add or remove data in a collection of forms Apr 2, 2016
@alexislefebvre
Copy link
Contributor Author

alexislefebvre commented Apr 20, 2016

Can someone please give an opinion on this PR? Thanks.

@@ -699,6 +699,48 @@ their type::
PHP format (it converts the keys with square brackets notation - e.g.
``my_form[subject]`` - to PHP arrays).

If you use a :doc:`Collection of Forms </cookbook/form/form_collections>`,
you can't add fields to an existing form with
``$form['task[tags][0][name]'] = 'foo';``, this results in an error
Copy link
Member

Choose a reason for hiding this comment

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

I think "this results in [...]" should start a new sentence.

@alexislefebvre alexislefebvre force-pushed the test-form-with-collection-2.3 branch from b645f0e to d820e77 Compare April 21, 2016 21:40
@alexislefebvre
Copy link
Contributor Author

@xabbuh Thanks, I followed your advice.

$this->assertEquals(2, $crawler->filter('ul.tags > li')->count());

Where ``task[tags][0][name]`` is the name of a field created
with Javascript.
Copy link
Member

Choose a reason for hiding this comment

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

JavaScript

@xabbuh
Copy link
Member

xabbuh commented Apr 23, 2016

@alexislefebvre I just left some really minor last comment (we can fix that during merging). Looks good so far. 👍

@alexislefebvre alexislefebvre force-pushed the test-form-with-collection-2.3 branch from d820e77 to 41276ff Compare April 23, 2016 14:25
@weaverryan weaverryan merged commit 41276ff into symfony:2.3 Apr 26, 2016
weaverryan added a commit that referenced this pull request Apr 26, 2016
…tion of forms (alexislefebvre)

This PR was merged into the 2.3 branch.

Discussion
----------

[Testing] Explain how to add or remove data in a collection of forms

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | no
| Applies to    | all (based on 2.3)
| Fixed tickets | -

I added a part that explain how to test a [*Collection of Forms*](http://symfony.com/doc/2.3/cookbook/form/form_collections.html).

Commits
-------

41276ff Tests: Explain how to add or remove data in a collection of forms
weaverryan added a commit that referenced this pull request Apr 26, 2016
@weaverryan
Copy link
Member

This is great - it would be very difficult to figure out :). Thanks @alexislefebvre!

@alexislefebvre
Copy link
Contributor Author

Thanks you all! :)

@alexislefebvre alexislefebvre deleted the test-form-with-collection-2.3 branch April 26, 2016 16:40
weaverryan added a commit that referenced this pull request Apr 26, 2016
* 2.3:
  [#6472] Updating description, after change
  Avoid confusion
  Added file paths
  Fixes and rewords
  Documented the config options of TwigBundle
  [#6427] Adding a header
  Tests: Explain how to add or remove data in a collection of forms
  Document constraint validator alias optional
weaverryan added a commit that referenced this pull request Apr 26, 2016
* 2.7:
  [#6472] Updating description, after change
  Avoid confusion
  Added file paths
  Fixes and rewords
  Documented the config options of TwigBundle
  [#6427] Adding a header
  Tests: Explain how to add or remove data in a collection of forms
  Document constraint validator alias optional
weaverryan added a commit that referenced this pull request Apr 26, 2016
* 2.8:
  [#6472] Updating description, after change
  Avoid confusion
  Added file paths
  Fixes and rewords
  Documented the config options of TwigBundle
  [#6427] Adding a header
  Tests: Explain how to add or remove data in a collection of forms
  Document constraint validator alias optional
weaverryan added a commit that referenced this pull request Apr 26, 2016
* 3.0:
  [#6472] Updating description, after change
  Avoid confusion
  Added file paths
  Fixes and rewords
  Documented the config options of TwigBundle
  [#6427] Adding a header
  Tests: Explain how to add or remove data in a collection of forms
  Document constraint validator alias optional
alexislefebvre added a commit to alexislefebvre/symfony-docs that referenced this pull request Apr 2, 2017
xabbuh added a commit that referenced this pull request Apr 8, 2017
This PR was merged into the 2.7 branch.

Discussion
----------

Testing: Fix typo from #6427

Fix typo introduced in #6427: `$this->request` → `$request`

Commits
-------

3a9a4f0 Testing: Fix typo from #6427
xabbuh added a commit that referenced this pull request Apr 9, 2017
* 2.7: (48 commits)
  docs: choice constraints reference
  [#7707] minor tweak
  Fixed code block under "Custom Messages"
  [#7744] fix XSD locations
  Minor XML codes fixes
  [#7686] tweak the example code
  [#7663] update the PHP example code
  Update hostname_pattern.rst
  Add missing ";"
  Use HTTP instead of http
  Fixed indentation in security.rst
  Be consistent on service name
  Fix missing /
  Fix trusted hosts example regular expressions
  fixup comment
  Testing: Fix typo from #6427
  Update apache_router.rst
  Update fortrabbit.rst
  Fix some YAML codes
  Add missing trailing comma & Fix foreach code
  ...
xabbuh added a commit that referenced this pull request Apr 13, 2017
* 2.8: (48 commits)
  docs: choice constraints reference
  [#7707] minor tweak
  Fixed code block under "Custom Messages"
  [#7744] fix XSD locations
  Minor XML codes fixes
  [#7686] tweak the example code
  [#7663] update the PHP example code
  Update hostname_pattern.rst
  Add missing ";"
  Use HTTP instead of http
  Fixed indentation in security.rst
  Be consistent on service name
  Fix missing /
  Fix trusted hosts example regular expressions
  fixup comment
  Testing: Fix typo from #6427
  Update apache_router.rst
  Update fortrabbit.rst
  Fix some YAML codes
  Add missing trailing comma & Fix foreach code
  ...
xabbuh added a commit that referenced this pull request Apr 13, 2017
* 3.2: (60 commits)
  docs: choice constraints reference
  [#7707] minor tweak
  Fixed code block under "Custom Messages"
  [#7744] fix XSD locations
  Minor XML codes fixes
  [#7686] tweak the example code
  [#7663] update the PHP example code
  Update hostname_pattern.rst
  Add missing ";"
  Use HTTP instead of http
  Fixed indentation in security.rst
  Be consistent on service name
  Fix missing /
  typo fix
  Fix trusted hosts example regular expressions
  add reference built in listener for kernel.response event in >=3.1
  fixup comment
  Testing: Fix typo from #6427
  Update apache_router.rst
  Update fortrabbit.rst
  ...
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.

4 participants