From 910768ea5a4fcacab4b3c6d72fee5d2af2695771 Mon Sep 17 00:00:00 2001 From: prolic Date: Mon, 28 May 2012 15:21:01 +0200 Subject: [PATCH 1/2] adjusted api usage in unit tests --- test/HydratorTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/HydratorTest.php b/test/HydratorTest.php index 8c7ab1c17..b32b17d53 100644 --- a/test/HydratorTest.php +++ b/test/HydratorTest.php @@ -60,7 +60,7 @@ public function testHydratorClassMethodsCamelCase() $this->assertEquals($datas['fooBar'], '1'); $this->assertTrue(isset($datas['fooBarBaz'])); $this->assertFalse(isset($datas['foo_bar'])); - $hydrator->hydrate(array('fooBar' => 'foo', 'fooBarBaz' => 'bar'), $this->classMethodsCamelCase); + $this->classMethodsCamelCase = $hydrator->hydrate(array('fooBar' => 'foo', 'fooBarBaz' => 'bar'), $this->classMethodsCamelCase); $this->assertEquals($this->classMethodsCamelCase->getFooBar(), 'foo'); $this->assertEquals($this->classMethodsCamelCase->getFooBarBaz(), 'bar'); } @@ -73,7 +73,7 @@ public function testHydratorClassMethodsCamelCaseWithSetterMissing() $this->assertEquals($datas['fooBar'], '1'); $this->assertFalse(isset($datas['fooBarBaz'])); $this->assertFalse(isset($datas['foo_bar'])); - $hydrator->hydrate(array('fooBar' => 'foo'), $this->classMethodsCamelCaseMissing); + $this->classMethodsCamelCaseMissing = $hydrator->hydrate(array('fooBar' => 'foo'), $this->classMethodsCamelCaseMissing); $this->assertEquals($this->classMethodsCamelCaseMissing->getFooBar(), 'foo'); $this->assertEquals($this->classMethodsCamelCaseMissing->getFooBarBaz(), '2'); } @@ -86,7 +86,7 @@ public function testHydratorClassMethodsUnderscore() $this->assertEquals($datas['foo_bar'], '1'); $this->assertTrue(isset($datas['foo_bar_baz'])); $this->assertFalse(isset($datas['fooBar'])); - $hydrator->hydrate(array('foo_bar' => 'foo', 'foo_bar_baz' => 'bar'), $this->classMethodsUnderscore); + $this->classMethodsUnderscore = $hydrator->hydrate(array('foo_bar' => 'foo', 'foo_bar_baz' => 'bar'), $this->classMethodsUnderscore); $this->assertEquals($this->classMethodsUnderscore->getFooBar(), 'foo'); $this->assertEquals($this->classMethodsUnderscore->getFooBarBaz(), 'bar'); } From 79bbc9f6890ed969a001399a89c403bcd96aa052 Mon Sep 17 00:00:00 2001 From: prolic Date: Tue, 29 May 2012 15:36:24 +0200 Subject: [PATCH 2/2] fix in Hydrator\ArraySerializable --- src/Hydrator/ArraySerializable.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Hydrator/ArraySerializable.php b/src/Hydrator/ArraySerializable.php index d5623522a..da5ed9c61 100644 --- a/src/Hydrator/ArraySerializable.php +++ b/src/Hydrator/ArraySerializable.php @@ -67,10 +67,8 @@ public function hydrate(array $data, $object) { if (is_callable(array($object, 'exchangeArray'))) { $object->exchangeArray($data); - return; } else if (is_callable(array($object, 'populate'))) { $object->populate($data); - return; } else { throw new Exception\BadMethodCallException(sprintf( '%s expects the provided object to implement exchangeArray() or populate()',