title: (Symfony 3 / Doctrine 2 ) update of fixtures saves chagens but doesn't get them in WebTestCase
body: <p>recently, I have began to with TDD, and I was writing a functional test using Symfony 3, Doctrine 2, fixtures and WebTestCase. Yesterday, I found a strange behaviour in my test:</p>
  
  <p><strong>CONTEXT</strong> That is a test for the edit function of a RESTfull API, so that I have to be logged (with JWT) to can edit the profile. That is what I do on my setUp function. The (JWT-)Token is sent to the edit controller together with the changes I want to update. That works like a charm. </p>
  
  <p><strong>PROBLEM</strong> The problem comes out when I get the updated values from the database and compare them with those that I have sent. They should be the same, but they are not... The most strange thing is that I'm filtering the query to be compared with the values I'm using to compare. That means if there are any row in the database with this values MUST have the same values I'm comparing. </p>
  
  <p>My LoadUserData.php</p>
  
  <pre><code>namespace BackendBundle\DataFixtures\ORM;
  
  use BackendBundle\Entity\User;
  use Doctrine\Common\DataFixtures\FixtureInterface;
  use Doctrine\Common\Persistence\ObjectManager;
  
  class LoadUserData implements FixtureInterface
  {
      static public $users = array();
  
      /**
       * {@inheritDoc}
       */
      public function load(ObjectManager $manager)
      {
          $user = new User();
          $user-&gt;setUsername('User1');
          $user-&gt;setEmail('user1@hotmail.com');
          $user-&gt;setPassword('user1');
          $user-&gt;setDateValidFrom(new \DateTime('2016-10-11 12:22:25'));
          $user-&gt;setProfilePicture('test.jpg');
          $user-&gt;setDateValidTo(new \DateTime('2016-10-11 12:22:25'));
          $user-&gt;setDateLastEdited(new \DateTime('2016-10-11 12:22:25'));
          $user-&gt;setUsergroup(null);
  
          $user2 = new User();
          $user2-&gt;setUsername('User2');
          $user2-&gt;setEmail('user2@hotmail.com');
          $user2-&gt;setPassword('user2');
          $user2-&gt;setDateValidFrom(new \DateTime('2016-10-11 12:22:25'));
          $user2-&gt;setProfilePicture('test.jpg');
          $user2-&gt;setDateValidTo(new \DateTime('2016-10-11 12:22:25'));
          $user2-&gt;setDateLastEdited(new \DateTime('2016-10-11 12:22:25'));
          $user2-&gt;setUsergroup(null);
  
          $manager-&gt;persist($user);
          $manager-&gt;persist($user2);
  
          $manager-&gt;flush();
  
  
          self::$users = array($user, $user2);
  
      }
  }
  </code></pre>
  
  <p>My UserControllerTest.php</p>
  
  <pre><code>namespace tests\BackendBundle\Controller;
  
  
  use BackendBundle\DataFixtures\ORM\LoadUserData;
  use BackendBundle\Entity\User;
  use Liip\FunctionalTestBundle\Test\WebTestCase;
  
  class UserControllerTest extends WebTestCase
  {
  
      private $jwtService;
      private $jwt;
      private $userRep;
      private $currentUser;
  
      public function setUp(){
          $this-&gt;jwtService = $this-&gt;getContainer()-&gt;get('app.jwt_auth');
          $this-&gt;userRep = $this-&gt;getContainer()-&gt;get('doctrine')-&gt;getManager()
              -&gt;getRepository('BackendBundle:User');
  
  
          $fixtures = array('BackendBundle\DataFixtures\ORM\LoadUserData');
          $this-&gt;loadFixtures($fixtures);
          $users = LoadUserData::$users;
          /** @var User $user */
          $user = $users[0];
          $this-&gt;currentUser = $user;
  
          ************* THE USER HAVE TO BE LOGGED TO CAN EDIT HIS PROFILE ******************
          $this-&gt;jwt = $this-&gt;jwtService-&gt;signup(
              $user-&gt;getEmail(),
              $user-&gt;getPassword(),
              true
          );
          $this-&gt;client = static::createClient();
      }
  
      public function testEditAction() {
  
          $route =  $this-&gt;getUrl(
              'edit',
              array(
                  'authorization' =&gt; $this-&gt;jwt,
                  'json' =&gt; '{"email":"email@email.com","username":"admin","password":"admin"}',
                  '_format' =&gt; 'json'
              )
          );
          $this-&gt;client-&gt;request('POST', $route, array('ACCEPT' =&gt; 'application/json'));
          $response = $this-&gt;client-&gt;getResponse();
  
  
          **************** GET THE USER WITH THE NEW EMAIL ****************
          /** @var User $updatedUser */
          $updatedUser = $this-&gt;userRep-&gt;findOneBy( 
              array('email' =&gt; 'email@email.com')
          );
          ************* COMPARE NEW EMAIL WITH THE SENT ONE ***********
          $this-&gt;assertEquals($updatedUser-&gt;getEmail(), 'email@email.com');
      }
  }
  </code></pre>
  
  <p>The Results of the tests:</p>
  
  <blockquote>
    <p>1) tests\BackendBundle\Controller\UserControllerTest::testEditAction</p>
    
    <p>Failed asserting that two strings are equal.</p>
    
    <p>--- Expected</p>
    
    <p>+++ Actual @@ @@</p>
    
    <p>-'user1@hotmail.com'</p>
    
    <p>+'email@email.com'</p>
  </blockquote>
  
  <p>Thank you very much!</p>