Browse Source

ISLANDORA-158 Test of replace datastream form.

pull/6/head^2
Alexander O'Neill 14 years ago
parent
commit
7b573225de
  1. 14
      tests/fedora_repository.test
  2. 70
      tests/test_files/jabberwocky.pdf

14
tests/fedora_repository.test

@ -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();
} }
/** /**

70
tests/test_files/jabberwocky.pdf

@ -0,0 +1,70 @@
%PDF-1.3
%ª«¬­
4 0 obj
<< /Type /Info
/Producer (FOP 0.20.4) >>
endobj
5 0 obj
<< /Length 1072 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
GauHJ9lHOU&A@P9+Ls=kZBT8uH`3C?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hDj?*37`OQ2noBVcONh~>
endstream
endobj
6 0 obj
<< /Type /Page
/Parent 1 0 R
/MediaBox [ 0 0 576 792 ]
/Resources 3 0 R
/Contents 5 0 R
>>
endobj
7 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F6
/BaseFont /Times-Italic
/Encoding /WinAnsiEncoding >>
endobj
8 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F5
/BaseFont /Times-Roman
/Encoding /WinAnsiEncoding >>
endobj
1 0 obj
<< /Type /Pages
/Count 1
/Kids [6 0 R ] >>
endobj
2 0 obj
<< /Type /Catalog
/Pages 1 0 R
>>
endobj
3 0 obj
<<
/Font << /F6 7 0 R /F5 8 0 R >>
/ProcSet [ /PDF /ImageC /Text ] >>
endobj
xref
0 9
0000000000 65535 f
0000001560 00000 n
0000001618 00000 n
0000001668 00000 n
0000000015 00000 n
0000000071 00000 n
0000001235 00000 n
0000001341 00000 n
0000001451 00000 n
trailer
<<
/Size 9
/Root 2 0 R
/Info 4 0 R
>>
startxref
1756
%%EOF
Loading…
Cancel
Save