Skip to content

Commit

Permalink
[5.6] Fix inverted fake logic (#24985)
Browse files Browse the repository at this point in the history
* Fix inverted fake logic

* Fix test
  • Loading branch information
arjanwestdorp authored and taylorotwell committed Jul 27, 2018
1 parent acc6b5c commit 62c26ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Testing/Fakes/EventFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ protected function shouldFakeEvent($eventName, $payload)
? $event($eventName, $payload)
: $event === $eventName;
})
->isEmpty();
->isNotEmpty();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/Support/SupportTestingEventFakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testAssertNotDispatched()
public function testAssertDispatchedWithIgnore()
{
$dispatcher = m::mock(Dispatcher::class);
$dispatcher->shouldReceive('dispatch')->twice();
$dispatcher->shouldReceive('dispatch')->once();

$fake = new EventFake($dispatcher, [
'Foo',
Expand All @@ -91,9 +91,9 @@ function ($event, $payload) {
$fake->dispatch('Bar', ['id' => 1]);
$fake->dispatch('Baz');

$fake->assertNotDispatched('Foo');
$fake->assertNotDispatched('Bar');
$fake->assertDispatched('Baz');
$fake->assertDispatched('Foo');
$fake->assertDispatched('Bar');
$fake->assertNotDispatched('Baz');
}
}

Expand Down

0 comments on commit 62c26ef

Please sign in to comment.