Skip to content

Commit

Permalink
Merge pull request #45 from Ocramius/hotfix/issue-#44-hydrator-interf…
Browse files Browse the repository at this point in the history
…ace-compliance

Hotfix/issue #44 hydrator interface compliance
  • Loading branch information
Ocramius committed May 13, 2013
2 parents 37daee1 + 2d4f589 commit 1363695
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public function __construct(array $accessibleProperties, array $propertyAccessor
. "]);\n";
}

$body .= "\nreturn \$object;";

$this->setBody($body);
}
}
4 changes: 2 additions & 2 deletions tests/ProxyManagerTest/Functional/HydratorFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class HydratorFunctionalTest extends PHPUnit_Framework_TestCase
*
* @param object $instance
*/
public function testHydrate($instance)
public function testHydrator($instance)
{
$reflection = new ReflectionClass($instance);
$properties = $reflection->getProperties();
Expand All @@ -67,7 +67,7 @@ public function testHydrate($instance)
$proxy = $this->generateProxy($instance);

$this->assertSame($initialData, $proxy->extract($instance));
$proxy->hydrate($newData, $instance);
$this->assertSame($instance, $proxy->hydrate($newData, $instance));

$inspectionData = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testGeneratedStructure()
$this->assertSame('hydrate', $hydrate->getName());
$this->assertSame(
"\$object->publicProperty = \$data['publicProperty'];\n"
. "\$this->foo->setValue(\$object, \$data['privateProperty']);\n",
. "\$this->foo->setValue(\$object, \$data['privateProperty']);\n\nreturn \$object;",
$hydrate->getBody()
);

Expand Down

0 comments on commit 1363695

Please sign in to comment.