You are here

protected function MongoDBLogTestCase::asText in MongoDB 6

Same name and namespace in other branches
  1. 8 mongodb_watchdog/mongodb_watchdog.test \MongoDBLogTestCase::asText()
  2. 7 mongodb_watchdog/mongodb_watchdog.test \MongoDBLogTestCase::asText()

Extract the text contained by the element.

Parameters

\SimpleXMLElement $element: Element to extract text from.

Return value

string Extracted text.

1 call to MongoDBLogTestCase::asText()
MongoDBLogTestCase::getLogEntries in mongodb_watchdog/mongodb_watchdog.test
Get the log entry information form the page.

File

mongodb_watchdog/mongodb_watchdog.test, line 610
Test class for MongoDB_watchdog.

Class

MongoDBLogTestCase
Test the behaviour of watchdog() mongodb_watchdog, not dblog.

Code

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