DiDom\Element::is PHP Method

is() public method

Indicates if two nodes are the same node.
public is ( Element | DOMNode $node ) : boolean
$node Element | DOMNode
return boolean
    public function is($node)
    {
        if ($node instanceof self) {
            $node = $node->getNode();
        }
        if (!$node instanceof DOMNode) {
            throw new InvalidArgumentException(sprintf('Argument 1 passed to %s must be an instance of %s or DOMNode, %s given', __METHOD__, __CLASS__, is_object($node) ? get_class($node) : gettype($node)));
        }
        return $this->node->isSameNode($node);
    }

Usage Example

示例#1
0
 public function testIsException()
 {
     $this->setExpectedException('InvalidArgumentException');
     $domElement = $this->createDomElement('input');
     $element = new Element($domElement);
     $element->is(null);
 }
All Usage Examples Of DiDom\Element::is