Code Duplication    Length = 14-14 lines in 10 locations

src/Bundle/ResourceBundle/Tests/Rest/Action/EventSubscriber/ApiActionSubscriberTest.php 1 location

@@ 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
    {

src/Bundle/ResourceBundle/Tests/Rest/Action/EventSubscriber/ViewActionSubscriberTest.php 1 location

@@ 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
    {

src/Bundle/ResourceBundle/Tests/Rest/View/EventSubscriber/FormViewSubscriberTest.php 2 locations

@@ 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
    {

src/Bundle/ResourceBundle/Tests/Rest/View/EventSubscriber/PagerfantaViewSubscriberTest.php 2 locations

@@ 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
    {

src/Bundle/ResourceBundle/Tests/Rest/View/EventSubscriber/ResourceViewSubscriberTest.php 2 locations

@@ 64-77 (lines=14) @@
61
        );
62
    }
63
64
    public function testApiWithoutApi()
65
    {
66
        $this->parameterResolver
67
            ->expects($this->once())
68
            ->method('resolveApi')
69
            ->will($this->returnValue(false));
70
71
        $event = $this->createViewEventMock();
72
        $event
73
            ->expects($this->never())
74
            ->method('getView');
75
76
        $this->subscriber->onApi($event);
77
    }
78
79
    public function testApi()
80
    {
@@ 120-133 (lines=14) @@
117
        $this->subscriber->onApi($event);
118
    }
119
120
    public function testViewWithApi()
121
    {
122
        $this->parameterResolver
123
            ->expects($this->once())
124
            ->method('resolveApi')
125
            ->will($this->returnValue(true));
126
127
        $event = $this->createViewEventMock();
128
        $event
129
            ->expects($this->never())
130
            ->method('getView');
131
132
        $this->subscriber->onView($event);
133
    }
134
135
    public function testViewWithoutTemplateVar()
136
    {

src/Bundle/ResourceBundle/Tests/Rest/View/EventSubscriber/GridViewSubscriberTest.php 2 locations

@@ 81-94 (lines=14) @@
78
        );
79
    }
80
81
    public function testApiWithoutApi()
82
    {
83
        $this->parameterResolver
84
            ->expects($this->once())
85
            ->method('resolveApi')
86
            ->will($this->returnValue(false));
87
88
        $event = $this->createViewEventMock();
89
        $event
90
            ->expects($this->never())
91
            ->method('getView');
92
93
        $this->subscriber->onApi($event);
94
    }
95
96
    public function testApiWithoutGrid()
97
    {
@@ 152-165 (lines=14) @@
149
        $this->subscriber->onApi($event);
150
    }
151
152
    public function testViewWithApi()
153
    {
154
        $this->parameterResolver
155
            ->expects($this->once())
156
            ->method('resolveApi')
157
            ->will($this->returnValue(true));
158
159
        $event = $this->createViewEventMock();
160
        $event
161
            ->expects($this->never())
162
            ->method('getView');
163
164
        $this->subscriber->onView($event);
165
    }
166
167
    public function testViewWithoutGrid()
168
    {