You are here

public function CrawlerTest::testSelectLink 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::testSelectLink()

File

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

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testSelectLink() {
  $crawler = $this
    ->createTestCrawler();
  $this
    ->assertNotSame($crawler, $crawler
    ->selectLink('Foo'), '->selectLink() returns a new instance of a crawler');
  $this
    ->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectLink() returns a new instance of a crawler');
  $this
    ->assertCount(1, $crawler
    ->selectLink('Fabien\'s Foo'), '->selectLink() selects links by the node values');
  $this
    ->assertCount(1, $crawler
    ->selectLink('Fabien\'s Bar'), '->selectLink() selects links by the alt attribute of a clickable image');
  $this
    ->assertCount(2, $crawler
    ->selectLink('Fabien"s Foo'), '->selectLink() selects links by the node values');
  $this
    ->assertCount(2, $crawler
    ->selectLink('Fabien"s Bar'), '->selectLink() selects links by the alt attribute of a clickable image');
  $this
    ->assertCount(1, $crawler
    ->selectLink('\' Fabien"s Foo'), '->selectLink() selects links by the node values');
  $this
    ->assertCount(1, $crawler
    ->selectLink('\' Fabien"s Bar'), '->selectLink() selects links by the alt attribute of a clickable image');
  $this
    ->assertCount(4, $crawler
    ->selectLink('Foo'), '->selectLink() selects links by the node values');
  $this
    ->assertCount(4, $crawler
    ->selectLink('Bar'), '->selectLink() selects links by the node values');
}