PHPSpec2\Prophet\ObjectProphet::setToProphetSubject PHP Method

setToProphetSubject() public method

public setToProphetSubject ( $property, $value = null )
    public function setToProphetSubject($property, $value = null)
    {
        if (null === $this->getWrappedSubject()) {
            throw new BehaviorException(sprintf('Setting property <value>%s</value> on a non-object.', $property));
        }
        $value = $this->unwrapper->unwrapAll($value);
        if ($this->isSubjectPropertyAccessible($property, true)) {
            return $this->getWrappedSubject()->{$property} = $value;
        }
        throw new PropertyNotFoundException($this->getWrappedSubject(), $property);
    }