Skip to content

Commit f1383ed

Browse files
authored
Merge pull request #20 from laravel-notification-channels/laravel9
Support Laravel 9
2 parents 8c74a95 + ad73faf commit f1383ed

File tree

4 files changed

+36
-37
lines changed

4 files changed

+36
-37
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@
22

33
All notable changes to `microsoft-teams` will be documented in this file
44

5-
## 1.1.0 - 2021-01-05
5+
## 1.1.3 - 2022-06-21
6+
Update Readme to support Laravel 9.x
7+
8+
## 1.1.2 - 2022-06-03
69
Changed registered notification driver from 'teams' to 'microsoftTeams' to be consistent. Current Release now accepts both names.
710
Please use 'microsoftTeams' for all calls since 'teams' will be removed with the next major release.
811

12+
## 1.1.1 - 2022-01-21
13+
Support Laravel 9.x
14+
15+
## 1.1.0 - 2020-09-10
16+
Support Laravel 8.x
17+
918
## 1.0.1 - 2020-04-27
1019

1120
### Breaking Change

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/laravel-notification-channels/microsoft-teams/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-notification-channels/microsoft-teams/?branch=master)
99
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-notification-channels/microsoft-teams.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/microsoft-teams)
1010

11-
This package makes it easy to send notifications using [Microsoft Teams](https://products.office.com/en-US/microsoft-teams/group-chat-software) with Laravel 5.5+, 6.x, 7.x and 8.x
11+
This package makes it easy to send notifications using [Microsoft Teams](https://products.office.com/en-US/microsoft-teams/group-chat-software) with Laravel 5.5+, 6.x, 7.x, 8.x and 9.x
1212

1313
```php
1414
return MicrosoftTeamsMessage::create()

phpunit.xml.dist

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
verbose="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false">
12-
<testsuites>
13-
<testsuite name="MicrosoftTeams Test Suite">
14-
<directory>tests</directory>
15-
</testsuite>
16-
</testsuites>
17-
<filter>
18-
<whitelist>
19-
<directory suffix=".php">src/</directory>
20-
</whitelist>
21-
</filter>
22-
<logging>
23-
<log type="tap" target="build/report.tap"/>
24-
<log type="junit" target="build/report.junit.xml"/>
25-
<log type="coverage-html" target="build/coverage"/>
26-
<log type="coverage-text" target="build/coverage.txt"/>
27-
<log type="coverage-clover" target="build/logs/clover.xml"/>
28-
</logging>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">src/</directory>
6+
</include>
7+
<report>
8+
<clover outputFile="build/logs/clover.xml"/>
9+
<html outputDirectory="build/coverage"/>
10+
<text outputFile="build/coverage.txt"/>
11+
</report>
12+
</coverage>
13+
<testsuites>
14+
<testsuite name="MicrosoftTeams Test Suite">
15+
<directory>tests</directory>
16+
</testsuite>
17+
</testsuites>
18+
<logging>
19+
<junit outputFile="build/report.junit.xml"/>
20+
</logging>
2921
</phpunit>

tests/MicrosoftTeamsChannelTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,17 @@ public function it_can_send_a_notification()
5252

5353
$channel = new MicrosoftTeamsChannel($this->microsoftTeams);
5454

55-
$response = $channel->send(new TestNotifiable, new TestNotification);
55+
$response = $channel->send(new TestNotifiable(), new TestNotification());
5656
$this->assertEquals(200, $response->getStatusCode());
5757
}
5858

5959
/** @test */
6060
public function it_does_not_send_a_notification_if_the_notifiable_does_not_provide_a_microsoft_teams_channel()
6161
{
62-
$this->markTestSkipped('Needs to be solved in Laravel 9');
63-
6462
$this->expectException(CouldNotSendNotification::class);
6563

6664
$channel = new MicrosoftTeamsChannel($this->microsoftTeams);
67-
$channel->send(new TestNotifiableWithoutRoute, new TestNotificationNoWebhookUrl);
65+
$channel->send(new TestNotifiableWithoutRoute(), new TestNotificationNoWebhookUrl());
6866
}
6967

7068
/** @test */
@@ -87,7 +85,7 @@ public function it_does_send_a_notification_if_the_notifiable_does_not_provide_a
8785

8886
$channel = new MicrosoftTeamsChannel($this->microsoftTeams);
8987

90-
$response = $channel->send(new TestNotifiableWithoutRoute, new TestNotificationWithToParam);
88+
$response = $channel->send(new TestNotifiableWithoutRoute(), new TestNotificationWithToParam());
9189
$this->assertEquals(200, $response->getStatusCode());
9290
}
9391
}
@@ -120,7 +118,7 @@ class TestNotification extends Notification
120118
{
121119
public function toMicrosoftTeams()
122120
{
123-
return (new MicrosoftTeamsMessage)
121+
return (new MicrosoftTeamsMessage())
124122
->title('Hello, MicrosoftTeams!')
125123
->content('This is my content.');
126124
}
@@ -138,7 +136,7 @@ class TestNotificationNoWebhookUrl extends Notification
138136
*/
139137
public function toMicrosoftTeams($notifiable): MicrosoftTeamsMessage
140138
{
141-
return (new MicrosoftTeamsMessage)
139+
return (new MicrosoftTeamsMessage())
142140
->title('Hello, MicrosoftTeams!')
143141
->content('This is my content.');
144142
}
@@ -156,7 +154,7 @@ class TestNotificationWithToParam extends Notification
156154
*/
157155
public function toMicrosoftTeams($notifiable): MicrosoftTeamsMessage
158156
{
159-
return (new MicrosoftTeamsMessage)
157+
return (new MicrosoftTeamsMessage())
160158
->title('Hello, MicrosoftTeams!')
161159
->content('This is my content.')
162160
->to('https://outlook.office.com/webhook/abc-01234/IncomingWebhook/def-567');

0 commit comments

Comments
 (0)