You are here

public function FormTest::testConstructorLoadsOnlyFieldsOfTheRightForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/Tests/FormTest.php \Symfony\Component\DomCrawler\Tests\FormTest::testConstructorLoadsOnlyFieldsOfTheRightForm()

File

vendor/symfony/dom-crawler/Tests/FormTest.php, line 89

Class

FormTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testConstructorLoadsOnlyFieldsOfTheRightForm() {
  $dom = $this
    ->createTestMultipleForm();
  $nodes = $dom
    ->getElementsByTagName('form');
  $buttonElements = $dom
    ->getElementsByTagName('button');
  $form = new Form($nodes
    ->item(0), 'http://example.com');
  $this
    ->assertCount(3, $form
    ->all());
  $form = new Form($buttonElements
    ->item(1), 'http://example.com');
  $this
    ->assertCount(5, $form
    ->all());
}