function it_updates_existing_method_if_found(ClassNode $node, MethodNode $method) { $node->hasMethod('__construct')->willReturn(true); $node->getMethod('__construct')->willReturn($method); $node->getParentClass()->shouldBeCalled(); $method->useParentCode()->shouldBeCalled(); $this->apply($node); }