Skip to content

Commit

Permalink
Changed fire method to dispatch to support Laravel 5.8 (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelennon authored and barryvdh committed Mar 2, 2019
1 parent ceb49b1 commit 376e8c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -9,7 +9,7 @@
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/laravel-notification-channels/apn/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-notification-channels/apn/?branch=master)
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-notification-channels/apn.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/apn)

This package makes it easy to send notifications using Apple Push (APN) with Laravel 5.3.
This package makes it easy to send notifications using Apple Push (APN) with Laravel 5.8.

## Contents

Expand Down
2 changes: 1 addition & 1 deletion src/ApnChannel.php
Expand Up @@ -115,7 +115,7 @@ protected function sendNotification($notifiable, $notification, $message, $token
$response = $this->client->send($message);

if ($response->getCode() !== Response::RESULT_OK) {
$this->events->fire(
$this->events->dispatch(
new NotificationFailed($notifiable, $notification, $this, [
'token' => $token,
'error' => $response->getCode(),
Expand Down
4 changes: 2 additions & 2 deletions tests/ApnChannelTest.php
Expand Up @@ -47,7 +47,7 @@ public function it_can_send_a_notification()
$responseOk->setCode(MessageResponse::RESULT_OK);

$this->adapter->shouldReceive('adapt')->andReturn(new Message);
$this->events->shouldNotReceive('fire');
$this->events->shouldNotReceive('dispatch');
$this->client->shouldReceive('open')->twice();
$this->client->shouldReceive('send')->twice()->andReturn($responseOk);
$this->client->shouldReceive('close')->twice();
Expand All @@ -64,7 +64,7 @@ public function it_fires_notification_failed_event_on_failure()
$responseFail->setCode(MessageResponse::RESULT_INVALID_TOKEN);

$this->adapter->shouldReceive('adapt')->andReturn(new Message);
$this->events->shouldReceive('fire')->twice();
$this->events->shouldReceive('dispatch')->twice();
$this->client->shouldReceive('open')->twice();
$this->client->shouldReceive('send')->twice()->andReturn($responseFail);
$this->client->shouldReceive('close')->twice();
Expand Down

0 comments on commit 376e8c1

Please sign in to comment.