From 222159682536c278885c1f28d2b9a5719e9c9a97 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Fri, 1 Apr 2011 11:16:11 -0300 Subject: [PATCH] Remove testDatastreams from SimpleTest as it required admin access to Fedora with empty password. --- tests/fedora_repository.test | 38 ------------------------------------ 1 file changed, 38 deletions(-) diff --git a/tests/fedora_repository.test b/tests/fedora_repository.test index 5e04583e..fea72991 100644 --- a/tests/fedora_repository.test +++ b/tests/fedora_repository.test @@ -33,44 +33,6 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $this->repository_user = $repository_user; $this->drupalLogin($repository_user); } -public function testDatastreams() { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $pid_list = array(); - - // Test Add datastream form - $cm_item = fedora_item::ingest_new_item(); - $cm_item->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); - $cm_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository').'/content_models/STRICT_PDFCM.xml', 'ISLANDORACM'); - $pids_list[] = $cm_item->pid; - - // Ingest a new PDF object - $pdf_item = fedora_item::ingest_new_item(); - $pdf_item->add_relationship('hasModel', $cm_item->pid, FEDORA_MODEL_URI); - $pids_list[] = $pdf_item->pid; - - // Submit the add datastream form. - $add_stream_form = array(); - $add_stream_form['pid'] = $pdf_item->pid; - $add_stream_form['stream_label'] = $this->randomName(20); - $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['stream_id'] = 'OBJ'; - $this->outputScreenContents(); - $this->drupalPost('fedora/repository/' . $pdf_item->pid, $add_stream_form, 'Add Datastream'); - $this->outputScreenContents(); - // 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(); - } /** * Add an item based on a content model. Initially we will assume that the repository