Skip to content

Commit 7dff9a9

Browse files
committed
Fix failing notifier option tests
- Fix Telegram InlineKeyboardButton import path and use inlineKeyboard() method - Update LinkedIn test expectations to include attributes array and fix AuthorShare constructor - Update RocketChat test expectations to match current empty array behavior
1 parent 3a1b5bc commit 7dff9a9

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/Symfony/Component/Notifier/Bridge/LinkedIn/Tests/LinkedInOptionsTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testLinkedInOptions()
3838

3939
public function testLinkedInOptionsWithAllMethods()
4040
{
41-
$author = new AuthorShare('urn:li:person:123456');
41+
$author = new AuthorShare('123456');
4242
$lifecycleState = new LifecycleStateShare('PUBLISHED');
4343
$visibility = new VisibilityShare();
4444
$specificContent = new ShareContentShare('Test content');
@@ -64,6 +64,7 @@ public function testLinkedInOptionsWithAllMethods()
6464
'specificContent' => [
6565
'com.linkedin.ugc.ShareContent' => [
6666
'shareCommentary' => [
67+
'attributes' => [],
6768
'text' => 'Test content',
6869
],
6970
'shareMediaCategory' => 'NONE',
@@ -90,6 +91,7 @@ public function testFromNotification()
9091
'specificContent' => [
9192
'com.linkedin.ugc.ShareContent' => [
9293
'shareCommentary' => [
94+
'attributes' => [],
9395
'text' => 'Test Content',
9496
],
9597
'shareMediaCategory' => 'NONE',
@@ -114,6 +116,7 @@ public function testFromNotificationWithoutContent()
114116
'specificContent' => [
115117
'com.linkedin.ugc.ShareContent' => [
116118
'shareCommentary' => [
119+
'attributes' => [],
117120
'text' => 'Test Subject Only',
118121
],
119122
'shareMediaCategory' => 'NONE',

src/Symfony/Component/Notifier/Bridge/RocketChat/Tests/RocketChatOptionsTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ public function testRocketChatOptionsWithChannel()
4040
$options = (new RocketChatOptions())
4141
->channel('#general');
4242

43-
$this->assertSame([
44-
'attachments' => [[]],
45-
], $options->toArray());
43+
$this->assertSame([], $options->toArray());
4644

4745
$this->assertSame('#general', $options->getRecipientId());
4846
}
@@ -98,8 +96,6 @@ public function testEmptyAttachments()
9896
{
9997
$options = new RocketChatOptions();
10098

101-
$this->assertSame([
102-
'attachments' => [[]],
103-
], $options->toArray());
99+
$this->assertSame([], $options->toArray());
104100
}
105101
}

src/Symfony/Component/Notifier/Bridge/Telegram/Tests/TelegramOptionsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use PHPUnit\Framework\Attributes\DataProvider;
1515
use PHPUnit\Framework\TestCase;
16-
use Symfony\Component\Notifier\Bridge\Telegram\Reply\Markup\InlineKeyboardButton;
16+
use Symfony\Component\Notifier\Bridge\Telegram\Reply\Markup\Button\InlineKeyboardButton;
1717
use Symfony\Component\Notifier\Bridge\Telegram\Reply\Markup\InlineKeyboardMarkup;
1818
use Symfony\Component\Notifier\Bridge\Telegram\TelegramOptions;
1919

@@ -120,7 +120,7 @@ public function testWithReplyMarkup()
120120
$button2->callbackData('callback_2');
121121

122122
$markup = new InlineKeyboardMarkup();
123-
$markup->addRow([$button1, $button2]);
123+
$markup->inlineKeyboard([$button1, $button2]);
124124

125125
$options = (new TelegramOptions())
126126
->chatId('123456')

0 commit comments

Comments
 (0)