title: PHP Unit, Testing laravel log messages with unit testing
body: <p>I'm using PHPUnit to create a Unit test for a store function that stores data in a database. </p>
  
  <p>Currently, i have a test verifies that it has stored data.  </p>
  
  <p>However, I also want to create a test that proves that a laravel log message has been produced if the model save function fails. </p>
  
  <p>The code below shows the store function. The "log::info" is the line I want to test. </p>
  
  <p>Thanks. </p>
  
  <pre><code>public function store(Venue $venue){ 
      $saved =  $venue-&gt;save();
      if($saved == false){
          Log::info('Failed to Save Venue'. $venue);
      }
   }
  </code></pre>
  
  <p>This what I have so far, i pass an empty model that will cause the save to fail due to database constraints</p>
  
  <pre><code>public function test_venue_store_failed(){
     $venue = new Venue();
     $venueRepo = new VenueRepository();
     $this-&gt;withExceptionHandling();
     $venueRepo-&gt;store($venue);
  }
  </code></pre>