title: Mocking a controller method at CakePHP
body: <p>I am having troubles to test one of my methods because it uses a vendor class with no model. </p>
  
  <p>Well, the thing is that i want that method to return me what i want. 
  I have been told that mocking a method is to make it return what i want.</p>
  
  <p>For example, when i call "foo()" method i want it to return me true always.</p>
  
  <p>How can i do it? At CakePHP cookbook i can find this:</p>
  
  <pre><code>$Posts = $this-&gt;generate('Posts', array(
      'methods' =&gt; array(
          'isAuthorized'
      ),
      'models' =&gt; array(
          'Post' =&gt; array('save')
      ),
      'components' =&gt; array(
          'RequestHandler' =&gt; array('isPut'),
          'Email' =&gt; array('send'),
          'Session'
      )
  ));
  </code></pre>
  
  <p>So i guess i should have to use the fist option: method
  But... how to make it return what i want?</p>
  
  <p>Thanks.</p>