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
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public function getRecipientId(): ?string
*/
public function recipient(string $path): self
{
if (!preg_match('/^\/webhook\//', $path)) {
throw new InvalidArgumentException(sprintf('"%s" require recipient id format to be "/webhook/{uuid}@{uuid}/IncomingWebhook/{id}/{uuid}", "%s" given.', __CLASS__, $path));
if (!preg_match('/^\/webhookb2\//', $path)) {
throw new InvalidArgumentException(sprintf('"%s" require recipient id format to be "/webhookb2/{uuid}@{uuid}/IncomingWebhook/{id}/{uuid}", "%s" given.', __CLASS__, $path));
}

$this->options['recipient_id'] = $path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MICROSOFT_TEAMS_DSN=microsoftteams://default/PATH
```

where:
- `PATH` has the following format: `webhook/{uuid}@{uuid}/IncomingWebhook/{id}/{uuid}`
- `PATH` has the following format: `webhookb2/{uuid}@{uuid}/IncomingWebhook/{id}/{uuid}`

Resources
---------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testFromNotification()
public function testGetRecipientIdReturnsRecipientWhenSetViaConstructor()
{
$options = new MicrosoftTeamsOptions([
'recipient_id' => $recipient = '/webhook/foo',
'recipient_id' => $recipient = '/webhookb2/foo',
]);

$this->assertSame($recipient, $options->getRecipientId());
Expand All @@ -39,7 +39,7 @@ public function testGetRecipientIdReturnsRecipientWhenSetViaConstructor()
public function testGetRecipientIdReturnsRecipientWhenSetSetter()
{
$options = (new MicrosoftTeamsOptions())
->recipient($recipient = '/webhook/foo');
->recipient($recipient = '/webhookb2/foo');

$this->assertSame($recipient, $options->getRecipientId());
}
Expand All @@ -58,7 +58,7 @@ public function testRecipientMethodThrowsIfValueDoesNotMatchRegex()
$recipient = 'foo';

$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(sprintf('"%s" require recipient id format to be "/webhook/{uuid}@{uuid}/IncomingWebhook/{id}/{uuid}", "%s" given.', MicrosoftTeamsOptions::class, $recipient));
$this->expectExceptionMessage(sprintf('"%s" require recipient id format to be "/webhookb2/{uuid}@{uuid}/IncomingWebhook/{id}/{uuid}", "%s" given.', MicrosoftTeamsOptions::class, $recipient));

$options->recipient($recipient);
}
Expand Down