mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
✅ N°7571 - HTML2Text lib
This commit is contained in:
@@ -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 <a href=\"$sAbsUrlAppRoot/pages/UI.php&operation=details&class=UserRequest&id=12345&foo=bar\">R-012345</a> After link
|
||||
Before link <a href=\"$sAbsUrlAppRoot/pages/UI.php?operation=details&class=UserRequest&id=12345&foo=bar\">R-012345</a> After link
|
||||
End",
|
||||
utils::ENUM_TEXT_FORMAT_HTML,
|
||||
[
|
||||
@@ -675,8 +674,8 @@ class utilsTest extends ItopTestCase
|
||||
],
|
||||
'2 UserRequests' => [
|
||||
"Begining
|
||||
Before link <a href=\"$sAbsUrlAppRoot/pages/UI.php&operation=details&class=UserRequest&id=12345&foo=bar\">R-012345</a> After link
|
||||
And <a href=\"$sAbsUrlAppRoot/pages/UI.php&operation=details&class=UserRequest&id=987654&foo=bar\">R-987654</a>
|
||||
Before link <a href=\"$sAbsUrlAppRoot/pages/UI.php?operation=details&class=UserRequest&id=12345&foo=bar\">R-012345</a> After link
|
||||
And <a href=\"$sAbsUrlAppRoot/pages/UI.php&operation=details&class=UserRequest&id=987654&foo=bar\">R-987654</a>
|
||||
End",
|
||||
utils::ENUM_TEXT_FORMAT_HTML,
|
||||
[
|
||||
@@ -685,8 +684,8 @@ class utilsTest extends ItopTestCase
|
||||
],
|
||||
'1 UserRequest, 1 Person' => [
|
||||
"Begining
|
||||
Before link <a href=\"$sAbsUrlAppRoot/pages/UI.php&operation=details&class=UserRequest&id=12345&foo=bar\">R-012345</a> After link
|
||||
And <a href=\"$sAbsUrlAppRoot/pages/UI.php&operation=details&class=Person&id=3&foo=bar\">Claude Monet</a>
|
||||
Before link <a href=\"$sAbsUrlAppRoot/pages/UI.php?operation=details&class=UserRequest&id=12345&foo=bar\">R-012345</a> After link
|
||||
And <a href=\"$sAbsUrlAppRoot/pages/UI.php?operation=details&class=Person&id=3&foo=bar\">Claude Monet</a>
|
||||
End",
|
||||
utils::ENUM_TEXT_FORMAT_HTML,
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user