Permalink
Browse files

Fix public property not being intercepted

  • Loading branch information...
1 parent 89f2246 commit 97b1abe94b5bc803e6516e61092681a5cfaf2097 @MarcelloDuarte MarcelloDuarte committed Aug 31, 2012
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/PHPSpec/Specification/Interceptor/Object.php
@@ -143,7 +143,7 @@ public function __get($attribute)
return $dslResult;
}
- if (isset($this->getActualValue()->$attribute)) {
+ if (property_exists($this->getActualValue(), $attribute)) {
return InterceptorFactory::create(
$this->getActualValue()->$attribute
);
@@ -187,10 +187,7 @@ private function accessProperty($property)
}
}
- $class = get_class($this->getActualValue());
- trigger_error(
- "Undefined property: $class::\$$property", E_USER_NOTICE
- );
+ return $this->__get($property);
}
/**

0 comments on commit 97b1abe

Please sign in to comment.