nodeToText() public static method

public static nodeToText ( DOMNode $node ) : string
$node DOMNode
return string
Exemplo n.º 1
0
 /**
  * Runs a test from a Selenese (HTML) specification.
  *
  * @param string $filename
  */
 public function runSelenese($filename)
 {
     $document = PHPUnit_Util_XML::loadFile($filename, TRUE);
     $xpath = new DOMXPath($document);
     $rows = $xpath->query('body/table/tbody/tr');
     foreach ($rows as $row) {
         $action = NULL;
         $arguments = array();
         $columns = $xpath->query('td', $row);
         foreach ($columns as $column) {
             if ($action === NULL) {
                 $action = PHPUnit_Util_XML::nodeToText($column);
             } else {
                 $arguments[] = PHPUnit_Util_XML::nodeToText($column);
             }
         }
         if (method_exists($this, $action)) {
             call_user_func_array(array($this, $action), $arguments);
         } else {
             $this->__call($action, $arguments);
         }
     }
 }