You are here

public function FormTest::testHas 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::testHas()

File

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

Class

FormTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testHas() {
  $form = $this
    ->createForm('<form method="post"><input type="text" name="bar" value="bar" /><input type="submit" /></form>');
  $this
    ->assertFalse($form
    ->has('foo'), '->has() returns false if a field is not in the form');
  $this
    ->assertTrue($form
    ->has('bar'), '->has() returns true if a field is in the form');
}