Browse Source

better error handling

pull/507/head
qadan 11 years ago
parent
commit
83960d6f02
  1. 13
      tests/includes/datastream_validators.inc

13
tests/includes/datastream_validators.inc

@ -128,12 +128,17 @@ abstract class DatastreamValidator extends IslandoraTestUtilityClass {
* fails to $this->passes and/or $this->fails. * fails to $this->passes and/or $this->fails.
*/ */
public function runValidators() { public function runValidators() {
$methods = get_class_methods($this); if ($this->object[$this->datastream]) {
foreach ($methods as $method) { $methods = get_class_methods($this);
if (substr($method, 0, 6) === 'assert') { foreach ($methods as $method) {
$this->$method(); if (substr($method, 0, 6) === 'assert') {
$this->$method();
}
} }
} }
else {
$this->addResult(FALSE, "Unable to load the requested datastream {$this->datastream} from object {$this->object->id}.");
}
} }
/** /**

Loading…
Cancel
Save