title: Dealing with Security component in a CakePHP 2 test case
body: <p>I am trying to test a CakePHP action that deals with a signup form secured with the <code>Security</code> component. I have configured the component in a UsersController like this:</p>
  
  <pre><code>public $components = array(
    'Security' =&gt; array('unlockedFields' =&gt; array('password_again')),
  );
  </code></pre>
  
  <p>I can execute the action in a browser, but whenever I run the test case it fails with the following message:</p>
  
  <pre><code>"The request has been black-holed"
  </code></pre>
  
  <p>I have tried to disable the validation inside the test case in several ways:</p>
  
  <pre><code>$this-&gt;Users-&gt;Security-&gt;enable = false;
  $this-&gt;Users-&gt;Security-&gt;validatePost = false;
  $this-&gt;Users-&gt;Components-&gt;disable('Security');
  $this-&gt;Users-&gt;Security = null; // desperate measure :)
  
  // still fails
  $this-&gt;testAction('/signup', array('data' =&gt; array(...), 'return' =&gt; 'contents'));
  </code></pre>
  
  <p>But the test insists in using the <code>Security</code> validation of <code>POST</code> request. I am using CakePHP 2.0.3 and PHPUnit 3.6.3.</p>
  
  <p>By the way, I am not using the <code>UsersController</code> directly, but a <code>TestUsersController</code> class that CakePHP baked for me (as a replacement for <code>generate</code> method, I think).</p>
  
  <p>What's the right way of dealing with Security component in a test case?</p>