You are here

public function SimpleTestTest::asText in SimpleTest 8.3

Extract the text contained by the element.

Parameters

$element: Element to extract text from.

Return value

Extracted text.

2 calls to SimpleTestTest::asText()
SimpleTestTest::getResultFieldSet in src/Tests/SimpleTestTest.php
Get the details containing the results for group this test is in.
SimpleTestTest::getTestResults in src/Tests/SimpleTestTest.php
Get the results from a test and store them in the class array $results.

File

src/Tests/SimpleTestTest.php, line 372

Class

SimpleTestTest
Tests SimpleTest's web interface: check that the intended tests were run and ensure that test reports display the intended results. Also test SimpleTest's internal browser and APIs implicitly.

Namespace

Drupal\simpletest\Tests

Code

public 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())));
}