@@ 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 |
@@ 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 |
@@ 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 |
@@ 60-71 (lines=12) @@ | ||
57 | /** |
|
58 | * @test |
|
59 | */ |
|
60 | public function shouldRejectNonObjectCallee() |
|
61 | { |
|
62 | $this->expectException(InvalidArgumentException::class); |
|
63 | ||
64 | /** @var Argument $callee */ |
|
65 | $callee = $this->createMock(Argument::class); |
|
66 | $callee->method("resolve")->willReturn("non-object"); |
|
67 | ||
68 | $subject = new ArgumentCall($callee, "someMethod", []); |
|
69 | ||
70 | $subject->resolve(); |
|
71 | } |
|
72 | ||
73 | /** |
|
74 | * @test |
|
@@ 76-87 (lines=12) @@ | ||
73 | /** |
|
74 | * @test |
|
75 | */ |
|
76 | public function shouldRejectCalleeWithoutCalledMethod() |
|
77 | { |
|
78 | $this->expectException(InvalidArgumentException::class); |
|
79 | ||
80 | /** @var Argument $callee */ |
|
81 | $callee = $this->createMock(Argument::class); |
|
82 | $callee->method("resolve")->willReturn($this->createMock(stdClass::class)); |
|
83 | ||
84 | $subject = new ArgumentCall($callee, "someMethod", []); |
|
85 | ||
86 | $subject->resolve(); |
|
87 | } |
|
88 | ||
89 | } |
|
90 |