title: Test symfony restful api with phpunit and doctrine
body: <p>I'm trying to pull-of some tests for my RESTful api functions.</p>
  
  <p>For this I did the following:</p>
  
  <ul>
  <li>Installed PHPUnit.</li>
  <li>Created a new database for testing.</li>
  <li>Created a new enviorment (test) and changed the doctrine config for it.</li>
  <li>Created a test.</li>
  </ul>
  
  <p>My problem is this:</p>
  
  <p>When performing a request (somedomain.com/api/somemethod) -> the requested page doesn't know i'm performing a test on it -> so the data it uses is the production/development database and not the 'test' db i have created for the tests.</p>
  
  <p>(the script using test db, the requested page uses normal configurations).</p>
  
  <p>Is there a way to solve it without touching or modifying the API code/behavior?.</p>
  
  <p>Thanks.</p>