This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/DomCrawler
Fabien Potencier f06a35b974 feature #31959 [DomCrawler][Feature][DX] Add Form::getName() method (JustBlackBird)
This PR was squashed before being merged into the 4.4 branch (closes #31959).

Discussion
----------

[DomCrawler][Feature][DX] Add Form::getName() method

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | None
| License       | MIT
| Doc PR        | symfony/symfony-docs#11705

The PR adds `Symfony\Component\DomCrawler\Form::getName` method.

The method is actually a syntax sugar but can improve DX when dealing with tests. For example, in the snippet

```php
$client = static::createClient();
$crawler = $client->request('GET', '/post/hello-world');
$form = $crawler->selectButton('submit')->form();

$form['my_form[name]'] = 'Fabien';
$form['my_form[subject]'] = 'Symfony rocks!';
```
the prefix in field name (`my_form`) is form name, which is generated by Symfony automatically. The method, added in the PR helps to get that name in a most obvious way.

Commits
-------

ff53cb462a [DomCrawler][Feature][DX] Add Form::getName() method
2019-06-14 07:15:47 +02:00
..
Field Merge branch '3.4' into 4.2 2019-02-23 16:17:42 +01:00
Test/Constraint fixed CS 2019-06-13 13:03:18 +02:00
Tests [DomCrawler][Feature][DX] Add Form::getName() method 2019-06-14 07:15:39 +02:00
.gitignore Added missing files .gitignore 2013-07-21 14:12:18 +02:00
AbstractUriElement.php fixed CS 2019-01-16 21:35:37 +01:00
CHANGELOG.md [DomCrawler][Feature][DX] Add Form::getName() method 2019-06-14 07:15:39 +02:00
composer.json Allow Symfony 5.0 2019-05-28 17:53:17 +02:00
Crawler.php fixed CS 2019-06-13 13:03:18 +02:00
Form.php [DomCrawler][Feature][DX] Add Form::getName() method 2019-06-14 07:15:39 +02:00
FormFieldRegistry.php Apply php-cs-fixer rule for array_key_exists() 2019-02-23 16:06:07 +01:00
Image.php [DomCrawler] Allow using non-absolute base URIs 2018-08-02 11:30:11 +02:00
LICENSE update year in license files 2019-01-01 14:45:19 +01:00
Link.php Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
phpunit.xml.dist Bump phpunit XSD version to 5.2 2018-11-11 12:18:13 +01:00
README.md Updated all the README files 2016-03-04 08:12:06 +01:00

DomCrawler Component

The DomCrawler component eases DOM navigation for HTML and XML documents.

Resources