mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°8772 - XML description traduction to PHP wip
This commit is contained in:
@@ -25,16 +25,16 @@ abstract class AbstractFormsTest extends ItopDataTestCase
|
||||
{
|
||||
public function GivenInput(string $sName, string $sType = StringIOFormat::class): FormInput
|
||||
{
|
||||
$oBlock = $this->GivenFormBlock($sName.'_block');
|
||||
$oBlock = $this->GivenFormBlock($sName);
|
||||
|
||||
return new FormInput($sName.'_input', $sType, $oBlock);
|
||||
return new FormInput($sName, $sType, $oBlock);
|
||||
}
|
||||
|
||||
public function GivenOutput(string $sName, string $sType = StringIOFormat::class): FormOutput
|
||||
{
|
||||
$oBlock = $this->GivenFormBlock($sName.'_block');
|
||||
$oBlock = $this->GivenFormBlock($sName);
|
||||
|
||||
return new FormOutput($sName.'_output', $sType, $oBlock);
|
||||
return new FormOutput($sName, $sType, $oBlock);
|
||||
}
|
||||
|
||||
public function GivenFormBlock(string $sName): FormBlock
|
||||
|
||||
@@ -67,7 +67,7 @@ class AbstractFormIOTest extends AbstractFormsTest
|
||||
* @return void
|
||||
* @throws \Combodo\iTop\Forms\IO\FormBlockIOException
|
||||
*/
|
||||
public function testNameFormatSupportsOnlyLettersUnderscoreAndNumbers(string $sName, bool $bGenerateException = true)
|
||||
public function testNameFormatSupportsOnlyLettersUnderscoreAndNumbersAndDot(string $sName, bool $bGenerateException = true)
|
||||
{
|
||||
|
||||
if ($bGenerateException) {
|
||||
@@ -75,7 +75,7 @@ class AbstractFormIOTest extends AbstractFormsTest
|
||||
}
|
||||
$oInput = $this->GivenInput($sName);
|
||||
if (!$bGenerateException) {
|
||||
$this->assertEquals($sName.'_input', $oInput->GetName());
|
||||
$this->assertEquals($sName, $oInput->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,12 +88,15 @@ class AbstractFormIOTest extends AbstractFormsTest
|
||||
'Percent not supported' => ['name%'],
|
||||
'Accent not supported' => ['namé'],
|
||||
'emoji not supported' => ['🎄🎄🎄🎄🎄'],
|
||||
'.name not supported' => ['.name'],
|
||||
'name. not supported' => ['name.'],
|
||||
|
||||
// Corrects
|
||||
'Numbers OK' => ['name123', false],
|
||||
'Starting with number OK' => ['123name123', false],
|
||||
'Underscore OK' => ['The_test_name', false],
|
||||
'Camel OK' => ['TheTestName', false],
|
||||
'name.subname OK' => ['name.subname', false],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user