public function CrawlerTest::testText in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/dom-crawler/Tests/CrawlerTest.php \Symfony\Component\DomCrawler\Tests\CrawlerTest::testText()
File
- vendor/
symfony/ dom-crawler/ Tests/ CrawlerTest.php, line 375
Class
Namespace
Symfony\Component\DomCrawler\TestsCode
public function testText() {
$this
->assertEquals('One', $this
->createTestCrawler()
->filterXPath('//li')
->text(), '->text() returns the node value of the first element of the node list');
try {
$this
->createTestCrawler()
->filterXPath('//ol')
->text();
$this
->fail('->text() throws an \\InvalidArgumentException if the node list is empty');
} catch (\InvalidArgumentException $e) {
$this
->assertTrue(true, '->text() throws an \\InvalidArgumentException if the node list is empty');
}
}