You are here

public function LinkTest::testGetMethod in Zircon Profile 8

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

File

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

Class

LinkTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testGetMethod() {
  $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('GET', $link
    ->getMethod(), '->getMethod() returns the method of the link');
  $link = new Link($node, 'http://example.com/', 'post');
  $this
    ->assertEquals('POST', $link
    ->getMethod(), '->getMethod() returns the method of the link');
}