You are here

public function CrawlerTest::testSelectButton in Zircon Profile 8

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

File

vendor/symfony/dom-crawler/Tests/CrawlerTest.php, line 677

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testSelectButton() {
  $crawler = $this
    ->createTestCrawler();
  $this
    ->assertNotSame($crawler, $crawler
    ->selectButton('FooValue'), '->selectButton() returns a new instance of a crawler');
  $this
    ->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectButton() returns a new instance of a crawler');
  $this
    ->assertEquals(1, $crawler
    ->selectButton('FooValue')
    ->count(), '->selectButton() selects buttons');
  $this
    ->assertEquals(1, $crawler
    ->selectButton('FooName')
    ->count(), '->selectButton() selects buttons');
  $this
    ->assertEquals(1, $crawler
    ->selectButton('FooId')
    ->count(), '->selectButton() selects buttons');
  $this
    ->assertEquals(1, $crawler
    ->selectButton('BarValue')
    ->count(), '->selectButton() selects buttons');
  $this
    ->assertEquals(1, $crawler
    ->selectButton('BarName')
    ->count(), '->selectButton() selects buttons');
  $this
    ->assertEquals(1, $crawler
    ->selectButton('BarId')
    ->count(), '->selectButton() selects buttons');
  $this
    ->assertEquals(1, $crawler
    ->selectButton('FooBarValue')
    ->count(), '->selectButton() selects buttons with form attribute too');
  $this
    ->assertEquals(1, $crawler
    ->selectButton('FooBarName')
    ->count(), '->selectButton() selects buttons with form attribute too');
}