5
5
use APY \DataGridBundle \Grid \Column \ArrayColumn ;
6
6
use APY \DataGridBundle \Grid \Column \BlankColumn ;
7
7
use APY \DataGridBundle \Grid \Column \BooleanColumn ;
8
- use APY \DataGridBundle \Grid \Column \Column ;
9
8
use APY \DataGridBundle \Grid \Column \DateColumn ;
10
9
use APY \DataGridBundle \Grid \Column \DateTimeColumn ;
11
10
use APY \DataGridBundle \Grid \Column \JoinColumn ;
12
11
use APY \DataGridBundle \Grid \Column \NumberColumn ;
13
12
use APY \DataGridBundle \Grid \Column \RankColumn ;
14
- use APY \DataGridBundle \Grid \Column \TextColumn ;
15
13
use APY \DataGridBundle \Grid \Column \TimeColumn ;
16
14
use APY \DataGridBundle \Grid \Grid ;
17
15
use APY \DataGridBundle \Grid \Row ;
18
16
use APY \DataGridBundle \Twig \DataGridExtension ;
19
- use Faker \Provider \ar_JO \Text ;
20
17
use Symfony \Bundle \FrameworkBundle \Test \KernelTestCase ;
21
- use Symfony \Component \Routing \RouterInterface ;
22
18
23
19
/**
24
- * Class DataGridExtensionFunctionalTest.
25
- *
26
- *
27
20
* @author Pierre-Louis FORT
28
21
*/
29
22
class DataGridExtensionFunctionalTest extends KernelTestCase
@@ -34,7 +27,7 @@ class DataGridExtensionFunctionalTest extends KernelTestCase
34
27
private $ extension ;
35
28
36
29
/**
37
- * @var
30
+ * @var \Twig_Environment
38
31
*/
39
32
private $ twig ;
40
33
@@ -61,6 +54,7 @@ protected function getMockGridAndInit($id, $hash, $theme = null)
61
54
->method ('getId ' )
62
55
->willReturn ($ id );
63
56
$ this ->extension ->initGrid ($ grid , $ theme );
57
+
64
58
return $ grid ;
65
59
}
66
60
@@ -162,30 +156,30 @@ public function testRenderCellArrayColumnCustomCell($gridId, $colId, $theme, $ex
162
156
);
163
157
}
164
158
165
- /**
166
- */
167
159
public function testRenderCellBlankColumn ()
168
160
{
169
161
$ grid = $ this ->getMockGridAndInit ('' , 'GRID_HASH ' );
170
162
171
- $ column = new BlankColumn ([
172
- 'id ' =>'blank_col '
173
- ]);
163
+ $ column = new BlankColumn (
164
+ [
165
+ 'id ' => 'blank_col '
166
+ ]
167
+ );
174
168
$ this ->assertEquals (
175
169
'' ,
176
170
$ this ->extension ->getGridCell ($ this ->twig , $ column , new Row (), $ grid )
177
171
);
178
172
}
179
173
180
- /**
181
- */
182
174
public function testRenderCellBooleanColumn ()
183
175
{
184
176
$ grid = $ this ->getMockGridAndInit ('' , 'GRID_HASH ' );
185
177
186
- $ column = new BooleanColumn ([
187
- 'id ' =>'bool_col '
188
- ]);
178
+ $ column = new BooleanColumn (
179
+ [
180
+ 'id ' => 'bool_col '
181
+ ]
182
+ );
189
183
$ row = new Row ();
190
184
$ row ->setField ('bool_col ' , true );
191
185
$ this ->assertEquals (
@@ -200,16 +194,13 @@ public function testRenderCellBooleanColumn()
200
194
);
201
195
}
202
196
203
-
204
- /**
205
- */
206
197
public function testRenderCellDateColumnNoFormat ()
207
198
{
208
199
$ grid = $ this ->getMockGridAndInit ('' , 'GRID_HASH ' );
209
200
210
201
$ column = new DateColumn (
211
202
[
212
- 'id ' => 'date_col ' ,
203
+ 'id ' => 'date_col ' ,
213
204
'timezone ' => "Europe/Paris "
214
205
]
215
206
);
@@ -355,11 +346,6 @@ public function numberColumnDecimalProvider()
355
346
356
347
/**
357
348
* @dataProvider numberColumnDecimalProvider
358
- * @param $locale
359
- * @param $precision
360
- * @param $grouping
361
- * @param $number
362
- * @param $expected
363
349
*/
364
350
public function testRenderCellNumberColumnDecimal ($ locale , $ roundingMode , $ precision , $ grouping , $ number , $ expected )
365
351
{
@@ -592,11 +578,13 @@ public function testRenderCellJoinColumn()
592
578
{
593
579
$ grid = $ this ->getMockGridAndInit ('' , 'GRID_HASH ' );
594
580
595
- $ column = new JoinColumn ([
596
- 'id ' => 'join_col ' ,
597
- 'columns ' =>['text_col1 ' ,'text_col2 ' ],
598
- 'separator ' =>'- '
599
- ]);
581
+ $ column = new JoinColumn (
582
+ [
583
+ 'id ' => 'join_col ' ,
584
+ 'columns ' => ['text_col1 ' , 'text_col2 ' ],
585
+ 'separator ' => '- '
586
+ ]
587
+ );
600
588
601
589
$ row = new Row ();
602
590
$ row ->setField ('text_col1 ' , 'text_col1_value ' );
0 commit comments