| @@ 65-78 (lines=14) @@ | ||
| 62 | $this->assertSame([RestEvents::ACTION => ['onAction', -1000]], $this->subscriber->getSubscribedEvents()); |
|
| 63 | } |
|
| 64 | ||
| 65 | public function testActionWithoutApi() |
|
| 66 | { |
|
| 67 | $this->parameterResolver |
|
| 68 | ->expects($this->once()) |
|
| 69 | ->method('resolveApi') |
|
| 70 | ->will($this->returnValue(false)); |
|
| 71 | ||
| 72 | $event = $this->createActionEventMock(); |
|
| 73 | $event |
|
| 74 | ->expects($this->never()) |
|
| 75 | ->method('setView'); |
|
| 76 | ||
| 77 | $this->subscriber->onAction($event); |
|
| 78 | } |
|
| 79 | ||
| 80 | public function testActionWithoutForm() |
|
| 81 | { |
|
| @@ 57-70 (lines=14) @@ | ||
| 54 | $this->assertSame([RestEvents::ACTION => ['onAction', -1000]], $this->subscriber->getSubscribedEvents()); |
|
| 55 | } |
|
| 56 | ||
| 57 | public function testActionWithApi() |
|
| 58 | { |
|
| 59 | $this->parameterResolver |
|
| 60 | ->expects($this->once()) |
|
| 61 | ->method('resolveApi') |
|
| 62 | ->will($this->returnValue(true)); |
|
| 63 | ||
| 64 | $event = $event = $this->createActionEventMock(); |
|
| 65 | $event |
|
| 66 | ->expects($this->never()) |
|
| 67 | ->method('setView'); |
|
| 68 | ||
| 69 | $this->subscriber->onAction($event); |
|
| 70 | } |
|
| 71 | ||
| 72 | public function testActionWithInvalidForm() |
|
| 73 | { |
|
| @@ 72-85 (lines=14) @@ | ||
| 69 | ); |
|
| 70 | } |
|
| 71 | ||
| 72 | public function testApiWithoutApi() |
|
| 73 | { |
|
| 74 | $this->parameterResolver |
|
| 75 | ->expects($this->once()) |
|
| 76 | ->method('resolveApi') |
|
| 77 | ->will($this->returnValue(false)); |
|
| 78 | ||
| 79 | $event = $this->createViewEventMock(); |
|
| 80 | $event |
|
| 81 | ->expects($this->never()) |
|
| 82 | ->method('getView'); |
|
| 83 | ||
| 84 | $this->subscriber->onApi($event); |
|
| 85 | } |
|
| 86 | ||
| 87 | public function testApiWithoutForms() |
|
| 88 | { |
|
| @@ 174-187 (lines=14) @@ | ||
| 171 | $this->subscriber->onApi($event); |
|
| 172 | } |
|
| 173 | ||
| 174 | public function testViewWithApi() |
|
| 175 | { |
|
| 176 | $this->parameterResolver |
|
| 177 | ->expects($this->once()) |
|
| 178 | ->method('resolveApi') |
|
| 179 | ->will($this->returnValue(true)); |
|
| 180 | ||
| 181 | $event = $this->createViewEventMock(); |
|
| 182 | $event |
|
| 183 | ->expects($this->never()) |
|
| 184 | ->method('getView'); |
|
| 185 | ||
| 186 | $this->subscriber->onView($event); |
|
| 187 | } |
|
| 188 | ||
| 189 | public function testViewWithoutForm() |
|
| 190 | { |
|
| @@ 80-93 (lines=14) @@ | ||
| 77 | ); |
|
| 78 | } |
|
| 79 | ||
| 80 | public function testApiWithoutApi() |
|
| 81 | { |
|
| 82 | $this->parameterResolver |
|
| 83 | ->expects($this->once()) |
|
| 84 | ->method('resolveApi') |
|
| 85 | ->will($this->returnValue(false)); |
|
| 86 | ||
| 87 | $event = $this->createViewEventMock(); |
|
| 88 | $event |
|
| 89 | ->expects($this->never()) |
|
| 90 | ->method('getView'); |
|
| 91 | ||
| 92 | $this->subscriber->onApi($event); |
|
| 93 | } |
|
| 94 | ||
| 95 | public function testApiWithoutGrid() |
|
| 96 | { |
|
| @@ 151-164 (lines=14) @@ | ||
| 148 | $this->subscriber->onApi($event); |
|
| 149 | } |
|
| 150 | ||
| 151 | public function testViewWithApi() |
|
| 152 | { |
|
| 153 | $this->parameterResolver |
|
| 154 | ->expects($this->once()) |
|
| 155 | ->method('resolveApi') |
|
| 156 | ->will($this->returnValue(true)); |
|
| 157 | ||
| 158 | $event = $this->createViewEventMock(); |
|
| 159 | $event |
|
| 160 | ->expects($this->never()) |
|
| 161 | ->method('getView'); |
|
| 162 | ||
| 163 | $this->subscriber->onView($event); |
|
| 164 | } |
|
| 165 | ||
| 166 | public function testViewWithoutGrid() |
|
| 167 | { |
|
| @@ 86-99 (lines=14) @@ | ||
| 83 | ); |
|
| 84 | } |
|
| 85 | ||
| 86 | public function testApiWithoutApi() |
|
| 87 | { |
|
| 88 | $this->parameterResolver |
|
| 89 | ->expects($this->once()) |
|
| 90 | ->method('resolveApi') |
|
| 91 | ->will($this->returnValue(false)); |
|
| 92 | ||
| 93 | $event = $this->createViewEventMock(); |
|
| 94 | $event |
|
| 95 | ->expects($this->never()) |
|
| 96 | ->method('getView'); |
|
| 97 | ||
| 98 | $this->subscriber->onApi($event); |
|
| 99 | } |
|
| 100 | ||
| 101 | public function testApiWithoutPagerfanta() |
|
| 102 | { |
|
| @@ 254-267 (lines=14) @@ | ||
| 251 | $this->subscriber->onApi($event); |
|
| 252 | } |
|
| 253 | ||
| 254 | public function testViewWithApi() |
|
| 255 | { |
|
| 256 | $this->parameterResolver |
|
| 257 | ->expects($this->once()) |
|
| 258 | ->method('resolveApi') |
|
| 259 | ->will($this->returnValue(true)); |
|
| 260 | ||
| 261 | $event = $this->createViewEventMock(); |
|
| 262 | $event |
|
| 263 | ->expects($this->never()) |
|
| 264 | ->method('getView'); |
|
| 265 | ||
| 266 | $this->subscriber->onView($event); |
|
| 267 | } |
|
| 268 | ||
| 269 | public function testViewWithoutPagerfanta() |
|
| 270 | { |
|
| @@ 65-78 (lines=14) @@ | ||
| 62 | ); |
|
| 63 | } |
|
| 64 | ||
| 65 | public function testApiWithoutApi() |
|
| 66 | { |
|
| 67 | $this->parameterResolver |
|
| 68 | ->expects($this->once()) |
|
| 69 | ->method('resolveApi') |
|
| 70 | ->will($this->returnValue(false)); |
|
| 71 | ||
| 72 | $event = $this->createViewEventMock(); |
|
| 73 | $event |
|
| 74 | ->expects($this->never()) |
|
| 75 | ->method('getView'); |
|
| 76 | ||
| 77 | $this->subscriber->onApi($event); |
|
| 78 | } |
|
| 79 | ||
| 80 | public function testApiWithSerializerGroups() |
|
| 81 | { |
|
| @@ 158-171 (lines=14) @@ | ||
| 155 | $this->assertSame($null, $context->getSerializeNull()); |
|
| 156 | } |
|
| 157 | ||
| 158 | public function testViewWithApi() |
|
| 159 | { |
|
| 160 | $this->parameterResolver |
|
| 161 | ->expects($this->once()) |
|
| 162 | ->method('resolveApi') |
|
| 163 | ->will($this->returnValue(true)); |
|
| 164 | ||
| 165 | $event = $this->createViewEventMock(); |
|
| 166 | $event |
|
| 167 | ->expects($this->never()) |
|
| 168 | ->method('getView'); |
|
| 169 | ||
| 170 | $this->subscriber->onView($event); |
|
| 171 | } |
|
| 172 | ||
| 173 | public function testViewWithoutTemplateVar() |
|
| 174 | { |
|