You are here

private function CronKeyChange::getXpathTextValue in Cron key change 7

Get text value from document.

1 call to CronKeyChange::getXpathTextValue()
CronKeyChange::testCronKeyChange in ./cronkeychange.test
Tests the change cron key.

File

./cronkeychange.test, line 53
Tests the Cron key change module.

Class

CronKeyChange
Tests the Cron key change module.

Code

private function getXpathTextValue($document, $path) {
  $result = array();
  $doc = new DOMDocument();
  $doc
    ->loadHTML($document);
  $xpath = new DOMXPath($doc);
  $elements = $xpath
    ->query($path);
  if (!is_null($elements)) {
    foreach ($elements as $element) {
      $result = $element->wholeText;
    }
  }
  return $result;
}