We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbbfe74 commit a116fe1Copy full SHA for a116fe1
tests/Node/HtmlTest.php
@@ -501,4 +501,17 @@ public function testReplaceNode()
501
$dom->find('p')[0]->getParent()->replaceChild($id, $newChild);
502
$this->assertEquals('<div class="all"><h1></h1></div>', (string) $dom);
503
}
504
+
505
+ public function testTextNodeFirstChild()
506
+ {
507
+ $dom = new Dom;
508
+ $dom->load('<div class="all"><p>Hey bro, <a href="google.com">click here</a><br /> :)</p></div>');
509
+ $p = $dom->find('p');
510
+ foreach ($p as $element)
511
512
+ $child = $element->firstChild();
513
+ $this->assertInstanceOf(TextNode::class, $child);
514
+ break;
515
+ }
516
517
0 commit comments