title: PHPUnit: Problem with testing database
body: <p>I'm new to database testing with PhpUnit. I'm starting with simple test that compare PostgreSQL table's content with xml file.</p>
  
  <p>The problem is that assertion doesn't work as expected:</p>
  
  <p>Please take a look of the result:</p>
  
  <p><a href="http://www3.picturepush.com/photo/a/5540556/1024/Anonymous/Screenshot.png" rel="nofollow">http://www3.picturepush.com/photo/a/5540556/1024/Anonymous/Screenshot.png</a></p>
  
  <p>As you see the tables are equal, but the content in db table(first at screen) has an extra spaces...</p>
  
  <p>I've no idea what is wrong.</p>
  
  <p>Here is PHP code:</p>
  
  <pre><code>public function testGetSourceData()
  {
      include_once(
              sfConfig::get('sf_lib_dir')
              . '/task/ShopCategoryTreeUpdateTask.class.php'
      );
  
      $method = new ReflectionMethod(
        'ShopCategoryTreeUpdateTask', '_getSourceData'
      );
  
      $method-&gt;setAccessible(TRUE);
  
      $res = $method-&gt;invoke(new ShopCategoryTreeUpdateTask(new sfEventDispatcher, new sfFormatter),123);
  
      $actual = new PHPUnit_Extensions_Database_DataSet_QueryDataSet($this-&gt;getConnection());
      $actual-&gt;addTable('shop');
  
      $expected = $this-&gt;getDataSet();
  
      $this-&gt;assertDataSetsEqual(
          $actual,
          $expected
      );
  
  }
  </code></pre>
  
  <p>and here the XML:
  <a href="http://pastebin.com/5MmtJDr6" rel="nofollow">http://pastebin.com/5MmtJDr6</a></p>
  
  <p>Thanks for any goals!</p>