1 simpletest.test SimpleTestFunctionalTest::asText(SimpleXMLElement $element)

Extract the text contained by the element.

Parameters

$element: Element to extract text from.

Return value

Extracted text.:

File

core/modules/simpletest/tests/simpletest.test, line 333
Tests for simpletest.module.

Class

SimpleTestFunctionalTest

Code

function asText(SimpleXMLElement $element) {
  if (!is_object($element)) {
    return $this->fail('The element is not an element.');
  }
  return trim(html_entity_decode(strip_tags($element->asXML())));
}