Set('mentions.allowed_classes', ['@' => 'Person', '😊#' => 'Team']); // Emulate the "Case provider mechanism" (reason: the data provider requires utils constants not available before the application startup) $aTestedMentionedObjects = utils::GetMentionedObjectsFromText($sInput); $this->AssertArraysHaveSameItems($aExceptedMentionedObjects, $aTestedMentionedObjects); } /** * @since 3.0.0 */ public function GetMentionedObjectsFromTextProvider(): array { $sAbsUrlAppRoot = 'https://myitop.com/itop/'; return [ 'No object' => [ "Begining Second line End", [], ], '1 Object' => [ <<Beginning

Before link @Test PersonAfter link

End

HTML, [ 'Person' => ['12345'], ], ], 'Should not match 1 Object if the mention prefix is missing' => [ <<

Beginning

Before link #Test Ticket After link

HTML, [], ], 'Should return 2 Objects' => [ <<

Beginning

Before link @Test Person After link

And @Agatha Christie

End

HTML, [ 'Person' => ['12345', '3'], ], ], 'Should process objects of different classes' => [ <<😊#R-012345 After link And @Claude Monet End HTML, [ 'Team' => ['12345'], 'Person' => ['3'], ], ], ]; } }