Skip to content

Commit

Permalink
Tests structure and PHPDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
shadz3rg committed Oct 18, 2014
1 parent 896f571 commit cc51a2b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 24 deletions.
26 changes: 26 additions & 0 deletions src/PHPStamp/XMLHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class XMLHelper
{
/**
* Check two given nodes for equality.
* @param $node1 \DOMNode|null
* @param $node2 \DOMNode|null
* @return bool
Expand Down Expand Up @@ -89,6 +90,12 @@ public function deepEqual($node1, $node2)
return true;
}

/**
* Check two given nodes for equal attributes.
* @param \DOMNode $node1
* @param \DOMNode $node2
* @return bool
*/
private function compareAttributes(\DOMNode $node1, \DOMNode $node2)
{
if ($node1->hasAttributes() === false && $node2->hasAttributes() === false) {
Expand All @@ -114,12 +121,24 @@ private function compareAttributes(\DOMNode $node1, \DOMNode $node2)
}
}

/**
* Fetch node list from document.
* @param \DOMDocument $document
* @param $xpathQuery
* @return \DOMNodeList
*/
public static function queryTemplate(\DOMDocument $document, $xpathQuery)
{
$xpath = new \DOMXPath($document);
return $xpath->query($xpathQuery);
}

/**
* Formats DOMDocument for html output.
* @codeCoverageIgnore
* @param \DOMDocument $document
* @return string
*/
public static function prettyPrint(\DOMDocument $document)
{
$document->preserveWhiteSpace = false;
Expand All @@ -133,6 +152,13 @@ public static function prettyPrint(\DOMDocument $document)
return '<pre>' . htmlentities($xmlString) . '</pre>';
}

/**
* Find closest parent node.
* @param $nodeName
* @param \DOMNode $node
* @return \DOMNode
* @throws Exception\ParsingException
*/
public static function parentUntil($nodeName, \DOMNode $node)
{
$parent = $node->parentNode;
Expand Down
24 changes: 0 additions & 24 deletions tests/OfficeML/Processor/NewLexerTest.php

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cc51a2b

Please sign in to comment.