Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 155 lines (146 sloc) 3.051 kb
6518ef0 Add a test for appendField and prependField, for data fields and control...
Dan Scott authored
1 --TEST--
a5858ba Give the right name to the test
Dan Scott authored
2 marc_014: Add fields to a MARC record
d44164b Add a SKIPIF section to skip tests when Structures_LinkedList is not ins...
Dan Scott authored
3 --SKIPIF--
4 <?php include('skipif.inc'); ?>
6518ef0 Add a test for appendField and prependField, for data fields and control...
Dan Scott authored
5 --FILE--
6 <?php
7 $dir = dirname(__FILE__);
8 require 'File/MARC.php';
9
10 // Get ourselves a MARC record
11 $marc_file = new File_MARC($dir . '/' . 'example.mrc');
12 $marc_record = $marc_file->next();
13
14 // create some subfields
15 $subfields[] = new File_MARC_Subfield('a', 'nothing');
16 $subfields[] = new File_MARC_Subfield('z', 'everything');
17
18 // create a data field
19 $data_field = new File_MARC_Data_Field('100', $subfields, '0');
20
21 // append the data field
22 $marc_record->appendField($data_field);
23
24 // create a control field
25 $ctrl_field = new File_MARC_Control_Field('001', '01234567890');
26
27 // prepend the control field
28 $marc_record->prependField($ctrl_field);
29
30 // let's see the results
366e549 Fix marc_014 test by wrapping output in utf8_encode() - partially addres...
Dan Scott authored
31 print utf8_encode($marc_record);
6518ef0 Add a test for appendField and prependField, for data fields and control...
Dan Scott authored
32 print "\n";
33
34 ?>
35 --EXPECT--
36 LDR 01850 2200517 4500
37 001 01234567890
38 001 0000000044
39 003 EMILDA
40 008 980120s1998 fi j 000 0 swe
41 020 _a9515008808
42 _cFIM 72:00
43 035 _99515008808
44 040 _aNB
45 042 _9NB
46 _9SEE
47 084 _aHcd,u
48 _2kssb/6
49 084 _5NB
50 _auHc
51 _2kssb
52 084 _5SEE
53 _aHcf
54 _2kssb/6
55 084 _5Q
56 _aHcd,uf
57 _2kssb/6
58 100 1 _aJansson, Tove,
59 _d1914-2001
60 245 04 _aDet osynliga barnet och andra berättelser /
61 _cTove Jansson
62 250 _a7. uppl.
63 260 _aHelsingfors :
64 _bSchildt,
65 _c1998 ;
66 _e(Falun :
67 _fScandbook)
68 300 _a166, [4] s. :
69 _bill. ;
70 _c21 cm
71 440 0 _aMumin-biblioteket,
72 _x99-0698931-9
73 500 _aOriginaluppl. 1962
74 599 _aLi: S
75 740 4 _aDet osynliga barnet
76 775 1 _z951-50-0385-7
77 _w9515003857
78 _907
79 841 _5Li
80 _axa
81 _b0201080u 0 4000uu |000000
82 _e1
83 841 _5SEE
84 _axa
85 _b0201080u 0 4000uu |000000
86 _e1
87 841 _5L
88 _axa
89 _b0201080u 0 4000uu |000000
90 _e1
91 841 _5NB
92 _axa
93 _b0201080u 0 4000uu |000000
94 _e1
95 841 _5Q
96 _axa
97 _b0201080u 0 4000uu |000000
98 _e1
99 841 _5S
100 _axa
101 _b0201080u 0 4000uu |000000
102 _e1
103 852 _5NB
104 _bNB
105 _cNB98:12
106 _hplikt
107 _jR, 980520
108 852 _5Li
109 _bLi
110 _cCNB
111 _hh,u
112 852 _5SEE
113 _bSEE
114 852 _5Q
115 _bQ
116 _j98947
117 852 _5L
118 _bL
119 _c0100
120 _h98/
121 _j3043 H
122 852 _5S
123 _bS
124 _hSv97
125 _j7235
126 900 1s _aYanson, Tobe,
127 _d1914-2001
128 _uJansson, Tove,
129 _d1914-2001
130 900 1s _aJanssonová, Tove,
131 _d1914-2001
132 _uJansson, Tove,
133 _d1914-2001
134 900 1s _aJansone, Tuve,
135 _d1914-2001
136 _uJansson, Tove,
137 _d1914-2001
138 900 1s _aJanson, Tuve,
139 _d1914-2001
140 _uJansson, Tove,
141 _d1914-2001
142 900 1s _aJansson, Tuve,
143 _d1914-2001
144 _uJansson, Tove,
145 _d1914-2001
146 900 1s _aJanssonova, Tove,
147 _d1914-2001
148 _uJansson, Tove,
149 _d1914-2001
150 976 2 _aHcd,u
151 _bSkönlitteratur
152 005 20050204111518.0
153 100 0 _anothing
154 _zeverything
Something went wrong with that request. Please try again.