PhpSpec\Exception\ExceptionFactory::propertyNotFound PHP Метод

propertyNotFound() публичный Метод

public propertyNotFound ( mixed $subject, string $property ) : PhpSpec\Exception\Fracture\PropertyNotFoundException
$subject mixed
$property string
Результат PhpSpec\Exception\Fracture\PropertyNotFoundException
    public function propertyNotFound($subject, $property)
    {
        $message = sprintf('Property %s not found.', $this->presenter->presentString($property));
        return new Fracture\PropertyNotFoundException($message, $subject, $property);
    }

Usage Example

Пример #1
0
 function it_delegates_throwing_property_not_found_exception(WrappedObject $wrappedObject, ExceptionFactory $exceptions)
 {
     $obj = new ExampleClass();
     $wrappedObject->isInstantiated()->willReturn(true);
     $wrappedObject->getInstance()->willReturn($obj);
     $exceptions->propertyNotFound($obj, 'nonExistentProperty')->willReturn(new \PhpSpec\Exception\Fracture\PropertyNotFoundException('Property "nonExistentProperty" not found.', $obj, 'nonExistentProperty'))->shouldBeCalled();
     $this->shouldThrow('\\PhpSpec\\Exception\\Fracture\\PropertyNotFoundException')->duringSet('nonExistentProperty', 'any value');
 }
All Usage Examples Of PhpSpec\Exception\ExceptionFactory::propertyNotFound