diff --git a/core/trunk/core/tests/class/DataObjectValidator.php b/core/trunk/core/tests/class/DataObjectValidator.php deleted file mode 100644 index 156488ae264754ba98ab35c93bc0ee545517c908..0000000000000000000000000000000000000000 --- a/core/trunk/core/tests/class/DataObjectValidator.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -class DataObjectValidator -{ - private $status; - private $errors; - - public function validateDataObject($dataObject, $schema) - { - $XmlDocument = $dataObject->asXmlDocument(); - - libxml_use_internal_errors(true); - if($XmlDocument->schemaValidateSource($schema->saveXML())) { - return true; - } else { - $libXMLErrors = libxml_get_errors(); - foreach ($libXMLErrors as $libXMLError) { - $this->errors[] = new DataObjectValidatorError($libXMLError); - } - return false; - } - libxml_clear_errors(); - } - - function getErrors() - { - return $this->errors; - } -} - -class DataObjectValidatorError -{ - function DataObjectValidatorError($libXMLError) - { - $this->level = $libXMLError->level; - $this->code = 'XML-' . $libXMLError->code; - $this->message = $libXMLError->message; - } - -} \ No newline at end of file diff --git a/core/trunk/core/tests/class/error.php b/core/trunk/core/tests/class/error.php new file mode 100644 index 0000000000000000000000000000000000000000..5b5e7717a609240b00e70d1e0d82664ac4a01659 --- /dev/null +++ b/core/trunk/core/tests/class/error.php @@ -0,0 +1,15 @@ +<?php +class message +{ + public $level; + public $code; + public $text; + + function message($level, $code, $text) + { + $this->level = $level; + $this->code = $code; + $this->text = $text; + } + +} \ No newline at end of file