Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

TestBase setObjectValue for protected/private properties

  • Loading branch information...
commit 648cd5973f862e27b0f2993696f0b939c0811053 1 parent 463b73b
@dbaltas dbaltas authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 test/TestBase.php
View
6 test/TestBase.php
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.