Skip to content

Commit 882fd8a

Browse files
committed
test(workflow): align talk conversation assertion
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent a336e81 commit 882fd8a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/php/Unit/Workflow/CreateTalkConversationProfileFieldChangeOperationTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ protected function setUp(): void {
3939
$this->groupManager = $this->createMock(IGroupManager::class);
4040
$this->userManager = $this->createMock(IUserManager::class);
4141
$l10n = $this->createMock(IL10N::class);
42-
$l10n->method('t')->willReturnArgument(0);
42+
$l10n->method('t')->willReturnCallback(static function (string $text, array $parameters = []): string {
43+
return $parameters === [] ? $text : vsprintf($text, $parameters);
44+
});
4345
$urlGenerator = $this->createMock(IURLGenerator::class);
4446
$urlGenerator->method('imagePath')
4547
->with('core', 'actions/comment.svg')
@@ -84,7 +86,7 @@ public function testOnEventCreatesConversationWhenTalkBackendIsAvailable(): void
8486
$this->broker->expects($this->once())
8587
->method('createConversation')
8688
->with(
87-
$this->stringContains('Department'),
89+
'Profile field change: Department for alice',
8890
$this->callback(function (array $moderators): bool {
8991
$this->assertCount(2, $moderators);
9092
return true;

0 commit comments

Comments
 (0)