Permalink
Browse files

TestBase setObjectValue for protected/private properties

  • Loading branch information...
dbaltas committed Jan 31, 2013
1 parent 463b73b commit 648cd5973f862e27b0f2993696f0b939c0811053
Showing with 6 additions and 0 deletions.
  1. +6 −0 test/TestBase.php
View
@@ -16,6 +16,12 @@ protected function getObjectValue($object, $property)
return $prop->getValue($object);
}
+ protected function setObjectValue($object, $property, $value)
+ {
+ $prop = $this->getAccessibleProperty($object, $property);
+ return $prop->setValue($object, $value);
+ }
+
private function getAccessibleProperty($object, $property)
{
$refl = new \ReflectionObject($object);

0 comments on commit 648cd59

Please sign in to comment.