Skip to content

Commit 2c048ad

Browse files
committed
Laravel 5.6 only
In a hurry, no time to mess with version constraints
1 parent 5bdb14f commit 2c048ad

File tree

7 files changed

+41
-18
lines changed

7 files changed

+41
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Discord notification channel for Laravel 5.1 to 5.6
1+
# Discord notification channel for Laravel 5.6
22

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-notification-channels/discord.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/discord)
44
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
}
1919
],
2020
"require": {
21-
"php": ">=5.6.4",
21+
"php": ">=7.1.2",
2222
"guzzlehttp/guzzle": "~6.0",
23-
"illuminate/notifications": "5.3.*|5.4.*|5.5.*|5.6.*",
24-
"illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*",
25-
"illuminate/queue": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*",
26-
"illuminate/console": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*",
23+
"illuminate/notifications": "5.6.*",
24+
"illuminate/support": "5.6.*",
25+
"illuminate/queue": "5.6.*",
26+
"illuminate/console": "5.6.*",
2727
"textalk/websocket": "1.0.*"
2828
},
2929
"require-dev": {
30-
"mockery/mockery": "^0.9.5",
31-
"orchestra/testbench": "3.1.*|3.2.*|3.3.*|3.4.*|3.5.*|3.6.*|3.6.x-dev",
32-
"laravel/framework": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*",
33-
"phpunit/phpunit": "4.*|6.*|7.*",
30+
"mockery/mockery": "^1.0",
31+
"orchestra/testbench": "3.6.*|3.6.x-dev",
32+
"laravel/framework": "5.6.*",
33+
"phpunit/phpunit": "7.*",
3434
"orchestra/database": "3.6.x-dev"
3535
},
3636
"autoload": {

tests/BaseTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace NotificationChannels\Discord\Tests;
4+
5+
use Mockery;
6+
7+
abstract class BaseTest extends \PHPUnit\Framework\TestCase
8+
{
9+
public function tearDown()
10+
{
11+
parent::tearDown();
12+
13+
if ($container = Mockery::getContainer()) {
14+
$this->addToAssertionCount($container->mockery_getExpectationCount());
15+
}
16+
17+
Mockery::close();
18+
}
19+
}

tests/DiscordChannelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use NotificationChannels\Discord\DiscordChannel;
1010
use NotificationChannels\Discord\DiscordMessage;
1111

12-
class DiscordChannelTest extends \PHPUnit_Framework_TestCase
12+
class DiscordChannelTest extends BaseTest
1313
{
1414
/** @test */
1515
public function it_can_send_a_notification()

tests/DiscordMessageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use NotificationChannels\Discord\DiscordMessage;
66

7-
class DiscordMessageTest extends \PHPUnit_Framework_TestCase
7+
class DiscordMessageTest extends BaseTest
88
{
99
/** @test */
1010
public function it_accepts_the_message_body_during_initialization()

tests/DiscordServiceProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use NotificationChannels\Discord\Commands\SetupCommand;
1010
use NotificationChannels\Discord\DiscordServiceProvider;
1111

12-
class DiscordServiceProviderTest extends \PHPUnit_Framework_TestCase
12+
class DiscordServiceProviderTest extends BaseTest
1313
{
1414
/** @test */
1515
public function it_loads_the_setup_command_and_provides_the_discord_token()

tests/DiscordTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use GuzzleHttp\Exception\RequestException;
1212
use NotificationChannels\Discord\Exceptions\CouldNotSendNotification;
1313

14-
class DiscordTest extends \PHPUnit_Framework_TestCase
14+
class DiscordTest extends BaseTest
1515
{
1616
/** @test */
1717
public function it_can_get_a_private_channel_for_a_user()
@@ -35,7 +35,8 @@ public function it_can_get_a_private_channel_for_a_user()
3535
/** @test */
3636
public function it_throws_an_exception_when_it_receives_an_http_error()
3737
{
38-
$this->setExpectedException(CouldNotSendNotification::class, 'Discord responded with an HTTP error: 404: Not found');
38+
$this->expectException(CouldNotSendNotification::class);
39+
$this->expectExceptionMessage('Discord responded with an HTTP error: 404: Not found');
3940

4041
$http = Mockery::mock(HttpClient::class);
4142
$http->shouldReceive('request')
@@ -56,7 +57,8 @@ public function it_throws_an_exception_when_it_receives_an_http_error()
5657
/** @test */
5758
public function it_throws_an_exception_when_it_could_not_talk_to_discord()
5859
{
59-
$this->setExpectedException(CouldNotSendNotification::class, 'Communication with Discord failed');
60+
$this->expectException(CouldNotSendNotification::class);
61+
$this->expectExceptionMessage('Communication with Discord failed');
6062

6163
$http = Mockery::mock(HttpClient::class);
6264
$http->shouldReceive('request')
@@ -77,7 +79,8 @@ public function it_throws_an_exception_when_it_could_not_talk_to_discord()
7779
/** @test */
7880
public function it_wraps_and_rethrows_a_caught_exception()
7981
{
80-
$this->setExpectedException(CouldNotSendNotification::class, 'Communication with Discord failed');
82+
$this->expectException(CouldNotSendNotification::class);
83+
$this->expectExceptionMessage('Communication with Discord failed');
8184

8285
$http = Mockery::mock(HttpClient::class);
8386
$http->shouldReceive('request')
@@ -98,7 +101,8 @@ public function it_wraps_and_rethrows_a_caught_exception()
98101
/** @test */
99102
public function it_throws_an_exception_if_the_api_responds_with_an_error()
100103
{
101-
$this->setExpectedException(CouldNotSendNotification::class, 'Discord responded with an API error: 10003: Unknown channel');
104+
$this->expectException(CouldNotSendNotification::class);
105+
$this->expectExceptionMessage('Discord responded with an API error: 10003: Unknown channel');
102106

103107
$http = Mockery::mock(HttpClient::class);
104108
$http->shouldReceive('request')

0 commit comments

Comments
 (0)