Code Duplication    Length = 15-15 lines in 3 locations

spec/Prophecy/Prophecy/MethodProphecySpec.php 3 locations

@@ 73-87 (lines=15) @@
70
        $wildcard->shouldBe(null);
71
    }
72
73
    function its_constructor_records_default_callback_promise_for_return_type_hinted_methods(
74
        ObjectProphecy $objectProphecy,
75
        $subject
76
    ) {
77
        if (PHP_VERSION_ID < 70100) {
78
            throw new SkippingException('Return void type hint language feature only introduced in >=7.1');
79
        }
80
81
        $subject->beADoubleOf('spec\Prophecy\Prophecy\ClassWithVoidTypeHintedMethods');
82
        $objectProphecy->addMethodProphecy(Argument::cetera())->willReturn(null);
83
        $objectProphecy->reveal()->willReturn($subject);
84
85
        $this->beConstructedWith($objectProphecy, 'getVoid');
86
        $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\CallbackPromise');
87
    }
88
89
    function its_constructor_records_promise_that_returns_null_for_void_type_hinted_methods(
90
        ObjectProphecy $objectProphecy,
@@ 89-103 (lines=15) @@
86
        $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\CallbackPromise');
87
    }
88
89
    function its_constructor_records_promise_that_returns_null_for_void_type_hinted_methods(
90
        ObjectProphecy $objectProphecy,
91
        $subject
92
    ) {
93
        if (PHP_VERSION_ID < 70100) {
94
            throw new SkippingException('Return void type hint language feature only introduced in >=7.1');
95
        }
96
97
        $subject->beADoubleOf('spec\Prophecy\Prophecy\ClassWithVoidTypeHintedMethods');
98
        $objectProphecy->addMethodProphecy(Argument::cetera())->willReturn(null);
99
        $objectProphecy->reveal()->willReturn($subject);
100
101
        $this->beConstructedWith($objectProphecy, 'getVoid');
102
        $this->getPromise()->execute(array(), $objectProphecy, $this)->shouldBeNull();
103
    }
104
105
    function its_constructor_adds_itself_to_ObjectProphecy_for_return_type_hinted_methods(
106
        ObjectProphecy $objectProphecy,
@@ 105-119 (lines=15) @@
102
        $this->getPromise()->execute(array(), $objectProphecy, $this)->shouldBeNull();
103
    }
104
105
    function its_constructor_adds_itself_to_ObjectProphecy_for_return_type_hinted_methods(
106
        ObjectProphecy $objectProphecy,
107
        $subject
108
    ) {
109
        if (PHP_VERSION_ID < 70100) {
110
            throw new SkippingException('Return void type hint language feature only introduced in >=7.1');
111
        }
112
113
        $subject->beADoubleOf('spec\Prophecy\Prophecy\ClassWithVoidTypeHintedMethods');
114
        $objectProphecy->addMethodProphecy(Argument::cetera())->willReturn(null);
115
        $objectProphecy->reveal()->willReturn($subject);
116
117
        $this->beConstructedWith($objectProphecy, 'getVoid');
118
        $objectProphecy->addMethodProphecy($this)->shouldHaveBeenCalled();
119
    }
120
121
    function it_records_promise_through_will_method(PromiseInterface $promise, ObjectProphecy $objectProphecy)
122
    {