Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:signifly/laravel-pivot-events
Browse files Browse the repository at this point in the history
  • Loading branch information
pactode committed Mar 6, 2019
2 parents ab42cc0 + 6394d74 commit e11d645
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
20 changes: 10 additions & 10 deletions tests/PivotEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PivotEventsTest extends TestCase
use RefreshDatabase;

/** @test */
function it_dispatches_pivot_attach_events()
public function it_dispatches_pivot_attach_events()
{
Event::fake();

Expand All @@ -27,12 +27,12 @@ function it_dispatches_pivot_attach_events()
'scopes' => null,
]);

Event::assertDispatched('eloquent.pivotAttaching: ' . User::class);
Event::assertDispatched('eloquent.pivotAttached: ' . User::class);
Event::assertDispatched('eloquent.pivotAttaching: '.User::class);
Event::assertDispatched('eloquent.pivotAttached: '.User::class);
}

/** @test */
function it_receives_pivot_changes_for_attach_events()
public function it_receives_pivot_changes_for_attach_events()
{
$user = $this->createUser();
$role = $this->createRole();
Expand All @@ -58,7 +58,7 @@ function it_receives_pivot_changes_for_attach_events()
}

/** @test */
function it_dispatches_pivot_detach_events()
public function it_dispatches_pivot_detach_events()
{
Event::fake();

Expand All @@ -73,12 +73,12 @@ function it_dispatches_pivot_detach_events()
'user_id' => $user->id,
]);

Event::assertDispatched('eloquent.pivotDetaching: ' . User::class);
Event::assertDispatched('eloquent.pivotDetached: ' . User::class);
Event::assertDispatched('eloquent.pivotDetaching: '.User::class);
Event::assertDispatched('eloquent.pivotDetached: '.User::class);
}

/** @test */
function it_dispatches_pivot_update_events()
public function it_dispatches_pivot_update_events()
{
Event::fake();

Expand All @@ -95,8 +95,8 @@ function it_dispatches_pivot_update_events()
'scopes' => 'orders',
]);

Event::assertDispatched('eloquent.pivotUpdating: ' . User::class);
Event::assertDispatched('eloquent.pivotUpdated: ' . User::class);
Event::assertDispatched('eloquent.pivotUpdating: '.User::class);
Event::assertDispatched('eloquent.pivotUpdated: '.User::class);
}

protected function createRole(array $overwrites = [])
Expand Down
2 changes: 0 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Signifly\PivotEvents\Test;

use Exception;
use Illuminate\Support\Facades\Event;
use Illuminate\Database\Schema\Blueprint;
use Orchestra\Testbench\TestCase as Orchestra;

Expand Down

0 comments on commit e11d645

Please sign in to comment.