19 declare(strict_types=1);
    21 require_once(__DIR__ . 
"/../../../../../../../vendor/composer/vendor/autoload.php");
    22 require_once(__DIR__ . 
"/../../../Base.php");
    23 require_once(__DIR__ . 
"/InputTest.php");
    24 require_once(__DIR__ . 
"/CommonFieldRendering.php");
    45         $f = $this->getFieldFactory();
    47         $numeric = 
$f->numeric(
"label", 
"byline");
    49         $this->assertInstanceOf(\
ILIAS\
UI\
Component\Input\Container\Form\FormInput::class, $numeric);
    50         $this->assertInstanceOf(Field\Numeric::class, $numeric);
    56         $f = $this->getFieldFactory();
    59         $numeric = 
$f->numeric($label, $byline)->withNameFrom($this->name_source);
    61         $expected = $this->getFormWrappedHtml(
    62             'numeric-field-input',
    64             '<input id="id_1" type="number" name="name_0" class="c-field-number" />',
    68         $this->assertEquals($expected, $this->render($numeric));
    73         $f = $this->getFieldFactory();
    75         $numeric = 
$f->numeric($label)->withNameFrom($this->name_source);
    77         $this->testWithError($numeric);
    78         $this->testWithNoByline($numeric);
    79         $this->testWithRequired($numeric);
    80         $this->testWithDisabled($numeric);
    81         $this->testWithAdditionalOnloadCodeRendersId($numeric);
    86         $f = $this->getFieldFactory();
    89         $numeric = 
$f->numeric($label)->withValue($value)->withNameFrom($this->name_source);
    91         $expected = $this->getFormWrappedHtml(
    92             'numeric-field-input',
    94             '<input id="id_1" type="number" value="10" name="name_0" class="c-field-number" />',
    98         $this->assertEquals($expected, $this->render($numeric));
   103         $f = $this->getFieldFactory();
   105         $field = 
$f->numeric(
'')->withNameFrom($this->name_source);
   106         $field_required = $field->withRequired(
true);
   108         $value = $field->withInput($post_data)->getContent();
   109         $this->assertTrue($value->isOk());
   110         $this->assertNull($value->value());
   112         $value = $field_required->withInput($post_data)->getContent();
   113         $this->assertTrue($value->isError());
   123         $field_required = $field->withRequired(
true);
   125         $value = $field->withInput($post_data)->getContent();
   126         $this->assertTrue($value->isOk());
   127         $this->assertNull($value->value());
   129         $field_required = $field_required->withInput($post_data);
   130         $value = $field_required->getContent();
   131         $this->assertTrue($value->isError());
   140         $field_required = $field->withRequired(
true);
   142         $value = $field->withInput($post_data)->getContent();
   143         $this->assertTrue($value->isOk());
   144         $this->assertEquals(0, $value->value());
   146         $value = $field_required->withInput($post_data)->getContent();
   147         $this->assertTrue($value->isOK());
   148         $this->assertEquals(0, $value->value());
   157         $field_required = $field->withRequired(
true);
   159         $value = $field->withInput($post_data)->getContent();
   160         $this->assertTrue($value->isOk());
   162         $this->assertEquals(1, $value->value());
   164         $value = $field_required->withInput($post_data)->getContent();
   165         $this->assertTrue($value->isOK());
   166         $this->assertEquals(1, $value->value());
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
Interface Observer  Contains several chained tasks and infos about them. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...