/** * @param string $property * @return \PhpSpec\Exception\Wrapper\SubjectException */ private function accessingPropertyOnNonObject($property) { return $this->exceptionFactory->gettingPropertyOnNonObject($property); }
function it_delegates_throwing_getting_property_on_non_object_exception(ExceptionFactory $exceptions) { $exceptions->gettingPropertyOnNonObject('foo')->willReturn(new \PhpSpec\Exception\Wrapper\SubjectException('Getting property "foo" on a non-object.'))->shouldBeCalled(); $this->shouldThrow('\\PhpSpec\\Exception\\Wrapper\\SubjectException')->duringGet('foo'); }