Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"require": {
"php": ">=5.6.4",
"guzzlehttp/guzzle": "~6.0",
"illuminate/notifications": "5.3.*|5.4.*",
"illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*"
"illuminate/notifications": "5.3.*|5.4.*|5.5.*",
"illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*"
},
"require-dev": {
"mockery/mockery": "^0.9.5",
"phpunit/phpunit": "4.*",
"orchestra/testbench": "3.3.x-dev",
"orchestra/database": "3.3.x-dev"
"phpunit/phpunit": "4.*|~6.0",
"orchestra/testbench": "3.3.x-dev|^3.5.0",
"orchestra/database": "3.3.x-dev|^3.5.0"
},
"autoload": {
"psr-4": {
Expand Down
14 changes: 7 additions & 7 deletions tests/ChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace NotificationChannels\Webhook\Test;

use Mockery;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Response;
use Orchestra\Testbench\TestCase;
use Illuminate\Notifications\Notification;
use Mockery;
use NotificationChannels\Webhook\Exceptions\CouldNotSendNotification;
use NotificationChannels\Webhook\WebhookChannel;
use NotificationChannels\Webhook\WebhookMessage;
use Orchestra\Testbench\TestCase;

class ChannelTest extends TestCase
{
Expand All @@ -33,6 +32,7 @@ public function it_can_send_a_notification()
$channel = new WebhookChannel($client);
$channel->send(new TestNotifiable(), new TestNotification());
}

/** @test */
public function it_can_send_a_notification_with_2xx_status()
{
Expand All @@ -54,11 +54,12 @@ public function it_can_send_a_notification_with_2xx_status()
$channel->send(new TestNotifiable(), new TestNotification());
}

/** @test */
/**
* @expectedException NotificationChannels\Webhook\Exceptions\CouldNotSendNotification
* @test
*/
public function it_throws_an_exception_when_it_could_not_send_the_notification()
{
$this->setExpectedException(CouldNotSendNotification::class);

$response = new Response(500);
$client = Mockery::mock(Client::class);
$client->shouldReceive('post')
Expand All @@ -82,7 +83,6 @@ public function routeNotificationForWebhook()
}
}


class TestNotification extends Notification
{
public function toWebhook($notifiable)
Expand Down
3 changes: 2 additions & 1 deletion tests/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
namespace NotificationChannels\Webhook\Test;

use Illuminate\Support\Arr;
use Orchestra\Testbench\TestCase;
use NotificationChannels\Webhook\WebhookMessage;

class MessageTest extends \PHPUnit_Framework_TestCase
class MessageTest extends TestCase
{
/** @var \NotificationChannels\Webhook\WebhookMessage */
protected $message;
Expand Down