1 | <?php |
||
28 | abstract class IntegrationTestCase extends TestCase |
||
29 | { |
||
30 | use AssertTrait; |
||
31 | use IntegrationTestTrait { |
||
32 | _sendRequest as _sendRequestParent; |
||
33 | } |
||
34 | use SecurityMockTrait; |
||
35 | use TestCaseTrait { |
||
36 | getMockForTable as getMockForTableParent; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @var array cache environment variables |
||
41 | */ |
||
42 | protected $_env = []; |
||
43 | |||
44 | /** |
||
45 | * {@inheritDoc} |
||
46 | */ |
||
47 | public function setUp() |
||
55 | |||
56 | /** |
||
57 | * {@inheritDoc} |
||
58 | */ |
||
59 | public function tearDown() |
||
67 | |||
68 | /** |
||
69 | * set request ajax |
||
70 | * |
||
71 | * @return void |
||
72 | */ |
||
73 | protected function _setAjax() |
||
78 | |||
79 | /** |
||
80 | * unset request ajax |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | protected function _unsetAjax() |
||
88 | |||
89 | /** |
||
90 | * set request json |
||
91 | * |
||
92 | * @return void |
||
93 | */ |
||
94 | protected function _setJson() |
||
100 | |||
101 | /** |
||
102 | * unset request json |
||
103 | * |
||
104 | * @return void |
||
105 | */ |
||
106 | protected function _unsetJson() |
||
112 | |||
113 | /** |
||
114 | * Set user agent |
||
115 | * |
||
116 | * @param string $agent agent |
||
117 | * @return void |
||
118 | */ |
||
119 | protected function _setUserAgent($agent) |
||
126 | |||
127 | /** |
||
128 | * Mocks a table with methods |
||
129 | * |
||
130 | * @param string $table table-name |
||
131 | * @param array $methods methods to mock |
||
132 | * @return mixed |
||
133 | */ |
||
134 | public function getMockForTable($table, array $methods = []) |
||
147 | |||
148 | /** |
||
149 | * Configure next request as user authenticated with JWT-Token |
||
150 | * |
||
151 | * @param int $userId user |
||
152 | * @return void |
||
153 | */ |
||
154 | protected function loginJwt(int $userId) |
||
167 | |||
168 | /** |
||
169 | * Login user |
||
170 | * |
||
171 | * @param int $id user-ID |
||
172 | * @return mixed |
||
173 | */ |
||
174 | protected function _loginUser($id) |
||
185 | |||
186 | /** |
||
187 | * Logout user |
||
188 | * |
||
189 | * @return void |
||
190 | */ |
||
191 | protected function _logoutUser() |
||
202 | |||
203 | /** |
||
204 | * {@inheritdoc} |
||
205 | */ |
||
206 | protected function _sendRequest($url, $method, $data = []) |
||
213 | |||
214 | /** |
||
215 | * Skip test on particular datasource |
||
216 | * |
||
217 | * @param string $datasource MySQL|Postgres |
||
218 | * @return void |
||
219 | */ |
||
220 | protected function skipOnDataSource(string $datasource): void |
||
231 | |||
232 | /** |
||
233 | * Marks the Saito installation installed and updated (don't run installer or updater) |
||
234 | * |
||
235 | * @return void |
||
236 | */ |
||
237 | private function markUpdated() |
||
242 | |||
243 | /** |
||
244 | * Check if only specific roles is allowed on action |
||
245 | * |
||
246 | * @param string $route URL |
||
247 | * @param string $role role |
||
248 | * @param true|string|null $referer true: same as $url, null: none, string: URL |
||
249 | * @param string $method HTTP-method |
||
250 | * @return void |
||
251 | */ |
||
252 | public function assertRouteForRole($route, $role, $referer = true, $method = 'GET') |
||
286 | |||
287 | /** |
||
288 | * Check that an redirect to the login is performed |
||
289 | * |
||
290 | * @param string $redirectUrl redirect URL '/where/I/come/from' |
||
291 | * @param string $msg Message |
||
292 | * @return void |
||
293 | */ |
||
294 | public function assertRedirectLogin($redirectUrl = null, string $msg = '') |
||
306 | |||
307 | /** |
||
308 | * assert contains tags |
||
309 | * |
||
310 | * @param array $expected expected |
||
311 | * @return void |
||
312 | */ |
||
313 | public function assertResponseContainsTags($expected) |
||
320 | } |
||
321 |
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: