text() public method

Get the text content of this node and its descendants.
public text ( ) : string
return string The node value
Beispiel #1
0
 public function testSetValue()
 {
     $element = new Element('span', 'hello');
     $element->setValue('test');
     $this->assertEquals('test', $element->text());
 }
Beispiel #2
0
 public function testText()
 {
     $domElement = $this->createDomElement('input');
     $element = new Element($domElement);
     $this->assertTrue(is_string($element->text()));
 }
 public function testText()
 {
     $domElement = $this->createDomElement('span', 'hello');
     $element = new Element($domElement);
     $text = $element->text();
     $this->assertTrue(is_string($text));
     $this->assertEquals('hello', $text);
 }