Skip to content
Newer
Older
100644 100 lines (97 sloc) 1.73 KB
a28d8f3 Add isControlField() and isDataField() convenience methods to File_MA…
Dan Scott authored Feb 25, 2009
1 --TEST--
2 marc_012: test isControlField() and isDataField() convenience methods
d44164b Add a SKIPIF section to skip tests when Structures_LinkedList is not …
Dan Scott authored Aug 17, 2010
3 --SKIPIF--
4 <?php include('skipif.inc'); ?>
a28d8f3 Add isControlField() and isDataField() convenience methods to File_MA…
Dan Scott authored Feb 25, 2009
5 --FILE--
6 <?php
7 $dir = dirname(__FILE__);
8 require 'File/MARC.php';
9 $marc_file = new File_MARC($dir . '/' . 'music.mrc');
10
11 while ($marc_record = $marc_file->next()) {
12 $fields = $marc_record->getFields();
13 foreach ($fields as $field) {
14 print $field->getTag();
15 if ($field->isControlField()) {
16 print "\tControl field!";
17 }
18 if ($field->isDataField()) {
19 print "\tData field!";
20 }
21 print "\n";
22 }
23 }
24
25 ?>
26 --EXPECT--
27 001 Control field!
28 004 Control field!
29 005 Control field!
30 008 Control field!
31 010 Data field!
32 035 Data field!
33 035 Data field!
34 040 Data field!
35 050 Data field!
36 245 Data field!
37 260 Data field!
38 300 Data field!
39 500 Data field!
40 505 Data field!
41 650 Data field!
42 650 Data field!
43 700 Data field!
44 700 Data field!
45 700 Data field!
46 740 Data field!
47 852 Data field!
48 001 Control field!
49 005 Control field!
50 007 Control field!
51 008 Control field!
52 024 Data field!
53 028 Data field!
54 035 Data field!
55 040 Data field!
56 100 Data field!
57 245 Data field!
58 260 Data field!
59 300 Data field!
60 511 Data field!
61 500 Data field!
62 518 Data field!
63 500 Data field!
64 500 Data field!
65 505 Data field!
66 650 Data field!
67 700 Data field!
68 710 Data field!
69 740 Data field!
70 001 Control field!
71 005 Control field!
72 007 Control field!
73 008 Control field!
74 024 Data field!
75 028 Data field!
76 033 Data field!
77 033 Data field!
78 033 Data field!
79 033 Data field!
80 035 Data field!
81 040 Data field!
82 048 Data field!
83 110 Data field!
84 245 Data field!
85 260 Data field!
86 300 Data field!
87 440 Data field!
88 511 Data field!
89 518 Data field!
90 500 Data field!
91 500 Data field!
92 505 Data field!
93 650 Data field!
94 700 Data field!
95 700 Data field!
96 700 Data field!
97 700 Data field!
98 700 Data field!
99 852 Data field!
Something went wrong with that request. Please try again.