title: How to create CSRF token for Cakephp 3 PHPunit testing?
body: <p>I am trying to get my unit tests working again after enabling CSRF tokens and SSL in my CakePHP 3 app.</p>
  
  <p>How do I create or generate a token for a test like the following? Or do I just disable it for testing purposes?</p>
  
  <pre><code>public function testLogin() {
      $this-&gt;get('/login');
      $this-&gt;assertResponseOk();
  
      $data = [
          'email' =&gt; 'info@example.com',
          'password' =&gt; 'secret'
      ];
      $this-&gt;post('/login', $data);
  
      $this-&gt;assertResponseSuccess();
      $this-&gt;assertRedirect(['controller' =&gt; 'Users', 'action' =&gt; 'dashboard']);
  }
  </code></pre>