Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
Removed version constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
gpressutto5 committed Dec 27, 2023
1 parent ae0aaa8 commit c9da40a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Slack notification for Laravel as it should be.
Easy, fast, simple and **highly testable**.
Since it uses On-Demand Notifications, it requires Laravel 5.5 or higher.

> **This library is archived** and no longer maintained. It works as expected, but I don't have time to maintain it anymore. As a last update, I've removed version constraints from the `composer.json` file, so you can use it with any future Laravel versions. Feel free to fork it and use it as you wish.
## Installation

Require this package in your composer.json and update your dependencies:
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
],
"require": {
"php": ">=7.1.3",
"guzzlehttp/guzzle": "^6.3 || ^7.0",
"illuminate/notifications": "^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
"illuminate/support": "^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
"laravel/slack-notification-channel": "^2.0"
"guzzlehttp/guzzle": ">=6.3",
"illuminate/notifications": ">=5.8",
"illuminate/support": ">=5.8",
"laravel/slack-notification-channel": ">=2.0"
},
"require-dev": {
"orchestra/testbench": "*",
"phpunit/phpunit": "^7.0 || ^8.5.28 || ^9.0"
"phpunit/phpunit": ">=7.0"
},
"autoload": {
"psr-4": {
Expand Down
17 changes: 13 additions & 4 deletions tests/SlackFakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Notifications\Messages\SlackMessage;
use Illuminate\Support\Facades\Notification;
use PHPUnit\Framework\Constraint\ExceptionMessage;
use PHPUnit\Framework\Constraint\ExceptionMessageIsOrContains;
use PHPUnit\Framework\ExpectationFailedException;
use Pressutto\LaravelSlack\Facades\Slack;
use Pressutto\LaravelSlack\Notifications\SimpleSlack;
Expand All @@ -30,7 +31,7 @@ public function testAssertSentCount()
$fake->assertSentCount(1);
$this->fail();
} catch (ExpectationFailedException $e) {
$this->assertThat($e, new ExceptionMessage('The number of messages sent was 0 instead of 1'));
$this->assertExceptionMessage($e, 'The number of messages sent was 0 instead of 1');
}

\Slack::send('FAKE');
Expand All @@ -51,7 +52,7 @@ public function testAssertSentString()
});
$this->fail();
} catch (ExpectationFailedException $e) {
$this->assertThat($e, new ExceptionMessage('The number of messages sent was 0 instead of 1'));
$this->assertExceptionMessage($e, 'The number of messages sent was 0 instead of 1');
}

$fake->assertSent(function (SlackMessage $message) {
Expand All @@ -73,12 +74,20 @@ public function testAssertSentSlackMessage()
});
$this->fail();
} catch (ExpectationFailedException $e) {
$this->assertThat($e,
new ExceptionMessage('The number of messages sent was 0 instead of 1'));
$this->assertExceptionMessage($e, 'The number of messages sent was 0 instead of 1');
}

$fake->assertSent(function (SlackMessage $message) use ($messageSent) {
return $message === $messageSent;
});
}

public function assertExceptionMessage(\Exception $e, string $message): void
{
if (class_exists(ExceptionMessage::class)) {
$this->assertThat($e, new ExceptionMessage($message));
} else {
$this->assertThat($e, new ExceptionMessageIsOrContains($message));
}
}
}

0 comments on commit c9da40a

Please sign in to comment.