File tree 5 files changed +24
-23
lines changed
5 files changed +24
-23
lines changed Original file line number Diff line number Diff line change @@ -553,6 +553,8 @@ public function offsetExists($offset)
553
553
break ;
554
554
case 'charEnd ' : return isset ($ this ->charEnd );
555
555
break ;
556
+ case 'charLength ' : return !is_null ($ this ->getCharLength ());
557
+ break ;
556
558
case 'indicator1 ' : return isset ($ this ->indicator1 );
557
559
break ;
558
560
case 'indicator2 ' : return isset ($ this ->indicator2 );
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ For currently supported version of **MARCspec - A common MARC record path langua
8
8
9
9
Installation can be done by using [ composer] ( https://getcomposer.org/doc/00-intro.md )
10
10
11
- ```
11
+ ``` php
12
12
{
13
13
"require": {
14
14
"ck/php-marcspec": "1.*"
Original file line number Diff line number Diff line change @@ -397,6 +397,9 @@ public function offsetExists($offset)
397
397
398
398
case 'charEnd ' : return isset ($ this ->charEnd );
399
399
break ;
400
+
401
+ case 'charLength ' : return !is_null ($ this ->getCharLength ());
402
+ break ;
400
403
401
404
case 'subSpecs ' : return (0 < count ($ this ->subSpecs )) ? true : false ;
402
405
break ;
Original file line number Diff line number Diff line change @@ -196,28 +196,6 @@ public function testInvalidFieldSpec34()
196
196
public function testInvalidFieldSpec35 ()
197
197
{
198
198
$ this ->fieldspec ('245___ ' );
199
- }
200
-
201
- /**
202
- * @expectedException CK\MARCspec\Exception\InvalidMARCspecException
203
- */
204
- public function testInvalidFieldSpec37 ()
205
- {
206
- $ this ->fieldspec ('245_1+ ' );
207
- }
208
- /**
209
- * @expectedException CK\MARCspec\Exception\InvalidMARCspecException
210
- */
211
- public function testInvalidFieldSpec38 ()
212
- {
213
- $ this ->fieldspec ('245_123 ' );
214
- }
215
- /**
216
- * @expectedException CK\MARCspec\Exception\InvalidMARCspecException
217
- */
218
- public function testInvalidFieldSpec39 ()
219
- {
220
- $ this ->fieldspec ('245_$ ' );
221
199
}
222
200
223
201
/**
Original file line number Diff line number Diff line change @@ -214,6 +214,24 @@ public function testIteration()
214
214
215
215
216
216
}
217
+
218
+ public function testOffsets ()
219
+ {
220
+ $ ms = $ this ->marcspec ('LDR/0-3 ' );
221
+ $ this ->assertTrue ($ ms ['field ' ]->offsetExists ('charLength ' ));
222
+
223
+ $ ms = $ this ->marcspec ('LDR/0-# ' );
224
+ $ this ->assertFalse ($ ms ['field ' ]->offsetExists ('charLength ' ));
225
+
226
+ $ ms = $ this ->marcspec ('245$a/0-3 ' );
227
+ $ this ->assertTrue ($ ms ['a ' ][0 ]->offsetExists ('charLength ' ));
228
+
229
+ $ ms = $ this ->marcspec ('245$a/#-3 ' );
230
+ $ this ->assertTrue ($ ms ['a ' ][0 ]->offsetExists ('charLength ' ));
231
+
232
+ $ ms = $ this ->marcspec ('245$a/0-# ' );
233
+ $ this ->assertFalse ($ ms ['a ' ][0 ]->offsetExists ('charLength ' ));
234
+ }
217
235
218
236
219
237
}
You can’t perform that action at this time.
0 commit comments