diff --git a/src/tests/unit-tests/bootstrap.php b/src/tests/unit-tests/bootstrap.php index 35d4ffa29bc00eafd71d6f66b4d3413c3fbe7243..97c36d207cb52450e1529903565cb313b323d081 100644 --- a/src/tests/unit-tests/bootstrap.php +++ b/src/tests/unit-tests/bootstrap.php @@ -34,3 +34,6 @@ if (class_exists('Phix_Project\ContractLib\Contract')) // step 5: define a constant with the fixture directory define('APP_FIXTUREDIR', realpath(__DIR__ . '/../fixtures')); + +// step 6: Set error level to include E_STRICT +\error_reporting(\E_ALL | \E_STRICT); \ No newline at end of file diff --git a/src/tests/unit-tests/php/HAB/Pica/Reader/PicaPlainReaderTest.php b/src/tests/unit-tests/php/HAB/Pica/Reader/PicaPlainReaderTest.php index 654cfc77b40e46ee456f796ef2d50e8903ea0b13..652aa37cdd6b24b3072afb6a069a530b34eef00e 100644 --- a/src/tests/unit-tests/php/HAB/Pica/Reader/PicaPlainReaderTest.php +++ b/src/tests/unit-tests/php/HAB/Pica/Reader/PicaPlainReaderTest.php @@ -48,32 +48,32 @@ class PicaPlainReaderTest extends \PHPUnit_FrameWork_TestCase { public function testReadDoubleEncodedDollarSign () { $this->_reader->open('002@/00 $0T$adouble$$dollar'); $record = $this->_reader->read(); - $field = reset($record->getFields('002@/00')); - $subfield = reset($field->getSubfields('a')); + $field = $record->getFirstMatchingField('002@/00'); + $subfield = $field->getNthSubfield('a', 0); $this->assertEquals('double$dollar', $subfield->getValue()); } public function testReadDoubleEncodedDoubleDollarSign2x () { $this->_reader->open('002@/00 $0T$adouble$$$$dollar'); $record = $this->_reader->read(); - $field = reset($record->getFields('002@/00')); - $subfield = reset($field->getSubfields('a')); + $field = $record->getFirstMatchingField('002@/00'); + $subfield = $field->getNthSubfield('a', 0); $this->assertEquals('double$$dollar', $subfield->getValue()); } public function testReadDoubleEncodedDoubleDollarSignAtEnd () { $this->_reader->open('002@/00 $0T$adoubledollar$$'); $record = $this->_reader->read(); - $field = reset($record->getFields('002@/00')); - $subfield = reset($field->getSubfields('a')); + $field = $record->getFirstMatchingField('002@/00'); + $subfield = $field->getNthSubfield('a', 0); $this->assertEquals('doubledollar$', $subfield->getValue()); } public function testReadDoubleEncodedDoubleDollarSignOnly () { $this->_reader->open('002@/00 $0T$a$$'); $record = $this->_reader->read(); - $field = reset($record->getFields('002@/00')); - $subfield = reset($field->getSubfields('a')); + $field = $record->getFirstMatchingField('002@/00'); + $subfield = $field->getNthSubfield('a', 0); $this->assertEquals('$', $subfield->getValue()); }