title: Object of class could not be converted to int
body: <p>I want to write phpunit test for save method at my repository. My repo code is:</p>
  
  <pre><code>public function saveCustomer(Custom $custom)
  {
      try
      {
          $custom-&gt;save();
  
          return array(
              'status' =&gt; true,
              'customerId' =&gt; $custom-&gt;getId()
          );
      }
      catch(\Exception $e)
      {
          return array(
              'status' =&gt; false,
              'customerId' =&gt; 0
          );
      }
   }
  </code></pre>
  
  <p>I wrote this test:</p>
  
  <pre><code>public function testSaveNewUye()
  {
      $request = array(
          'email' =&gt; 'www@www.com',
          'phone' =&gt; '555 555 555',
          'password' =&gt; '34636'
      );
      $repo = new CustomerRepository();
      $result_actual = $this-&gt;$repo-&gt;saveCustomer($request);
      $result_expected = array(
          'status' =&gt; true,
          'customerId' =&gt; \DB::table('custom')-&gt;select('id')-&gt;orderBy('id', 'DESC')-&gt;first() + 1
      );
      self::assertEquals($result_expected, $result_actual);
  }
  </code></pre>
  
  <p>I got the error given below:</p>
  
  <blockquote>
    <p>ErrorException: Object of class App\CustomerRepository could not be converted to int</p>
  </blockquote>
  
  <p>Can you help me?</p>