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() |
||
68 | |||
69 | /** |
||
70 | * set request ajax |
||
71 | * |
||
72 | * @return void |
||
73 | */ |
||
74 | protected function _setAjax() |
||
79 | |||
80 | /** |
||
81 | * unset request ajax |
||
82 | * |
||
83 | * @return void |
||
84 | */ |
||
85 | protected function _unsetAjax() |
||
89 | |||
90 | /** |
||
91 | * set request json |
||
92 | * |
||
93 | * @return void |
||
94 | */ |
||
95 | protected function _setJson() |
||
101 | |||
102 | /** |
||
103 | * unset request json |
||
104 | * |
||
105 | * @return void |
||
106 | */ |
||
107 | protected function _unsetJson() |
||
113 | |||
114 | /** |
||
115 | * Set user agent |
||
116 | * |
||
117 | * @param string $agent agent |
||
118 | * @return void |
||
119 | */ |
||
120 | protected function _setUserAgent($agent) |
||
127 | |||
128 | /** |
||
129 | * Resets user agent |
||
130 | * |
||
131 | * @return void |
||
132 | */ |
||
133 | protected function _unsetUserAgent() |
||
137 | |||
138 | /** |
||
139 | * Mocks a table with methods |
||
140 | * |
||
141 | * @param string $table table-name |
||
142 | * @param array $methods methods to mock |
||
143 | * @return mixed |
||
144 | */ |
||
145 | public function getMockForTable($table, array $methods = []) |
||
158 | |||
159 | /** |
||
160 | * Configure next request as user authenticated with JWT-Token |
||
161 | * |
||
162 | * @param int $userId user |
||
163 | * @return void |
||
164 | */ |
||
165 | protected function loginJwt(int $userId) |
||
178 | |||
179 | /** |
||
180 | * Login user |
||
181 | * |
||
182 | * @param int $id user-ID |
||
183 | * @return mixed |
||
184 | */ |
||
185 | protected function _loginUser($id) |
||
196 | |||
197 | /** |
||
198 | * Logout user |
||
199 | * |
||
200 | * @return void |
||
201 | */ |
||
202 | protected function _logoutUser() |
||
213 | |||
214 | /** |
||
215 | * {@inheritdoc} |
||
216 | */ |
||
217 | protected function _sendRequest($url, $method, $data = []) |
||
224 | |||
225 | /** |
||
226 | * Skip test on particular datasource |
||
227 | * |
||
228 | * @param string $datasource MySQL|Postgres |
||
229 | * @return void |
||
230 | */ |
||
231 | protected function skipOnDataSource(string $datasource): void |
||
242 | |||
243 | /** |
||
244 | * Marks the Saito installation installed and updated (don't run installer or updater) |
||
245 | * |
||
246 | * @return void |
||
247 | */ |
||
248 | private function markUpdated() |
||
253 | |||
254 | /** |
||
255 | * Check if only specific roles is allowed on action |
||
256 | * |
||
257 | * @param string $route URL |
||
258 | * @param string $role role |
||
259 | * @param true|string|null $referer true: same as $url, null: none, string: URL |
||
260 | * @param string $method HTTP-method |
||
261 | * @return void |
||
262 | */ |
||
263 | public function assertRouteForRole($route, $role, $referer = true, $method = 'GET') |
||
297 | |||
298 | /** |
||
299 | * Check that an redirect to the login is performed |
||
300 | * |
||
301 | * @param string $redirectUrl redirect URL '/where/I/come/from' |
||
302 | * @param string $msg Message |
||
303 | * @return void |
||
304 | */ |
||
305 | public function assertRedirectLogin($redirectUrl = null, string $msg = '') |
||
317 | |||
318 | /** |
||
319 | * assert contains tags |
||
320 | * |
||
321 | * @param array $expected expected |
||
322 | * @return void |
||
323 | */ |
||
324 | public function assertResponseContainsTags($expected) |
||
331 | } |
||
332 |
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: