title: How to set any header in cakePHP 2.6 Controller Test
body: <p>I have a Controller function, that expects the header 'X-Bla-Bla' from my JSON call. I catch the header with this:</p>
  
  <pre><code>$this-&gt;request-&gt;header('X-Bla-Bla')
  </code></pre>
  
  <p>Now I want to write a test for this but I can't send headers.</p>
  
  <p>My test looks like this:</p>
  
  <pre><code>    $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
  
      $url = Router::url(array('api' =&gt; true, 'controller' =&gt; 'test', 'action' =&gt; 'index'));
      $options = array(
          'return' =&gt; 'contents',
      );
      $result = $this-&gt;testAction($url, $options);
      $this-&gt;assertNotEmpty($result);
  </code></pre>
  
  <p><strong>How can I send the header?</strong></p>
  
  <p>If not, how can I still test my function?</p>