diff --git a/src/Exception.php b/src/Exception.php index df7da3f..e375ca5 100644 --- a/src/Exception.php +++ b/src/Exception.php @@ -33,6 +33,6 @@ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Exception extends \Zend\Exception +interface Exception { -} +} \ No newline at end of file diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php new file mode 100644 index 0000000..64ef933 --- /dev/null +++ b/src/Exception/RuntimeException.php @@ -0,0 +1,38 @@ +getDocument())) { - throw new Exception('Cannot query; no document registered'); + throw new Exception\RuntimeException('Cannot query; no document registered'); } libxml_use_internal_errors(true); @@ -214,7 +214,7 @@ public function queryXpath($xpathQuery, $query = null) libxml_use_internal_errors(false); if (!$success) { - throw new Exception(sprintf('Error parsing document (type == %s)', $type)); + throw new Exception\RuntimeException(sprintf('Error parsing document (type == %s)', $type)); } $nodeList = $this->_getNodeList($domDoc, $xpathQuery); @@ -248,4 +248,4 @@ protected function _getNodeList($document, $xpathQuery) $xpathQuery = (string) $xpathQuery; return $xpath->query($xpathQuery); } -} +} \ No newline at end of file diff --git a/test/QueryTest.php b/test/QueryTest.php index f9f9105..a4b128e 100644 --- a/test/QueryTest.php +++ b/test/QueryTest.php @@ -127,7 +127,7 @@ public function testDocumentTypeShouldBeAutomaticallyDiscovered() public function testQueryingWithoutRegisteringDocumentShouldThrowException() { - $this->setExpectedException('\\Zend\\Dom\\Exception', 'no document'); + $this->setExpectedException('\Zend\Dom\Exception\RuntimeException', 'no document'); $this->query->execute('.foo'); }