|
|
@ -55,10 +55,20 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { |
|
|
|
$add_stream_form['stream_label'] = $this->randomName(20); |
|
|
|
$add_stream_form['stream_label'] = $this->randomName(20); |
|
|
|
$rpath = realpath(drupal_get_path('module', 'fedora_repository') . '/tests/test_files/lorem_ipsum.pdf'); |
|
|
|
$rpath = realpath(drupal_get_path('module', 'fedora_repository') . '/tests/test_files/lorem_ipsum.pdf'); |
|
|
|
$add_stream_form['files[add-stream-file-location]'] = $rpath; |
|
|
|
$add_stream_form['files[add-stream-file-location]'] = $rpath; |
|
|
|
|
|
|
|
$add_stream_form['stream_id'] = 'OBJ'; |
|
|
|
$this->drupalPost('fedora/repository/' . $pdf_item->pid, $add_stream_form, 'Add Datastream'); |
|
|
|
$this->drupalPost('fedora/repository/' . $pdf_item->pid, $add_stream_form, 'Add Datastream'); |
|
|
|
$this->outputScreenContents(); |
|
|
|
|
|
|
|
// Test replace datastream form |
|
|
|
// Test replace datastream form |
|
|
|
|
|
|
|
$this->assertText('The datastream has been uploaded', "Add initial datastream.", 'fedora datastreams'); |
|
|
|
|
|
|
|
$this->drupalGet('fedora/repository/'.$pdf_item->pid); |
|
|
|
|
|
|
|
$this->assertText($add_stream_form['stream_label'], 'Datastream appears in DS list.', 'fedora datastreams'); |
|
|
|
|
|
|
|
$replace_stream_edit = array(); |
|
|
|
|
|
|
|
$replace_stream_rpath = realpath(drupal_get_path('module', 'fedora_repository') . '/tests/test_files/jabberwocky.pdf'); |
|
|
|
|
|
|
|
$replace_stream_edit['files[file]'] = $replace_stream_rpath; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->drupalPost("fedora/repository/replaceStream/$pdf_item->pid/OBJ/NewLabel", $replace_stream_edit , 'Replace Datastream' ); |
|
|
|
|
|
|
|
$this->assertText('NewLabel', "Replacement datastream appears in DS list.", 'fedora datastreams'); |
|
|
|
|
|
|
|
$this->outputScreenContents(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|