Most specs will extend this class directly. Its responsibility is to proxy method calls to PhpSpec caller which will wrap the results into PhpSpec subjects. This results will then be able to be matched against expectations.
Inheritance: implements ArrayAcces\ArrayAccess, implements PhpSpec\Matcher\MatchersProvider, implements PhpSpec\Wrapper\SubjectContainer, implements PhpSpec\Wrapper\ObjectWrapper, implements Specification
コード例 #1
0
 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);
 }
コード例 #2
0
 function its_presentValue_displays_invokable_objects_as_objects()
 {
     $invokable = new ObjectBehavior();
     $invokable->setSpecificationSubject($this);
     $this->presentValue($invokable)->shouldReturn('[obj:PhpSpec\\Formatter\\Presenter\\StringPresenter]');
 }
コード例 #3
0
 function it_configures_options(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefault('choice_list', null)->shouldBeCalled();
     $resolver->setDefault('choices', Argument::type('callable'))->shouldBeCalled();
 }