Skip to content

Commit

Permalink
Laravel 5.3 no longer ships with the Event.php abstract class
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Baker committed Nov 1, 2016
1 parent b7fdbc2 commit 495d46a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Events/LinkClickedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
namespace jdavidbakr\MailTracker\Events;

use jdavidbakr\MailTracker\Model\SentEmail;
use App\Events\Event;
use Illuminate\Queue\SerializesModels;

class LinkClickedEvent extends Event
class LinkClickedEvent
{
use SerializesModels;

Expand Down
3 changes: 1 addition & 2 deletions src/Events/ViewEmailEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
namespace jdavidbakr\MailTracker\Events;

use jdavidbakr\MailTracker\Model\SentEmail;
use App\Events\Event;
use Illuminate\Queue\SerializesModels;

class ViewEmailEvent extends Event
class ViewEmailEvent
{
use SerializesModels;

Expand Down
10 changes: 9 additions & 1 deletion tests/MailTrackerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public function testPing()
{
$track = \jdavidbakr\MailTracker\Model\SentEmail::first();

Event::fake();

$pings = $track->opens;
$pings++;

Expand All @@ -34,12 +36,16 @@ public function testPing()

$track = $track->fresh();
$this->assertEquals($pings, $track->opens);

Event::assertFired(jdavidbakr\MailTracker\Events\ViewEmailEvent::class);
}

public function testLink()
{
$track = \jdavidbakr\MailTracker\Model\SentEmail::first();

Event::fake();

$clicks = $track->clicks;
$clicks++;

Expand All @@ -62,5 +68,7 @@ public function testLink()
]);
$this->call('GET',$url);
$this->assertRedirectedTo($redirect);

Event::assertFired(jdavidbakr\MailTracker\Events\LinkClickedEvent::class);
}
}
}

0 comments on commit 495d46a

Please sign in to comment.