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 2
2
3
3
namespace Tests ;
4
4
5
+ use File_MARC_Field ;
6
+ use Scriptotek \Marc \Fields \Field ;
5
7
use Scriptotek \Marc \Record ;
6
8
7
9
class IsbnFieldTest extends TestCase
@@ -107,4 +109,17 @@ public function testAsLineMarc()
107
109
$ field ->delete ();
108
110
$ this ->assertNull ($ field ->asLineMarc ());
109
111
}
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
+ }
110
125
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace Tests ;
4
4
5
+ use File_MARC ;
6
+ use File_MARC_Record ;
5
7
use Scriptotek \Marc \AuthorityRecord ;
6
8
use Scriptotek \Marc \BibliographicRecord ;
7
9
use Scriptotek \Marc \Fields \Field ;
@@ -101,4 +103,23 @@ public function testRecordTypeDescriptiveCatalogingForm()
101
103
$ record = Record::fromString ($ source );
102
104
$ this ->assertEquals (Marc21::ISBD_PUNCTUATION_OMITTED , $ record ->catalogingForm );
103
105
}
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
+ }
104
125
}
You can’t perform that action at this time.
0 commit comments