mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Merge remote-tracking branch 'origin/support/3.0' into develop
This commit is contained in:
@@ -434,7 +434,7 @@ class UtilsTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase
|
||||
public function testToAcronym(string $sInput, string $sExceptedAcronym)
|
||||
{
|
||||
$sTestedAcronym = utils::ToAcronym($sInput);
|
||||
$this->assertEquals($sTestedAcronym, $sExceptedAcronym, "Acronym for '$sInput' doesn't match. Got '$sTestedAcronym', expected '$sExceptedAcronym'.");
|
||||
$this->assertEquals($sExceptedAcronym, $sTestedAcronym, "Acronym for '$sInput' doesn't match. Got '$sTestedAcronym', expected '$sExceptedAcronym'.");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -479,6 +479,10 @@ class UtilsTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase
|
||||
'Jada Pinkett-smith',
|
||||
'JP',
|
||||
],
|
||||
'Several words, cyrillic alphabet' => [
|
||||
'Денис Александра',
|
||||
'ДА',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -550,6 +554,40 @@ class UtilsTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider FormatInitialsForMedallionProvider
|
||||
* @covers utils::FormatInitialsForMedallion
|
||||
*
|
||||
* @param string $sInput
|
||||
* @param string $sExpected
|
||||
*/
|
||||
public function testFormatInitialsForMedallion(string $sInput, string $sExpected)
|
||||
{
|
||||
$sTested = utils::FormatInitialsForMedallion($sInput);
|
||||
$this->assertEquals($sExpected, $sTested);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.0.1
|
||||
*/
|
||||
public function FormatInitialsForMedallionProvider()
|
||||
{
|
||||
return [
|
||||
'All letters kept (2)' => [
|
||||
'AB',
|
||||
'AB',
|
||||
],
|
||||
'All letters kept (3)' => [
|
||||
'ABC',
|
||||
'ABC',
|
||||
],
|
||||
'Only 3 first letters kept (4)' => [
|
||||
'ABCD',
|
||||
'ABC',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sExpressionToConvert
|
||||
* @param int $iExpectedConvertedValue
|
||||
|
||||
Reference in New Issue
Block a user