title: Symfony2 Unit Testing with Doctrine Entities
body: <p>I'm apparently missing something really obvious, but this drives me crazy:</p>
  
  <p>In order to test my code, I need to put my entities into defined states. And it simply doesn't work. It completely ignores any changes I make, like for example this one:</p>
  
  <pre><code>    $this-&gt;test_character-&gt;setLocation(null);
  
      $crawler = $this-&gt;client-&gt;request('GET', '/en/character/start');
      $this-&gt;assertTrue($this-&gt;client-&gt;getResponse()-&gt;isSuccessful(), "start page failed to load");
      $this-&gt;assertGreaterThan(0, $crawler-&gt;filter('html:contains("Character Placement")')-&gt;count(), 'start page content failure');
  </code></pre>
  
  <p>debugging this test shows that it fails because Location is NOT, in fact, set to null. Adding a flush() doesn't change anything, so that's not the issue. My best guess is that it changes it only on the test client, but not on the backend that generates the pages but that leaves the question: How the f*** do I put my entities into a defined state in order to test them ?</p>