Laravel version update
Laravel version update
This commit is contained in:
15
vendor/symfony/dom-crawler/Tests/CrawlerTest.php
vendored
15
vendor/symfony/dom-crawler/Tests/CrawlerTest.php
vendored
@@ -30,14 +30,14 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase
|
||||
public function testGetUri()
|
||||
{
|
||||
$uri = 'http://symfony.com';
|
||||
$crawler = new Crawler(null, $uri);
|
||||
$crawler = new Crawler(null, $uri);
|
||||
$this->assertEquals($uri, $crawler->getUri());
|
||||
}
|
||||
|
||||
public function testGetBaseHref()
|
||||
{
|
||||
$baseHref = 'http://symfony.com';
|
||||
$crawler = new Crawler(null, null, $baseHref);
|
||||
$crawler = new Crawler(null, null, $baseHref);
|
||||
$this->assertEquals($baseHref, $crawler->getBaseHref());
|
||||
}
|
||||
|
||||
@@ -238,7 +238,13 @@ EOF
|
||||
$crawler = new Crawler();
|
||||
$crawler->addContent('<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><span>中文</span></html>');
|
||||
$this->assertEquals('中文', $crawler->filterXPath('//span')->text(), '->addContent() guess wrong charset');
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires extension iconv
|
||||
*/
|
||||
public function testAddContentNonUtf8()
|
||||
{
|
||||
$crawler = new Crawler();
|
||||
$crawler->addContent(iconv('UTF-8', 'SJIS', '<html><head><meta charset="Shift_JIS"></head><body>日本語</body></html>'));
|
||||
$this->assertEquals('日本語', $crawler->filterXPath('//body')->text(), '->addContent() can recognize "Shift_JIS" in html5 meta charset tag');
|
||||
@@ -430,6 +436,7 @@ EOF
|
||||
$this->assertCount(5, $crawler->filterXPath('(//a | //div)//img'));
|
||||
$this->assertCount(7, $crawler->filterXPath('((//a | //div)//img | //ul)'));
|
||||
$this->assertCount(7, $crawler->filterXPath('( ( //a | //div )//img | //ul )'));
|
||||
$this->assertCount(1, $crawler->filterXPath("//a[./@href][((./@id = 'Klausi|Claudiu' or normalize-space(string(.)) = 'Klausi|Claudiu' or ./@title = 'Klausi|Claudiu' or ./@rel = 'Klausi|Claudiu') or .//img[./@alt = 'Klausi|Claudiu'])]"));
|
||||
}
|
||||
|
||||
public function testFilterXPath()
|
||||
@@ -596,7 +603,7 @@ EOF
|
||||
|
||||
$this->assertCount(0, $crawler->filterXPath('self::a'), 'The fake root node has no "real" element name');
|
||||
$this->assertCount(0, $crawler->filterXPath('self::a/img'), 'The fake root node has no "real" element name');
|
||||
$this->assertCount(9, $crawler->filterXPath('self::*/a'));
|
||||
$this->assertCount(10, $crawler->filterXPath('self::*/a'));
|
||||
}
|
||||
|
||||
public function testFilter()
|
||||
@@ -1079,6 +1086,8 @@ HTML;
|
||||
|
||||
<a href="?get=param">GetLink</a>
|
||||
|
||||
<a href="/example">Klausi|Claudiu</a>
|
||||
|
||||
<form action="foo" id="FooFormId">
|
||||
<input type="text" value="TextValue" name="TextName" />
|
||||
<input type="submit" value="FooValue" name="FooName" id="FooId" />
|
||||
|
Reference in New Issue
Block a user