title: Testing a function that has an inner function call
body: <p>I a unit-testing beginner and seem to be stuck on how to unit test a function that contains an internal function call. For example, testing the following:</p>
  
  <pre><code>public function getBlueFooCount($fooId) {
     $foo = $fooDao-&gt;getFoosById($fooId);
  
     // custom logic to pull out the blue foos from result set
     // custom count business logic on blue foos ...
  
     return $count;
  }
  </code></pre>
  
  <p>How would I be able to mock what the internal function retrieves? Is this because the function is too tightly coupled and it needs to be loosened?</p>