File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 22
33namespace Tests ;
44
5+ use File_MARC_Field ;
6+ use Scriptotek \Marc \Fields \Field ;
57use Scriptotek \Marc \Record ;
68
79class IsbnFieldTest extends TestCase
@@ -107,4 +109,17 @@ public function testAsLineMarc()
107109 $ field ->delete ();
108110 $ this ->assertNull ($ field ->asLineMarc ());
109111 }
112+
113+ /**
114+ * Test the getField method.
115+ */
116+ public function testGetField ()
117+ {
118+ $ wrapped_field = new File_MARC_Field ('020 ' , '$q h. $c Nkr 98.00 ' );
119+ $ wrapper = new Field ($ wrapped_field );
120+
121+ // Make sure that the exact same wrapped field object is returned
122+ // by the getter.
123+ $ this ->assertSame ($ wrapped_field , $ wrapper ->getField ());
124+ }
110125}
Original file line number Diff line number Diff line change 22
33namespace Tests ;
44
5+ use File_MARC ;
6+ use File_MARC_Record ;
57use Scriptotek \Marc \AuthorityRecord ;
68use Scriptotek \Marc \BibliographicRecord ;
79use Scriptotek \Marc \Fields \Field ;
@@ -101,4 +103,23 @@ public function testRecordTypeDescriptiveCatalogingForm()
101103 $ record = Record::fromString ($ source );
102104 $ this ->assertEquals (Marc21::ISBD_PUNCTUATION_OMITTED , $ record ->catalogingForm );
103105 }
106+
107+ /**
108+ * Test the getRecord method.
109+ *
110+ * @throws \File_MARC_Exception
111+ */
112+ public function testGetRecord ()
113+ {
114+ $ source = '<?xml version="1.0" encoding="UTF-8" ?>
115+ <record>
116+ <leader>99999cam a2299999 c 4500</leader>
117+ </record> ' ;
118+ $ wrapped_record = new File_MARC_Record (new File_MARC ($ source , File_MARC::SOURCE_STRING ));
119+ $ wrapper = new Record ($ wrapped_record );
120+
121+ // Make sure that the exact same wrapped record object is returned
122+ // by the getter.
123+ $ this ->assertSame ($ wrapped_record , $ wrapper ->getRecord ());
124+ }
104125}
You can’t perform that action at this time.
0 commit comments