File tree Expand file tree Collapse file tree 6 files changed +20
-20
lines changed Expand file tree Collapse file tree 6 files changed +20
-20
lines changed Original file line number Diff line number Diff line change 22build
33composer.phar
44composer.lock
5+ .phpunit.result.cache
Original file line number Diff line number Diff line change 1- # Webhook notifications channel for Laravel 5.5+ and 6.0
1+ # Webhook notifications channel for Laravel
22
33[ ![ Latest Version on Packagist] ( https://img.shields.io/packagist/v/laravel-notification-channels/webhook.svg?style=flat-square )] ( https://packagist.org/packages/laravel-notification-channels/webhook )
44[ ![ Software License] ( https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square )] ( LICENSE.md )
99[ ![ Code Coverage] ( https://img.shields.io/scrutinizer/coverage/g/laravel-notification-channels/webhook/master.svg?style=flat-square )] ( https://scrutinizer-ci.com/g/laravel-notification-channels/webhook/?branch=master )
1010[ ![ Total Downloads] ( https://img.shields.io/packagist/dt/laravel-notification-channels/webhook.svg?style=flat-square )] ( https://packagist.org/packages/laravel-notification-channels/webhook )
1111
12- This package makes it easy to send webhooks using the Laravel notification system.
12+ This package makes it easy to send webhooks using the Laravel notification system. Supports 5.5+. 6.x and 7.x.
1313
1414## Contents
1515
Original file line number Diff line number Diff line change 1111 }
1212 ],
1313 "require" : {
14- "php" : " >=7.0 " ,
14+ "php" : " >=7.2.5 " ,
1515 "guzzlehttp/guzzle" : " ~6.0" ,
16- "illuminate/notifications" : " ~5.5 || ~6.0" ,
17- "illuminate/support" : " ~5.5 || ~6.0"
16+ "illuminate/notifications" : " ~5.5 || ~6.0 || ~7.0 " ,
17+ "illuminate/support" : " ~5.5 || ~6.0 || ~7.0 "
1818 },
1919 "require-dev" : {
20- "mockery/mockery" : " ^0.9.5 " ,
21- "phpunit/phpunit" : " ~7.0 || ~ 8.0" ,
22- "orchestra/testbench" : " ^3.5 .0 || ^4.0" ,
23- "orchestra/database" : " ^3.5 .0 || ^4.0"
20+ "mockery/mockery" : " ^1.3 " ,
21+ "phpunit/phpunit" : " ^ 8.0" ,
22+ "orchestra/testbench" : " ^3.8 .0 || ^4.0 || ^5 .0" ,
23+ "orchestra/database" : " ^3.8 .0 || ^4.0 | ^5 .0"
2424 },
2525 "autoload" : {
2626 "psr-4" : {
Original file line number Diff line number Diff line change 33namespace NotificationChannels \Webhook ;
44
55use GuzzleHttp \Client ;
6- use Illuminate \Support \Arr ;
76use Illuminate \Notifications \Notification ;
7+ use Illuminate \Support \Arr ;
88use NotificationChannels \Webhook \Exceptions \CouldNotSendNotification ;
99
1010class WebhookChannel
@@ -32,7 +32,7 @@ public function __construct(Client $client)
3232 */
3333 public function send ($ notifiable , Notification $ notification )
3434 {
35- if (! $ url = $ notifiable ->routeNotificationFor ('Webhook ' )) {
35+ if (! $ url = $ notifiable ->routeNotificationFor ('webhook ' )) {
3636 return ;
3737 }
3838
Original file line number Diff line number Diff line change 22
33namespace NotificationChannels \Webhook \Test ;
44
5- use Mockery ;
65use GuzzleHttp \Client ;
76use GuzzleHttp \Psr7 \Response ;
8- use Orchestra \Testbench \TestCase ;
97use Illuminate \Notifications \Notification ;
8+ use Mockery ;
9+ use NotificationChannels \Webhook \Exceptions \CouldNotSendNotification ;
1010use NotificationChannels \Webhook \WebhookChannel ;
1111use NotificationChannels \Webhook \WebhookMessage ;
12- use NotificationChannels \ Webhook \ Exceptions \ CouldNotSendNotification ;
12+ use Orchestra \ Testbench \ TestCase ;
1313
1414class ChannelTest extends TestCase
1515{
@@ -89,16 +89,15 @@ public function it_can_send_a_notification_with_query_string()
8989 }
9090
9191 /**
92- * @expectedException NotificationChannels\Webhook\Exceptions\CouldNotSendNotification
9392 * @test
9493 */
9594 public function it_throws_an_exception_when_it_could_not_send_the_notification ()
9695 {
9796 $ response = new Response (500 );
9897
99- $ this ->expectExceptionObject (
100- new CouldNotSendNotification ( $ response , 'Webhook responded with an error: `` ' , 500 )
101- );
98+ $ this ->expectException (CouldNotSendNotification::class);
99+ $ this -> expectExceptionMessage ( 'Webhook responded with an error: `` ' );
100+ $ this -> expectExceptionCode ( 500 );
102101
103102 $ client = Mockery::mock (Client::class);
104103 $ client ->shouldReceive ('post ' )
Original file line number Diff line number Diff line change 33namespace NotificationChannels \Webhook \Test ;
44
55use Illuminate \Support \Arr ;
6- use Orchestra \Testbench \TestCase ;
76use NotificationChannels \Webhook \WebhookMessage ;
7+ use Orchestra \Testbench \TestCase ;
88
99class MessageTest extends TestCase
1010{
1111 /** @var \NotificationChannels\Webhook\WebhookMessage */
1212 protected $ message ;
1313
14- public function setUp ()
14+ public function setUp (): void
1515 {
1616 parent ::setUp ();
1717 $ this ->message = new WebhookMessage ();
You can’t perform that action at this time.
0 commit comments