| 1 |
|
<?php |
| 2 |
|
// $Id$ |
| 3 |
|
class BiblioImportExportWebTestCase extends BiblioWebTestCase { |
| 4 |
|
function setUp() { |
| 5 |
|
require_once(drupal_get_path('module', 'biblio') .'/biblio.import.export.inc'); |
| 6 |
|
} |
| 7 |
|
} |
| 8 |
|
|
| 9 |
|
class BiblioImportExportUnitTest extends BiblioImportExportWebTestCase { |
| 10 |
|
|
| 11 |
|
public static function getInfo() { |
| 12 |
|
return array( |
| 13 |
|
'name' => 'Biblio import/export unit tests', |
| 14 |
|
'description' => 'Unit tests for import/export functions.', |
| 15 |
|
'group' => 'Biblio', |
| 16 |
|
); |
| 17 |
|
} |
| 18 |
|
function getTaggedString() { |
| 19 |
|
return "%0 Book\r\n%B biblio_secondary_title\r\n%D 2009\r\n%T Biblio Title\r\n%A Ron J. Jeromezzzzzz\r\n%A John Smithzzzzzz\r\n%A George W. Bushzzzzzz\r\n%C biblio_place_published\r\n%I biblio_publisher\r\n%L biblio_call_number\r\n%M biblio_accession_number\r\n%N biblio_issue\r\n%P biblio_pages\r\n%R biblio_doi\r\n%S biblio_tertiary_title\r\n%U biblio_url\r\n%V biblio_volume\r\n%X biblio_abst_ebiblio_abst_f\r\n%Z biblio_notes\r\n%7 biblio_edition\r\n%8 biblio_date\r\n%9 biblio_type_of_work\r\n%@ biblio_isbn\r\n\r\n"; |
| 20 |
|
|
| 21 |
|
} |
| 22 |
|
function testBiblioEndnoteTaggedExport() { |
| 23 |
|
|
| 24 |
|
$node = $this->createNode(); |
| 25 |
|
$export_string = biblio_endnote_tagged_export($node); |
| 26 |
|
$base_string = $this->getTaggedString(); |
| 27 |
|
$this->assertEqual($export_string, $base_string, 'Export a node in EndNote Tagged format'); |
| 28 |
|
} |
| 29 |
|
} |