From 9cb1c61b677ebe71e3beef1eb70ed8146ec53f57 Mon Sep 17 00:00:00 2001 From: David Maus <maus@hab.de> Date: Mon, 5 Mar 2012 11:03:11 +0100 Subject: [PATCH] Fix E_STRICT compliance --- src/tests/unit-tests/bootstrap.php | 3 +++ .../php/HAB/Pica/Reader/PicaPlainReaderTest.php | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/tests/unit-tests/bootstrap.php b/src/tests/unit-tests/bootstrap.php index 35d4ffa..97c36d2 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 654cfc7..652aa37 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()); } -- GitLab