Browse Source

a bit of cleanup

pull/448/head
qadan 11 years ago
parent
commit
2bf3bf71d6
  1. 11
      tests/islandora_web_test_case.inc

11
tests/islandora_web_test_case.inc

@ -190,19 +190,14 @@ class IslandoraWebTestCase extends DrupalWebTestCase {
$this->fail("Failed. Object passed in is invalid.", 'Islandora'); $this->fail("Failed. Object passed in is invalid.", 'Islandora');
} }
else { else {
$object_datastreams = array_keys($this->admin->repository->api->a->listDatastreams($object->id)); $missing_datastreams = implode(', ', array_diff_key($datastreams, array_keys($this->admin->repository->api->a->listDatastreams($object->id))));
$missing_datastreams = implode(', ', array_diff_key($datastreams, $object_datastreams));
$present_datastreams = implode(', ', array_intersect_key($datastreams, $object_datastreams));
if ($missing_datastreams !== '') { if ($missing_datastreams !== '') {
$this->fail("Failed to load datastreams {$missing_datastreams} from object {$object->id}."); $this->fail("Failed to find datastreams {$missing_datastreams} in object {$object->id}.");
if ($present_datastreams !== '') {
$this->pass("Loaded datastreams {$present_datastreams} from object {$object->id}");
}
return FALSE; return FALSE;
} }
$this->pass("Loaded datastreams {$present_datastreams} from object {$object->id}"); $this->pass("Found all required datastreams in object {$object->id}");
return TRUE; return TRUE;
} }
} }

Loading…
Cancel
Save