Browse Source

Updated tests to deal wiht purge object confirm form.

pull/105/head
Alexander O'Neill 14 years ago
parent
commit
2128d2d23c
  1. 7
      fedora_repository.module
  2. 1
      tests/fedora_repository.test

7
fedora_repository.module

@ -430,13 +430,12 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) {
} }
return; return;
} }
if (empty($collectionPid) && $_SESSION['fedora_collection'] != $pid) {
$collectionPid = $_SESSION['fedora_collection'];
}
if (!empty($form_state['values']['referrer'])) { if (!empty($form_state['values']['referrer'])) {
$form_state['redirect'] = $form_state['values']['referrer']; $form_state['redirect'] = $form_state['values']['referrer'];
} }
else { elseif (empty($collectionPid) && $_SESSION['fedora_collection'] != $pid) {
$collectionPid = $_SESSION['fedora_collection'];
$form_state['redirect'] = "fedora/repository/$collectionPid/"; $form_state['redirect'] = "fedora/repository/$collectionPid/";
} }
} }

1
tests/fedora_repository.test

@ -103,6 +103,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$this->pass("This is the PID list to purge: ". implode(", ", $pid_list) ); $this->pass("This is the PID list to purge: ". implode(", ", $pid_list) );
foreach ($pid_list as $pid) { foreach ($pid_list as $pid) {
$this->drupalPost("fedora/repository/purgeObject/$pid", array(), 'Purge'); $this->drupalPost("fedora/repository/purgeObject/$pid", array(), 'Purge');
$this->drupalPost(NULL, array(), 'Delete');
} }
} }

Loading…
Cancel
Save