Code Duplication    Length = 19-19 lines in 4 locations

src/Bundle/GridBundle/Tests/Twig/GridExtensionTest.php 4 locations

@@ 109-127 (lines=19) @@
106
        );
107
    }
108
109
    public function testColumn()
110
    {
111
        $this->renderer
112
            ->expects($this->once())
113
            ->method('renderColumn')
114
            ->with(
115
                $this->identicalTo($grid = $this->createGridViewMock()),
116
                $this->identicalTo($column = $this->createColumnMock()),
117
                $this->identicalTo($data = 'data')
118
            )
119
            ->will($this->returnValue($result = '<div>result</div>'));
120
121
        $this->assertSame(
122
            $result,
123
            $this->twig
124
                ->createTemplate('{{ lug_grid_column(grid, column, data) }}')
125
                ->render(['grid' => $grid, 'column' => $column, 'data' => $data])
126
        );
127
    }
128
129
    public function testColumnActions()
130
    {
@@ 148-166 (lines=19) @@
145
        );
146
    }
147
148
    public function testColumnAction()
149
    {
150
        $this->renderer
151
            ->expects($this->once())
152
            ->method('renderColumnAction')
153
            ->with(
154
                $this->identicalTo($grid = $this->createGridViewMock()),
155
                $this->identicalTo($action = $this->createActionMock()),
156
                $this->identicalTo($data = 'data')
157
            )
158
            ->will($this->returnValue($result = '<div>result</div>'));
159
160
        $this->assertSame(
161
            $result,
162
            $this->twig
163
                ->createTemplate('{{ lug_grid_column_action(grid, action, data) }}')
164
                ->render(['grid' => $grid, 'action' => $action, 'data' => $data])
165
        );
166
    }
167
168
    public function testColumnSortings()
169
    {
@@ 187-205 (lines=19) @@
184
        );
185
    }
186
187
    public function testColumnSorting()
188
    {
189
        $this->renderer
190
            ->expects($this->once())
191
            ->method('renderColumnSorting')
192
            ->with(
193
                $this->identicalTo($grid = $this->createGridViewMock()),
194
                $this->identicalTo($column = $this->createColumnMock()),
195
                $this->identicalTo($sorting = 'sorting')
196
            )
197
            ->will($this->returnValue($result = '<div>result</div>'));
198
199
        $this->assertSame(
200
            $result,
201
            $this->twig
202
                ->createTemplate('{{ lug_grid_column_sorting(grid, column, sorting) }}')
203
                ->render(['grid' => $grid, 'column' => $column, 'sorting' => $sorting])
204
        );
205
    }
206
207
    public function testGlobalActions()
208
    {
@@ 240-258 (lines=19) @@
237
        );
238
    }
239
240
    public function testPager()
241
    {
242
        $this->pagerfantaExtension
243
            ->expects($this->once())
244
            ->method('renderPagerfanta')
245
            ->with(
246
                $this->identicalTo($pager = $this->createPagerfantaMock()),
247
                $this->identicalTo($name = 'name'),
248
                $this->identicalTo($options = ['foo' => 'bar'])
249
            )
250
            ->will($this->returnValue($result = '<div>result</div>'));
251
252
        $this->assertSame(
253
            $result,
254
            $this->twig
255
                ->createTemplate('{{ lug_grid_pager(pager, name, options) }}')
256
                ->render(['pager' => $pager, 'name' => $name, 'options' => $options])
257
        );
258
    }
259
260
    public function testPagerWithReset()
261
    {