1 | <?php |
||
17 | class AdminListTest extends TestCase |
||
18 | { |
||
19 | /** @var AdminList */ |
||
20 | protected $adminList; |
||
21 | |||
22 | public function setUp() |
||
23 | { |
||
24 | /** @var AdminListConfiguratorInterface */ |
||
25 | $configurator = $this->createMock(AdminListConfiguratorInterface::class); |
||
26 | |||
27 | $configurator->method('getFilterBuilder')->willReturn(new FilterBuilder()); |
||
28 | $configurator->method('getFields')->willReturn(['a', 'b']); |
||
29 | $configurator->method('getExportFields')->willReturn(['c', 'd']); |
||
30 | $configurator->method('getCount')->willReturn('666'); |
||
31 | $configurator->method('getItems')->willReturn(['item']); |
||
32 | $configurator->method('getSortFields')->willReturn(['e', 'f']); |
||
33 | $configurator->method('canEdit')->willReturn(true); |
||
34 | $configurator->method('canAdd')->willReturn(true); |
||
35 | $configurator->method('canView')->willReturn(true); |
||
36 | $configurator->method('canDelete')->willReturn(true); |
||
37 | $configurator->method('canExport')->willReturn(true); |
||
38 | $configurator->method('getIndexUrl')->willReturn([]); |
||
39 | $configurator->method('getEditUrlFor')->willReturn([]); |
||
40 | $configurator->method('getDeleteUrlFor')->willReturn([]); |
||
41 | $configurator->method('getAddUrlFor')->willReturn([]); |
||
42 | $configurator->method('getExportUrl')->willReturn([]); |
||
43 | $configurator->method('getViewUrlFor')->willReturn([]); |
||
44 | $configurator->method('getValue')->willReturn('test'); |
||
45 | $configurator->method('getStringValue')->willReturn('stringtest'); |
||
46 | $configurator->method('getOrderBy')->willReturn('name'); |
||
47 | $configurator->method('getOrderDirection')->willReturn('up'); |
||
48 | $configurator->method('getItemActions')->willReturn([$this->createMock(ItemActionInterface::class)]); |
||
49 | $configurator->method('hasItemActions')->willReturn(true); |
||
50 | $configurator->method('getListActions')->willReturn([$this->createMock(ListActionInterface::class)]); |
||
51 | $configurator->method('hasListActions')->willReturn(true); |
||
52 | $configurator->method('getBulkActions')->willReturn([$this->createMock(BulkActionInterface::class)]); |
||
53 | $configurator->method('hasBulkActions')->willReturn(true); |
||
54 | $configurator->method('getPagerfanta')->willReturn($this->createMock(Pagerfanta::class)); |
||
55 | |||
56 | $this->adminList = new AdminList($configurator); |
||
|
|||
57 | } |
||
58 | |||
59 | public function testGetConfigurator() |
||
63 | |||
64 | public function testGetFilterBuilder() |
||
68 | |||
69 | public function testGetColumns() |
||
73 | |||
74 | public function testGetExportColumns() |
||
78 | |||
79 | public function testGetCount() |
||
83 | |||
84 | public function testGetItems() |
||
88 | |||
89 | public function testHasSort() |
||
94 | |||
95 | public function testCanEdit() |
||
100 | |||
101 | public function testCanAdd() |
||
106 | |||
107 | public function testCanView() |
||
112 | |||
113 | public function testCanDelete() |
||
118 | |||
119 | public function testCanExport() |
||
123 | |||
124 | public function testGetIndexUrl() |
||
128 | |||
129 | public function testGetEditUrlFor() |
||
134 | |||
135 | public function testGetDeleteUrlFor() |
||
140 | |||
141 | public function testGetAddUrlFor() |
||
145 | |||
146 | public function testGetExportUrl() |
||
150 | |||
151 | public function testGetViewUrl() |
||
156 | |||
157 | public function testGetValue() |
||
162 | |||
163 | public function testGetStringValue() |
||
168 | |||
169 | public function testGetOrderBy() |
||
173 | |||
174 | public function testGetOrderDirection() |
||
178 | |||
179 | public function testGetItemActions() |
||
185 | |||
186 | public function testHasItemActions() |
||
190 | |||
191 | public function testHasListActions() |
||
195 | |||
196 | public function testGetListActions() |
||
202 | |||
203 | public function testGetBulkActions() |
||
209 | |||
210 | public function testHasBulkActions() |
||
214 | |||
215 | public function testGetPagerfanta() |
||
219 | } |
||
220 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: