PhpSpec\ObjectBehavior::setSpecificationSubject PHP Méthode

setSpecificationSubject() public méthode

Used by { @link PhpSpec\Runner\Maintainer\SubjectMaintainer::prepare() } to prepare the subject with all the needed collaborators for proxying object behaviour
public setSpecificationSubject ( Subject $subject )
$subject PhpSpec\Wrapper\Subject
    public function setSpecificationSubject(Subject $subject)
    {
        $this->object = $subject;
    }

Usage Example

 function it_prepares_the_subject(ExampleNode $example, ObjectBehavior $context, MatcherManager $matchers, CollaboratorManager $collaborators, SpecificationNode $specification, ResourceInterface $resource, VarienWrapper $wrapper, Subject $subject, $factory)
 {
     $factory->create(Argument::cetera())->willReturn($wrapper);
     $wrapper->wrap(null)->willReturn($subject);
     $subject->beAnInstanceOf('\\stdObject');
     $subject = $subject->getWrappedObject();
     $resource->getSrcClassname()->willReturn('\\stdObject');
     $specification->getResource()->willReturn($resource);
     $example->getSpecification()->willReturn($specification);
     $context->setSpecificationSubject($subject)->shouldBeCalled();
     $this->prepare($example, $context, $matchers, $collaborators);
 }
All Usage Examples Of PhpSpec\ObjectBehavior::setSpecificationSubject