Skip to content

Commit

Permalink
Adapt Parsley tests to new Dom behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbestle committed Nov 1, 2021
1 parent 688db43 commit d1e112b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/Parsley/InlineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function testParseNodeWithSelfClosingElement()
public function testParseNodeWithText()
{
$dom = new Dom('Test');
$text = $dom->query('//p/text()')[0];
$text = $dom->query('//text()')[0];
$html = Inline::parseNode($text);

$this->assertSame('Test', $html);
Expand All @@ -206,7 +206,7 @@ public function testParseNodeWithText()
public function testParseNodeWithTextEncoded()
{
$dom = new Dom('Test & Test');
$text = $dom->query('//p/text()')[0];
$text = $dom->query('//text()')[0];
$html = Inline::parseNode($text);

$this->assertSame('Test & Test', $html);
Expand Down
8 changes: 4 additions & 4 deletions tests/Parsley/ParsleyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testContainsBlock($html, $query, $expected)
public function testContainsBlockWithText()
{
$dom = new Dom('Test');
$element = $dom->query('//p')[0]->childNodes[0];
$element = $dom->query('//body')[0]->childNodes[0];

$this->assertFalse($this->parser()->containsBlock($element));
}
Expand Down Expand Up @@ -278,7 +278,7 @@ public function testParseNodeWithDoctype()
public function testParseNodeWithSkippableElement()
{
$dom = new Dom('<script src="/test.js"></script>');
$script = $dom->query('/html/head/script')[0];
$script = $dom->query('/html/body/script')[0];

$this->assertInstanceOf('DOMElement', $script);
$this->assertFalse($this->parser()->parseNode($script));
Expand All @@ -291,8 +291,8 @@ public function testParseNodeWithText()
{
$dom = new Dom('Test');

// html > body > p > text
$text = $dom->query('/html/body/p')[0]->childNodes[0];
// html > body > text
$text = $dom->query('/html/body')[0]->childNodes[0];

$this->assertInstanceOf('DOMText', $text);
$this->assertTrue($this->parser()->parseNode($text));
Expand Down

0 comments on commit d1e112b

Please sign in to comment.