How to test page if enabled FormProtection

I have enabled:


If run test, then get error:

Possibly related to `Cake\Http\Exception\BadRequestException`: "`_Token` was not found in request data."


    public function testCsrfAppliedOk()
        $this->post('/', ['hello' => 'world']);

        $this->assertThat(403, $this->logicalNot(new StatusCode($this->_response)));

How to write a test in such a case if I have active FormProtection?

Thank You

1 Like

I put this $this->enableSecurityToken(); in and it works, thanks!