19 declare(strict_types=1);
    21 require_once(__DIR__ . 
"/../../../../../../../vendor/composer/vendor/autoload.php");
    22 require_once(__DIR__ . 
"/../../../Base.php");
    23 require_once(__DIR__ . 
"/CommonFieldRendering.php");
    41         $f = $this->getFieldFactory();
    43             $f->text(
"input1", 
"in 1"),
    44             $f->text(
"input2", 
"in 2")
    46         $label = 
'section label';
    47         $byline = 
'section byline';
    48         $section = 
$f->section(
$inputs, $label, $byline)->withNameFrom($this->name_source);
    49         $f1 = $this->getFormWrappedHtml(
    52             '<input id="id_1" type="text"  name="name_0/name_1" class="c-field-text" />',
    58         $f2 = $this->getFormWrappedHtml(
    61             '<input id="id_2" type="text"  name="name_0/name_2" class="c-field-text" />',
    67         $expected = $this->getFormWrappedHtml(
    68             'section-field-input',
    74         $this->assertEquals($expected, $this->render($section));
    80         $f = $this->getFieldFactory();
    84         $label = 
'section label';
    85         $section = 
$f->section(
$inputs, $label)->withNameFrom($this->name_source);
    87         $this->testWithError($section);
    88         $this->testWithNoByline($section);
    89         $this->testWithRequired($section);
    90         $this->testWithDisabled($section);
    91         $this->testWithAdditionalOnloadCodeRendersId($section);
    96         $f = $this->getFieldFactory();
    97         $inputs_level4 = [
$f->text(
"input3", 
"input3 byline")];
    98         $section_level4 = 
$f->section($inputs_level4, 
"Inner Section");
   100         $inputs_level3 = [
$f->text(
"input2", 
"input2 byline"), $section_level4];
   101         $section_level3 = 
$f->section($inputs_level3, 
"Middle Section");
   103         $inputs_level2 = [
$f->text(
"input1", 
"input1 byline"), $section_level3];
   104         $section_level2 = 
$f->section($inputs_level2, 
"Outermost Section");
   106         $nested_sections_html = $this->render($section_level2);
   108         $this->assertStringContainsString(
'<h2>Outermost Section</h2>', $nested_sections_html);
   109         $this->assertStringContainsString(
'<h3>Middle Section</h3>', $nested_sections_html);
   110         $this->assertStringContainsString(
'<h4>Inner Section</h4>', $nested_sections_html);
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...