Browse Source

more code review fixes

pull/448/head
qadan 11 years ago
parent
commit
f652e75396
  1. 15
      tests/islandora_web_test_case.inc

15
tests/islandora_web_test_case.inc

@ -190,10 +190,10 @@ class IslandoraWebTestCase extends DrupalWebTestCase {
$this->fail("Failed. Object passed in is invalid.", 'Islandora');
}
else {
$missing_datastreams = implode(', ', array_diff_key($datastreams, array_keys($this->admin->repository->api->a->listDatastreams($object->id))));
$missing_datastreams = array_diff($datastreams, array_keys($this->admin->repository->api->a->listDatastreams($object->id)));
if ($missing_datastreams !== '') {
$this->fail("Failed to find datastreams {$missing_datastreams} in object {$object->id}.");
if (!empty($missing_datastreams)) {
$this->fail("Failed to find datastreams " . implode(', ', $missing_datastreams) . " in object {$object->id}.");
return FALSE;
}
@ -275,16 +275,15 @@ class IslandoraWebTestCase extends DrupalWebTestCase {
public function deleteObject($pid, $button = NULL, $safety = TRUE) {
$object = islandora_object_load($pid);
if (!$safety || in_array($object->owner, $this->users)) {
$path = 'islandora/object/' . $pid . '/manage/properties';
$edit = array();
$path = "islandora/object/$pid/manage/properties";
if (isset($button)) {
$this->drupalPost($path, $edit, $button);
$this->drupalPost($path, array(), $button);
}
else {
$object = islandora_object_load($pid);
$this->drupalPost($path, $edit, "Permanently remove '{$object->label}' from repository");
$this->drupalPost($path, array(), "Permanently remove '{$object->label}' from repository");
}
$this->drupalPost($this->url, $edit, t('Delete'));
$this->drupalPost($this->url, array(), t('Delete'));
$this->drupalGet("islandora/object/$pid");
$this->assertResponse(404, "Object $pid successfully deleted.");

Loading…
Cancel
Save