Skip to content

Commit

Permalink
fix faking of model events
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 17, 2017
1 parent 74cd4cd commit d6cb75c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Illuminate/Support/Facades/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Support\Facades;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Testing\Fakes\EventFake;

/**
Expand All @@ -16,7 +17,9 @@ class Event extends Facade
*/
public static function fake()
{
static::swap(new EventFake);
static::swap($fake = new EventFake);

Model::setEventDispatcher($fake);
}

/**
Expand Down

0 comments on commit d6cb75c

Please sign in to comment.