diff --git a/build.properties b/build.properties index e556c7bd403d64307cabd1215df55d114b24cbd1..7385faba6784ea2621503dbab703463619c7b9a5 100644 --- a/build.properties +++ b/build.properties @@ -1,8 +1,8 @@ project.name=PicaRecord project.channel=hab20.hab.de/service/pear project.majorVersion=0 -project.minorVersion=3 -project.patchLevel=1 +project.minorVersion=4 +project.patchLevel=0 project.snapshot=false component.type=php-library diff --git a/package.xml b/package.xml index 07dba1620c3642b6ac3b500b9490f1632f2f6925..8e8d98e886d77cb8dc138c812d29fe6fb2d9dae3 100644 --- a/package.xml +++ b/package.xml @@ -56,6 +56,36 @@ </dependencies> <phprelease /> <changelog> + <release> + <version> + <release>0.4.0</release> + <api>0.4</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <date>2013-01-10</date> + <license>GNU General Public License v3</license> + <notes> + * allow empty subfield values (031N $6) + </notes> + </release> + <release> + <version> + <release>0.3.2</release> + <api>0.3</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <date>2013-01-10</date> + <license>GNU General Public License v3</license> + <notes> + * remove hard dependency to Autoloader + </notes> + </release> <release> <version> <release>0.3.1</release> diff --git a/src/php/HAB/Pica/Record/Subfield.php b/src/php/HAB/Pica/Record/Subfield.php index 368f82c081e4f8293b6a1bc4f56d4b381ace7e2b..1d2889e41eaa4543070a051ed9f57a2f3e1df621 100644 --- a/src/php/HAB/Pica/Record/Subfield.php +++ b/src/php/HAB/Pica/Record/Subfield.php @@ -48,16 +48,6 @@ class Subfield { return (bool)preg_match('/^[a-z0-9]$/Di', $arg); } - /** - * Return TRUE if argument is a valid subfield value. - * - * @param mixed $arg Variable to check - * @return boolean TRUE if argument is a valid subfield value - */ - public static function isValidSubfieldValue ($arg) { - return $arg != ''; - } - /** * Return a new subfield based on its array representation. * @@ -97,7 +87,7 @@ class Subfield { /** * Constructor. * - * @throws \InvalidArgumentException Invalid subfield code or value + * @throws \InvalidArgumentException Invalid subfield code * @param string $code Subfield code * @param string $value Subfield value * @return void @@ -113,14 +103,10 @@ class Subfield { /** * Set the subfield value. * - * @throws \InvalidArgumentException Invalid subfield value * @param string $value Subfield value * @return void */ public function setValue ($value) { - if (!self::isValidSubfieldValue($value)) { - throw new \InvalidArgumentException("Invalid subfield value: {$value}"); - } $this->_value = $value; } diff --git a/src/tests/unit-tests/php/HAB/Pica/Record/SubfieldTest.php b/src/tests/unit-tests/php/HAB/Pica/Record/SubfieldTest.php index 65096ce835b488dfcb6aec56fc043040954c64ed..461eb09b2c91af84f257c0f42f695f491afb8e97 100644 --- a/src/tests/unit-tests/php/HAB/Pica/Record/SubfieldTest.php +++ b/src/tests/unit-tests/php/HAB/Pica/Record/SubfieldTest.php @@ -36,10 +36,6 @@ class SubfieldTest extends \PHPUnit_FrameWork_TestCase { $this->assertFalse(Subfield::isValidSubfieldCode("a\n")); } - public function testValidSubfieldValueSingleSpace () { - $this->assertTrue(Subfield::isValidSubfieldValue(' ')); - } - public function testFactory () { $s = Subfield::factory(array('code' => 'a', 'value' => 'valid')); $this->assertInstanceOf('HAB\Pica\Record\Subfield', $s); @@ -83,13 +79,6 @@ class SubfieldTest extends \PHPUnit_FrameWork_TestCase { new Subfield(null, 'valid'); } - /** - * @expectedException \InvalidArgumentException - */ - public function testConstructorThrowsExceptionOnInvalidValue () { - new Subfield('a', null); - } - /** * @expectedException \InvalidArgumentException */ @@ -104,12 +93,4 @@ class SubfieldTest extends \PHPUnit_FrameWork_TestCase { Subfield::factory(array('code' => 'a')); } - /** - * @expectedException \InvalidArgumentException - */ - public function testSetValueThrowsExceptionOnInvalidValue () { - $s = new Subfield('a', 'valid'); - $s->setValue(null); - } - } \ No newline at end of file