diff --git a/tests/php-unit-tests/unitary-tests/application/utilsTest.php b/tests/php-unit-tests/unitary-tests/application/utilsTest.php index c122db8aa..ec1ec4cfc 100644 --- a/tests/php-unit-tests/unitary-tests/application/utilsTest.php +++ b/tests/php-unit-tests/unitary-tests/application/utilsTest.php @@ -632,21 +632,20 @@ class utilsTest extends ItopTestCase } /** + * @dataProvider GetMentionedObjectsFromTextProvider * @covers utils::GetMentionedObjectsFromText * * @throws \Exception */ - public function testGetMentionedObjectsFromText() + public function testGetMentionedObjectsFromText($sInput, $sFormat, $aExceptedMentionedObjects) { // Emulate the "Case provider mechanism" (reason: the data provider requires utils constants not available before the application startup) - foreach ($this->GetMentionedObjectsFromTextProvider() as $sCase => list($sInput, $sFormat, $aExceptedMentionedObjects)) { - $aTestedMentionedObjects = utils::GetMentionedObjectsFromText($sInput, $sFormat); + $aTestedMentionedObjects = utils::GetMentionedObjectsFromText($sInput, $sFormat); - $sExpectedAsString = print_r($aExceptedMentionedObjects, true); - $sTestedAsString = print_r($aTestedMentionedObjects, true); + $sExpectedAsString = print_r($aExceptedMentionedObjects, true); + $sTestedAsString = print_r($aTestedMentionedObjects, true); - $this->assertEquals($sTestedAsString, $sExpectedAsString, "Case '$sCase': Found mentioned objects don't match. Got: $sTestedAsString, expected $sExpectedAsString"); - } + $this->assertEquals($sTestedAsString, $sExpectedAsString, "Found mentioned objects don't match. Got: $sTestedAsString, expected $sExpectedAsString"); } /** @@ -666,7 +665,7 @@ class utilsTest extends ItopTestCase ], '1 UserRequest' => [ "Begining - Before link R-012345 After link + Before link R-012345 After link End", utils::ENUM_TEXT_FORMAT_HTML, [ @@ -675,8 +674,8 @@ class utilsTest extends ItopTestCase ], '2 UserRequests' => [ "Begining - Before link R-012345 After link - And R-987654 + Before link R-012345 After link + And R-987654 End", utils::ENUM_TEXT_FORMAT_HTML, [ @@ -685,8 +684,8 @@ class utilsTest extends ItopTestCase ], '1 UserRequest, 1 Person' => [ "Begining - Before link R-012345 After link - And Claude Monet + Before link R-012345 After link + And Claude Monet End", utils::ENUM_TEXT_FORMAT_HTML, [