spec\Prophecy\Doubler\DoublerSpec::its_double_mirrors_alterates_and_instantiates_provided_class PHP Метод

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

public its_double_mirrors_alterates_and_instantiates_provided_class ( $mirror, $creator, $namer, Prophecy\Doubler\ClassPatch\ClassPatchInterface $alt1, Prophecy\Doubler\ClassPatch\ClassPatchInterface $alt2, ReflectionClass $class, ReflectionClass $interface1, ReflectionClass $interface2, Prophecy\Doubler\Generator\Node\ClassNode $node )
$alt1 Prophecy\Doubler\ClassPatch\ClassPatchInterface
$alt2 Prophecy\Doubler\ClassPatch\ClassPatchInterface
$class ReflectionClass
$interface1 ReflectionClass
$interface2 ReflectionClass
$node Prophecy\Doubler\Generator\Node\ClassNode
    function its_double_mirrors_alterates_and_instantiates_provided_class($mirror, $creator, $namer, ClassPatchInterface $alt1, ClassPatchInterface $alt2, \ReflectionClass $class, \ReflectionClass $interface1, \ReflectionClass $interface2, ClassNode $node)
    {
        $mirror->reflect($class, array($interface1, $interface2))->willReturn($node);
        $alt1->supports($node)->willReturn(true);
        $alt2->supports($node)->willReturn(false);
        $alt1->getPriority()->willReturn(1);
        $alt2->getPriority()->willReturn(2);
        $namer->name($class, array($interface1, $interface2))->willReturn('SplStack');
        $class->getName()->willReturn('stdClass');
        $interface1->getName()->willReturn('ArrayAccess');
        $interface2->getName()->willReturn('Iterator');
        $alt1->apply($node)->shouldBeCalled();
        $alt2->apply($node)->shouldNotBeCalled();
        $creator->create('SplStack', $node)->shouldBeCalled();
        $this->registerClassPatch($alt1);
        $this->registerClassPatch($alt2);
        $this->double($class, array($interface1, $interface2))->shouldReturnAnInstanceOf('SplStack');
    }