title: Phpunit asserting if two array are equal
body: <p>I am writing a Test for my class but I am getting this error:</p>
  
  <pre><code>PHPUnit_Framework_MockObject_Builder_InvocationMocker Object (...) does not match expected type "array".
  </code></pre>
  
  <p>My Test Class:</p>
  
  <pre><code>    &lt;?php
  
  namespace User\UserBundle\Tests\Dto\Template;
  
  use User\UserBundle\Dto\Template\GenerateReportsTemplate;
  use User\UserBundle\Doctrine\DatabaseRepository;
  use User\UserBundle\Validation\ValidationClass;
  
  class GenerateReportsTemplateTest extends \PHPUnit_Framework_TestCase
  {
  
      public static $reportData = array
      (
          'rowid' =&gt; '',
          'emailaddress' =&gt; '',
          'firstname' =&gt; '',
          'surname' =&gt; '',
          'contact_number' =&gt; '',
      );
  
      protected $object;
  
      public $validate;
  
      public $db;
  
      protected function setUp()
      {
  
          $this-&gt;validate = $this-&gt;getMockBuilder('User\UserBundle\Validation\ValidationClass')
              -&gt;disableOriginalConstructor()
              -&gt;getMock();
  
          $this-&gt;db = $this-&gt;getMockBuilder('User\UserBundle\UFODoctrine\DatabaseRepository')
              -&gt;disableOriginalConstructor()
              -&gt;getMock();
  
          $this-&gt;object = $this-&gt;createGenerateReportsTemplateInstance();
      }
  
      public function createGenerateReportsTemplateInstance()
      {
          return new GenerateReportsTemplate
          (
              $this-&gt;validate,
              $this-&gt;db
          );
      }
  
      public function reportTestData()
      {
  
      }
  
      public function testGenerateReports()
      {
  
          $data = array
          (
              'rowid' =&gt; '',
              'emailaddress' =&gt; '',
              'firstname' =&gt; '',
              'surname' =&gt; '',
              'contact_number' =&gt; '',
          );
  
          $report = $this-&gt;db-&gt;expects($this-&gt;any())
                      -&gt;method('getReportData')
                      -&gt;will($this-&gt;returnValue(self::$reportData));
  
          $this-&gt;assertEquals($data, $report);
  
      }
  
  }
  </code></pre>
  
  <p>What I want to check if the sample data equals to the data returned by the stub method <code>getReportData</code></p>
  
  <p>I belief the stub returns object and i want to compare it against a array, if thats the case how can I Assert the two...?</p>
  
  <p>Ps.  I am using Symfony2 and Phpunit</p>