Code Duplication    Length = 10-17 lines in 4 locations

tests/unit/Arguments/RequestArgumentTest.php 1 location

@@ 45-54 (lines=10) @@
42
    /**
43
     * @test
44
     */
45
    public function shouldRejectResolvingWithoutRequest()
46
    {
47
        $this->expectException(InvalidArgumentException::class);
48
49
        $requestStack = $this->createMock(RequestStack::class);
50
        $requestStack->method('getCurrentRequest')->willReturn(null);
51
52
        $argument = new RequestArgument($requestStack, "some-request-key");
53
        $argument->resolve();
54
    }
55
56
}
57

tests/unit/Arguments/RequestFileArgumentTest.php 1 location

@@ 170-179 (lines=10) @@
167
    /**
168
     * @test
169
     */
170
    public function shouldRejectResolvingWithoutRequest()
171
    {
172
        $this->expectException(InvalidArgumentException::class);
173
174
        $requestStack = $this->createMock(RequestStack::class);
175
        $requestStack->method('getCurrentRequest')->willReturn(null);
176
177
        $argument = new RequestFileArgument($requestStack, "some-key", "content");
178
        $argument->resolve();
179
    }
180
181
}
182

tests/unit/Arguments/RequestPayloadArgumentTest.php 1 location

@@ 47-56 (lines=10) @@
44
    /**
45
     * @test
46
     */
47
    public function shouldRejectResolvingWithoutRequest()
48
    {
49
        $this->expectException(InvalidArgumentException::class);
50
51
        $requestStack = $this->createMock(RequestStack::class);
52
        $requestStack->method('getCurrentRequest')->willReturn(null);
53
54
        $argument = new RequestPayloadArgument($requestStack);
55
        $argument->resolve();
56
    }
57
58
}
59

tests/unit/Arguments/ArgumentCallTest.php 1 location

@@ 74-90 (lines=17) @@
71
    /**
72
     * @test
73
     */
74
    public function shouldRejectNonObjectCallee()
75
    {
76
        $this->expectException(InvalidArgumentException::class);
77
78
        /** @var Argument $callee */
79
        $callee = $this->createMock(Argument::class);
80
        $callee->method("resolve")->willReturn("non-object");
81
82
        $subject = new ArgumentCall(
83
            $this->createMock(ArgumentCompilerInterface::class),
84
            $callee,
85
            "someMethod",
86
            []
87
        );
88
89
        $subject->resolve();
90
    }
91
92
}
93