title: PHPUnit test shows failure even though everything is fine
body: <p>I have a controller for adding languages to my database. Earlier in the controller's test class, the test for adding a new language adds a new language called "Test Language". I also have a test for the editing action, with the following code:</p>
  
  <pre><code>public function testCanEditLanguageAction()
      {
          $language = $this-&gt;em-&gt;getRepository('\Entities\Languages')
              -&gt;findOneByEnglishName($this-&gt;testLanguage);
          $languageId = $language-&gt;getId();
          unset($language);
  
          $replacementName = 'Esttay Anguagelay';
  
          // get the form in order to get the hash
          $form = new Application_Model_FormLanguage([
              'action' =&gt; '/langauges/edit',
              'id' =&gt; $languageId
          ]);
  
          $this-&gt;dispatch("/languages/edit/$languageId");
          $form-&gt;render();
  
          $this-&gt;request
              -&gt;setMethod('POST')
              -&gt;setPost([
                  'id' =&gt; $languageId,
                  'englishName' =&gt; $replacementName,
                  'japaneseName' =&gt; '仮の言葉',
                  'kanaName' =&gt; 'カリノコトバ',
                  'languageHash' =&gt; $form-&gt;languageHash-&gt;getValue()
              ]);
  
          $this-&gt;dispatch("/languages/edit");
  
          $this-&gt;assertRedirectTo('/');
  
          // make sure the data got edited properly
          $editedLanguage = $this-&gt;em
              -&gt;getRepository('\Entities\Languages')
              -&gt;findOneById($languageId);
  
          $this-&gt;assertEquals($replacementName, $editedLanguage-&gt;getEnglishName());
  }
  </code></pre>
  
  <p>The test works fine for the most part: it correctly gets the language, edits it, and updates the value from "Test Language" to "Esttay Anguagelay". If I look in the database after the test is complete, the test language even has that value.</p>
  
  <p>The problem is, according to PHPUnit, the test fails. I get the following output:</p>
  
  <pre><code>There was 1 failure:
  
  1) LanguagesControllerTest::testCanEditLanguageAction
  Failed asserting that two strings are equal.
  --- Expected
  +++ Actual
  @@ @@
  -Esttay Anguagelay
  +Test Language
  </code></pre>
  
  <p>In other words, it thinks that the langauge's value has not changed, when it clearly has. (Like I said, checking the database's value confirms that it has in fact changed).  Am I missing something here? I'm quite new to PHPUnit, so there may be something that I forgot to do or that I've done wrong.</p>