19 declare(strict_types=1);
    21 require_once(__DIR__ . 
"/../../../../../libs/composer/vendor/autoload.php");
    22 require_once(__DIR__ . 
"/../../../Base.php");
    23 require_once(__DIR__ . 
"/InputTest.php");
    42         $df = 
new Data\Factory();
    43         $language = $this->createMock(ilLanguage::class);
    44         return new I\Input\Field\Factory(
    57         $text = 
$f->text(
"label", 
"byline");
    59         $this->assertInstanceOf(\
ILIAS\
UI\
Component\Input\Container\Form\FormInput::class, $text);
    60         $this->assertInstanceOf(Field\Text::class, $text);
    68         $text = 
$f->text($label, $byline)->withNameFrom($this->name_source);
    74 <div class="form-group row">    75    <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label>         76    <div class="col-sm-8 col-md-9 col-lg-10">    77       <input id="id_1" type="text" name="name_0" class="form-control form-control-sm" />                    78       <div class="help-block">byline</div>    82         $this->assertEquals($expected, $html);
    91         $text = 
$f->text($label, $byline)->withNameFrom($this->name_source)->withError($error);
    97 <div class="form-group row">    98    <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label>    99    <div class="col-sm-8 col-md-9 col-lg-10">   100       <div class="help-block alert alert-danger" aria-describedby="id_1" role="alert">an_error</div>   101       <input id="id_1" type="text" name="name_0" class="form-control form-control-sm" />   102       <div class="help-block">byline</div>   106         $this->assertEquals($expected, $html);
   113         $text = 
$f->text($label)->withNameFrom($this->name_source);
   119 <div class="form-group row">   120    <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label>        121    <div class="col-sm-8 col-md-9 col-lg-10"><input id="id_1" type="text" name="name_0" class="form-control form-control-sm" /></div>   124         $this->assertEquals($expected, $html);
   132         $text = 
$f->text($label)->withValue($value)->withNameFrom($this->name_source);
   138 <div class="form-group row">   139    <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label>        140    <div class="col-sm-8 col-md-9 col-lg-10"><input id="id_1" type="text" value="value" name="name_0" class="form-control form-control-sm" /></div>   143         $this->assertEquals($expected, $html);
   151         $text = 
$f->text($label)->withValue($value)->withNameFrom($this->name_source);
   157 <div class="form-group row">   158    <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label>        159    <div class="col-sm-8 col-md-9 col-lg-10"><input id="id_1" type="text" value="0" name="name_0" class="form-control form-control-sm" /></div>   162         $this->assertEquals($expected, $html);
   169         $text = 
$f->text($label)->withNameFrom($this->name_source)->withRequired(
true);
   175 <div class="form-group row">   176    <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label<span class="asterisk">*</span></label>         177    <div class="col-sm-8 col-md-9 col-lg-10"><input id="id_1" type="text" name="name_0" class="form-control form-control-sm" /></div>   180         $this->assertEquals($expected, $html);
   187         $text = 
$f->text($label)->withNameFrom($this->name_source)->withDisabled(
true);
   193 <div class="form-group row">   194    <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label>        195    <div class="col-sm-8 col-md-9 col-lg-10"><input id="id_1" type="text" name="name_0" disabled="disabled" class="form-control form-control-sm" /></div>   198         $this->assertEquals($expected, $html);
   208         $this->assertEquals(4, $text->getMaxLength());
   210         $text1 = $text->withValue(
"1234");
   211         $this->assertEquals(
"1234", $text1->getValue());
   213         $this->expectException(InvalidArgumentException::class);
   214         $this->expectExceptionMessage(
"Argument 'value': Display value does not match input type.");
   215         $text->withValue(
"12345");
   222         $text = 
$f->text($label)->withNameFrom($this->name_source)->withMaxLength(8);
   228 <div class="form-group row">   229    <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label>        230    <div class="col-sm-8 col-md-9 col-lg-10">                            <input id="id_1" type="text" name="name_0" maxlength="8"  class="form-control form-control-sm" />                                       </div>   233         $this->assertEquals($expected, $html);
   241         $text = 
$f->text($label)->withNameFrom($this->name_source)->withRequired(
true);
   243         $text1 = $text->withInput(
new DefInputData([$name => 
"0"]));
   244         $value1 = $text1->getContent();
   245         $this->assertTrue($value1->isOk());
   246         $this->assertEquals(
"0", $value1->value());
   248         $text2 = $text->withInput(
new DefInputData([$name => 
""]));
   249         $value2 = $text2->getContent();
   250         $this->assertTrue($value2->isError());
   258             ->withNameFrom($this->name_source)
   259             ->withInput(
new DefInputData([$name => 
"<script>alert()</script>"]));
   261         $content = $text->getContent();
   262         $this->assertEquals(
"alert()", $content->value());
 getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
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...
 
Class ChatMainBarProvider . 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML. 
 
Provides common functionality for UI tests. 
 
testImplementsFactoryInterface()
 
DefNamesource $name_source
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...