You are here

public function CrawlerTest::createTestCrawler 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::createTestCrawler()
6 calls to CrawlerTest::createTestCrawler()
CrawlerTest::testFilter in vendor/symfony/dom-crawler/Tests/CrawlerTest.php
@covers Symfony\Component\DomCrawler\Crawler::filter
CrawlerTest::testFilterXPath in vendor/symfony/dom-crawler/Tests/CrawlerTest.php
@covers Symfony\Component\DomCrawler\Crawler::filterXPath
CrawlerTest::testFilterXPathWithFakeRoot in vendor/symfony/dom-crawler/Tests/CrawlerTest.php
CrawlerTest::testForm in vendor/symfony/dom-crawler/Tests/CrawlerTest.php
CrawlerTest::testSelectButton in vendor/symfony/dom-crawler/Tests/CrawlerTest.php

... See full list

File

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

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function createTestCrawler($uri = null) {
  $dom = new \DOMDocument();
  $dom
    ->loadHTML('
            <html>
                <body>
                    <a href="foo">Foo</a>
                    <a href="/foo">   Fabien\'s Foo   </a>
                    <a href="/foo">Fabien"s Foo</a>
                    <a href="/foo">\' Fabien"s Foo</a>

                    <a href="/bar"><img alt="Bar"/></a>
                    <a href="/bar"><img alt="   Fabien\'s Bar   "/></a>
                    <a href="/bar"><img alt="Fabien&quot;s Bar"/></a>
                    <a href="/bar"><img alt="\' Fabien&quot;s Bar"/></a>

                    <a href="?get=param">GetLink</a>

                    <form action="foo" id="FooFormId">
                        <input type="text" value="TextValue" name="TextName" />
                        <input type="submit" value="FooValue" name="FooName" id="FooId" />
                        <input type="button" value="BarValue" name="BarName" id="BarId" />
                        <button value="ButtonValue" name="ButtonName" id="ButtonId" />
                    </form>

                    <input type="submit" value="FooBarValue" name="FooBarName" form="FooFormId" />
                    <input type="text" value="FooTextValue" name="FooTextName" form="FooFormId" />

                    <ul class="first">
                        <li class="first">One</li>
                        <li>Two</li>
                        <li>Three</li>
                    </ul>
                    <ul>
                        <li>One Bis</li>
                        <li>Two Bis</li>
                        <li>Three Bis</li>
                    </ul>
                    <div id="parent">
                        <div id="child"></div>
                        <div id="child2" xmlns:foo="http://example.com"></div>
                    </div>
                    <div id="sibling"><img /></div>
                </body>
            </html>
        ');
  return new Crawler($dom, $uri);
}