You are here

public function LinkTest::testGetNode in Zircon Profile 8.0

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

File

vendor/symfony/dom-crawler/Tests/LinkTest.php, line 40

Class

LinkTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testGetNode() {
  $dom = new \DOMDocument();
  $dom
    ->loadHTML('<html><a href="/foo">foo</a></html>');
  $node = $dom
    ->getElementsByTagName('a')
    ->item(0);
  $link = new Link($node, 'http://example.com/');
  $this
    ->assertEquals($node, $link
    ->getNode(), '->getNode() returns the node associated with the link');
}