Skip to content
Permalink
Browse files

Utility\Error -> Utility\Exception

  • Loading branch information...
lorenzo committed Aug 30, 2014
1 parent 1a1c48c commit 95aa41f278da44db45c3b1c87e9e4c71ff5e3206
Showing with 11 additions and 11 deletions.
  1. +1 −1 src/Utility/{Error → Exception}/XmlException.php
  2. +7 −7 src/Utility/Xml.php
  3. +3 −3 tests/TestCase/Utility/XmlTest.php
@@ -11,7 +11,7 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Utility\Error;
namespace Cake\Utility\Exception;
use RuntimeException;
@@ -15,8 +15,8 @@
namespace Cake\Utility;
use Cake\Core\Configure;
use Cake\Network\Error\SocketException;
use Cake\Utility\Error\XmlException;
use Cake\Network\Exception\SocketException;
use Cake\Utility\Exception\XmlException;
use Cake\Network\Http\Client;
use \DOMDocument;
@@ -81,7 +81,7 @@ class Xml {
* @param string|array $input XML string, a path to a file, a URL or an array
* @param string|array $options The options to use
* @return \SimpleXMLElement|\DOMDocument SimpleXMLElement or DOMDocument
* @throws \Cake\Utility\Error\XmlException
* @throws \Cake\Utility\Exception\XmlException
*/
public static function build($input, array $options = []) {
$defaults = array(
@@ -119,7 +119,7 @@ public static function build($input, array $options = []) {
* @param string $input The input to load.
* @param array $options The options to use. See Xml::build()
* @return \SimpleXmlElement|\DOMDocument
* @throws \Cake\Utility\Error\XmlException
* @throws \Cake\Utility\Exception\XmlException
*/
protected static function _loadXml($input, $options) {
$hasDisable = function_exists('libxml_disable_entity_loader');
@@ -183,7 +183,7 @@ protected static function _loadXml($input, $options) {
* @param array|\Cake\Collection\Collection $input Array with data or a collection instance.
* @param string|array $options The options to use
* @return \SimpleXMLElement|\DOMDocument SimpleXMLElement or DOMDocument
* @throws \Cake\Utility\Error\XmlException
* @throws \Cake\Utility\Exception\XmlException
*/
public static function fromArray($input, $options = array()) {
if (method_exists($input, 'toArray')) {
@@ -230,7 +230,7 @@ public static function fromArray($input, $options = array()) {
* @param array &$data Array of data to append to the $node.
* @param string $format Either 'attribute' or 'tags'. This determines where nested keys go.
* @return void
* @throws \Cake\Utility\Error\XmlException
* @throws \Cake\Utility\Exception\XmlException
*/
protected static function _fromArray($dom, $node, &$data, $format) {
if (empty($data) || !is_array($data)) {
@@ -335,7 +335,7 @@ protected static function _createChild($data) {
*
* @param \SimpleXMLElement|\DOMDocument|\DOMNode $obj SimpleXMLElement, DOMDocument or DOMNode instance
* @return array Array representation of the XML structure.
* @throws \Cake\Utility\Error\XmlException
* @throws \Cake\Utility\Exception\XmlException
*/
public static function toArray($obj) {
if ($obj instanceof \DOMNode) {
@@ -18,7 +18,7 @@
use Cake\Core\Configure;
use Cake\ORM\Entity;
use Cake\TestSuite\TestCase;
use Cake\Utility\Error\XmlException;
use Cake\Utility\Exception\XmlException;
use Cake\Utility\Xml;
/**
@@ -178,7 +178,7 @@ public function testBuildInvalidData($value) {
/**
* Test that building SimpleXmlElement with invalid XML causes the right exception.
*
* @expectedException \Cake\Utility\Error\XmlException
* @expectedException \Cake\Utility\Exception\XmlException
* @return void
*/
public function testBuildInvalidDataSimpleXml() {
@@ -1102,7 +1102,7 @@ public static function invalidToArrayDataProvider() {
* testToArrayFail method
*
* @dataProvider invalidToArrayDataProvider
* @expectedException \Cake\Utility\Error\XmlException
* @expectedException \Cake\Utility\Exception\XmlException
* @return void
*/
public function testToArrayFail($value) {

0 comments on commit 95aa41f

Please sign in to comment.
You can’t perform that action at this time.