# |
Jul 17th 2018, 22:32 |
saeideng |
bootstrap for phpunit i mean |
# |
Jul 17th 2018, 22:32 |
hippo |
Yeah |
# |
Jul 17th 2018, 22:32 |
saeideng |
do you have `bootstrap.php ` in tests folder? |
# |
Jul 17th 2018, 22:31 |
saeideng |
but there is another way to fix it in cake 3.5 |
# |
Jul 17th 2018, 22:30 |
saeideng |
it solved in cake 3.6.3 |
# |
Jul 17th 2018, 22:30 |
saeideng |
wait |
# |
Jul 17th 2018, 22:29 |
saeideng |
I think it solved in cake core |
# |
Jul 17th 2018, 22:29 |
saeideng |
aha |
# |
Jul 17th 2018, 22:26 |
saeideng |
but I forgot now , what was :D |
# |
Jul 17th 2018, 22:25 |
saeideng |
I say this problem in one of plugins |
# |
Jul 17th 2018, 22:25 |
hippo |
Might be my shell |
# |
Jul 17th 2018, 22:25 |
saeideng |
no unrelated |
# |
Jul 17th 2018, 22:25 |
hippo |
Yeah not sure why it's doing that, `php7.1 vendor/bin/phpunit --filter test path/to/test.php` is how I'm running the tests. |
# |
Jul 17th 2018, 22:24 |
saeideng |
do you need help for this ? |
# |
Jul 17th 2018, 22:23 |
saeideng |
oh |
# |
Jul 17th 2018, 22:22 |
hippo |
The URL the security component tests against is `vendor/bin/admin/apps/approve/2` but the token is built on `/admin/apps/approve/2` |
# |
Jul 17th 2018, 22:21 |
saeideng |
test with postman |
# |
Jul 17th 2018, 22:19 |
hippo |
nvm I think I have the issue |
# |
Jul 17th 2018, 22:18 |
saeideng |
and test again |
# |
Jul 17th 2018, 22:18 |
hippo |
When it's off all I get is ``` Cake\Controller\Exception\SecurityException: The request has been black-holed ``` |
# |
Jul 17th 2018, 22:18 |
saeideng |
turn off |
# |
Jul 17th 2018, 22:17 |
hippo |
yeah |
# |
Jul 17th 2018, 22:17 |
saeideng |
is debug on? |
# |
Jul 17th 2018, 22:16 |
hippo |
Which means there is no response to test against.. |
# |
Jul 17th 2018, 22:16 |
hippo |
`_buildRequest` doesn't actually send the request though. |
# |
Jul 17th 2018, 22:15 |
saeideng |
`_sendRequest` and `post` is same |
# |
Jul 17th 2018, 22:13 |
hippo |
I tried `$this->_sendRequest('/admin/apps/approve/2', 'POST', []);` and it gave the same result. :S |
# |
Jul 17th 2018, 22:10 |
saeideng |
$this->_buildRequest(''/admin/apps/approve/2'', 'POST', $data); |
# |
Jul 17th 2018, 22:10 |
saeideng |
use this method and see result |
# |
Jul 17th 2018, 22:09 |
saeideng |
@hippo |
# |
Jul 17th 2018, 22:09 |
saeideng |
hi |
# |
Jul 17th 2018, 22:02 |
hippo |
Upgrading to 3.5.17 didn't work :S |
# |
Jul 17th 2018, 21:44 |
hippo |
nvm I see there's been some updates made from what I have.. I'll try that first.. |
# |
Jul 17th 2018, 21:41 |
hippo |
Had a quick look over the security component and how the integration test adds the tokens but I couldn't see where it was going wrong :S |
# |
Jul 17th 2018, 21:40 |
hippo |
Hi everyone :slightly_smiling_face: I'm trying to test a method but keep getting "Invalid security debug token". ``` $this->enableCsrfToken(); $this->enableSecurityToken(); $this->enableRetainFlashMessages(); $this->post('/admin/apps/approve/2'); ``` |
# |
Jul 17th 2018, 20:47 |
ricksaccous |
;) |
# |
Jul 17th 2018, 20:47 |
ricksaccous |
'url' => array('controller' => 'whatever', 'action' => 'whenever') |
# |
Jul 17th 2018, 20:47 |
ricksaccous |
it doesn't want an actual url, but the url array |
# |
Jul 17th 2018, 20:46 |
ricksaccous |
'url' option in Form accepts an array |
# |
Jul 17th 2018, 20:46 |
ricksaccous |
to url |
# |
Jul 17th 2018, 20:46 |
ricksaccous |
you don't need to feed $this->Html->url |