1 | <?php |
||
20 | final class ConfigurationTest extends \PHPUnit_Framework_TestCase |
||
21 | { |
||
22 | use ConfigurationTestCaseTrait; |
||
23 | |||
24 | /** |
||
25 | * @test |
||
26 | */ |
||
27 | public function it_requires_only_grid_name(): void |
||
28 | { |
||
29 | $this->assertProcessedConfigurationEquals( |
||
30 | [[ |
||
31 | 'grids' => [ |
||
32 | 'sylius_admin_tax_category' => null, |
||
33 | ], |
||
34 | ]], |
||
35 | [ |
||
36 | 'grids' => [ |
||
37 | 'sylius_admin_tax_category' => [ |
||
38 | 'driver' => [ |
||
39 | 'name' => Driver::NAME, |
||
40 | 'options' => [], |
||
41 | ], |
||
42 | 'sorting' => [], |
||
43 | 'limits' => [10, 25, 50], |
||
44 | 'fields' => [], |
||
45 | 'filters' => [], |
||
46 | 'actions' => [], |
||
47 | ], |
||
48 | ], |
||
49 | ], |
||
50 | 'grids' |
||
51 | ); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @test |
||
56 | */ |
||
57 | public function it_uses_doctrine_orm_as_default_driver(): void |
||
65 | |||
66 | /** |
||
67 | * @test |
||
68 | */ |
||
69 | public function it_has_empty_action_and_filter_templates_by_default(): void |
||
70 | { |
||
71 | $this->assertProcessedConfigurationEquals( |
||
72 | [[]], |
||
73 | [ |
||
74 | 'templates' => [ |
||
75 | 'action' => [], |
||
76 | 'filter' => [], |
||
77 | 'bulk_action' => [], |
||
78 | ], |
||
79 | ], |
||
80 | 'templates' |
||
81 | ); |
||
82 | } |
||
83 | |||
84 | /** |
||
85 | * @test |
||
86 | */ |
||
87 | public function its_driver_cannot_be_empty(): void |
||
99 | |||
100 | /** |
||
101 | * @test |
||
102 | */ |
||
103 | public function it_requires_field_type_to_be_defined(): void |
||
117 | |||
118 | /** |
||
119 | * @test |
||
120 | */ |
||
121 | public function its_base_sorting_can_be_overwritten(): void |
||
165 | |||
166 | /** |
||
167 | * @test |
||
168 | */ |
||
169 | public function its_sorting_order_can_be_only_ascending_or_descending(): void |
||
203 | |||
204 | /** |
||
205 | * @test |
||
206 | */ |
||
207 | public function its_limits_can_only_be_a_collection_of_integers(): void |
||
241 | |||
242 | /** |
||
243 | * @test |
||
244 | */ |
||
245 | public function its_base_limits_can_be_overwritten(): void |
||
289 | |||
290 | /** |
||
291 | * @test |
||
292 | */ |
||
293 | public function it_should_throw_an_exception_if_an_invalid_driver_is_enabled(): void |
||
299 | |||
300 | /** |
||
301 | * {@inheritdoc} |
||
302 | */ |
||
303 | protected function getConfiguration(): Configuration |
||
307 | } |
||
308 |