title: Error in testing phpUnit route: ErrorException: Trying to get property of non-object
body: <p>I'm a novice developer and I'm trying to get phpUnit set up and a rudimentary testing suite set up in an existing app that I did not develop.  I'm going through the laravel docs and trying to get some basic tests run.  When I try to run the following:</p>
  
  <pre><code>$response = $this-&gt;action('GET', 'AlertsController@bannerAlerts');
  </code></pre>
  
  <p>I get the following exception:</p>
  
  <pre><code>AlertsControllerTest::testIndexRoute
  ErrorException: Trying to get property of non-object
  </code></pre>
  
  <p>The method I'm calling is:</p>
  
  <pre><code>public function count() {
      $statusIds = DB::table('alert_status')-&gt;where('user_id', $this-&gt;crmUser-&gt;id)-&gt;where('is_new', 0)-&gt;lists('alert_id');
      $count = DB::table('alerts')-&gt;WhereNotIn('id', $statusIds)-&gt;count();
      return Response::json($count);
  }
  </code></pre>
  
  <p>Does anyone know why I'm getting this error?  To my knowledge, I'm not trying to get properties of anything.  I'm just trying to call the route.</p>
  
  <p>The test method throwing the error is:</p>
  
  <pre><code>   public function testIndexRoute() { 
         $this-&gt;crmUser = new stdClass();  
         $this-&gt;crmUser-&gt;id = new stdClass(); 
         $this-&gt;crmUser-&gt;id = 1; 
         $response = $this-&gt;action('GET','AlertsController@bannerAlerts');           
         $count = $response-&gt;original; $this-&gt;assertResponseOk(); 
      } 
  </code></pre>