You are here

protected function MongoDBLogTestCase::getLogEntries in MongoDB 7

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

Get the log entry information form the page.

Return value

array List of entries and their information.

1 call to MongoDBLogTestCase::getLogEntries()
MongoDBLogTestCase::getTypeCount in mongodb_watchdog/mongodb_watchdog.test
Get the count of entries per type.

File

mongodb_watchdog/mongodb_watchdog.test, line 655
Contains \MongoDBLogTestCase.

Class

MongoDBLogTestCase

Code

protected function getLogEntries() {
  $entries = array();
  if ($table = $this
    ->xpath('.//table[@id="admin-dblog"]')) {
    $table = array_shift($table);
    foreach ($table->tbody->tr as $row) {
      $entries[] = array(
        'severity' => $this
          ->getSeverityConstant($row['class']),
        'type' => $this
          ->asText($row->td[1]),
        'message' => $this
          ->asText($row->td[3]),
        'user' => $this
          ->asText($row->td[4]),
      );
    }
  }
  return $entries;
}