1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<?php
use PHPHtmlParser\Dom\TextNode;
class NodeTextTest extends PHPUnit_Framework_TestCase {
public function testText() { $node = new TextNode('foo bar'); $this->assertEquals('foo bar', $node->text()); }
public function testGetTag() { $node = new TextNode('foo bar'); $this->assertEquals('text', $node->getTag()->name()); }
public function testAncestorByTag() { $node = new TextNode('foo bar'); $text = $node->ancestorByTag('text'); $this->assertEquals($node, $text); }
public function testPreserveEntity() { $node = new TextNode('i'); $text = $node->innerhtml; $this->assertEquals('i', $text); } }
|