You are here

function SimpleTestTest::asText in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/Tests/SimpleTestTest.php \Drupal\simpletest\Tests\SimpleTestTest::asText()

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 core/modules/simpletest/src/Tests/SimpleTestTest.php
Get the details containing the results for group this test is in.
SimpleTestTest::getTestResults in core/modules/simpletest/src/Tests/SimpleTestTest.php
Get the results from a test and store them in the class array $results.

File

core/modules/simpletest/src/Tests/SimpleTestTest.php, line 367
Contains \Drupal\simpletest\Tests\SimpleTestTest.

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

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