Chris@0: shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface'); Chris@0: } Chris@0: Chris@0: function it_supports_class_that_implements_only_Traversable(ClassNode $node) Chris@0: { Chris@0: $node->getInterfaces()->willReturn(array('Traversable')); Chris@0: Chris@0: $this->supports($node)->shouldReturn(true); Chris@0: } Chris@0: Chris@0: function it_does_not_support_class_that_implements_Iterator(ClassNode $node) Chris@0: { Chris@0: $node->getInterfaces()->willReturn(array('Traversable', 'Iterator')); Chris@0: Chris@0: $this->supports($node)->shouldReturn(false); Chris@0: } Chris@0: Chris@0: function it_does_not_support_class_that_implements_IteratorAggregate(ClassNode $node) Chris@0: { Chris@0: $node->getInterfaces()->willReturn(array('Traversable', 'IteratorAggregate')); Chris@0: Chris@0: $this->supports($node)->shouldReturn(false); Chris@0: } Chris@0: Chris@0: function it_has_100_priority() Chris@0: { Chris@0: $this->getPriority()->shouldReturn(100); Chris@0: } Chris@0: Chris@0: function it_forces_node_to_implement_IteratorAggregate(ClassNode $node) Chris@0: { Chris@0: $node->addInterface('Iterator')->shouldBeCalled(); Chris@0: Chris@0: $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null); Chris@0: Chris@0: $this->apply($node); Chris@0: } Chris@0: }