ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
DynamicInputsNameSourceTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use PHPUnit\Framework\TestCase;
25
29class DynamicInputsNameSourceTest extends TestCase
30{
31 public function testNewNameGeneration(): void
32 {
33 $expected_parent_name = 'parent_input_name_xyz';
34
35 $name_source = new DynamicInputsNameSource($expected_parent_name);
36
37 $this->assertEquals(
38 $expected_parent_name . "[input_0][]",
39 $name_source->getNewName()
40 );
41
42 $this->assertEquals(
43 $expected_parent_name . "[input_1][]",
44 $name_source->getNewName()
45 );
46 }
47}
Other than the FormInputNameSource this name source is for inputs that can be dynamically added multi...