ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
UrlInputTest Class Reference
+ Inheritance diagram for UrlInputTest:
+ Collaboration diagram for UrlInputTest:

Public Member Functions

 setUp ()
 
 testImplementsFactoryInterface ()
 
 testRendering ()
 
 testRenderValue ()
 
 testCommonRendering ()
 

Private Attributes

DefNamesource $name_source
 

Detailed Description

Definition at line 32 of file UrlInputTest.php.

Member Function Documentation

◆ setUp()

UrlInputTest::setUp ( )

Definition at line 38 of file UrlInputTest.php.

38  : void
39  {
40  $this->name_source = new DefNamesource();
41  }

◆ testCommonRendering()

UrlInputTest::testCommonRendering ( )

Definition at line 86 of file UrlInputTest.php.

References Vendor\Package\$f, $url, and null.

86  : void
87  {
88  $f = $this->getFieldFactory();
89  $url = $f->url('label', null)->withNameFrom($this->name_source);
90 
91  $this->testWithError($url);
92  $this->testWithNoByline($url);
93  $this->testWithRequired($url);
94  $this->testWithDisabled($url);
95  $this->testWithAdditionalOnloadCodeRendersId($url);
96  }
$url
Definition: shib_logout.php:66
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ testImplementsFactoryInterface()

UrlInputTest::testImplementsFactoryInterface ( )

Definition at line 43 of file UrlInputTest.php.

References $url.

43  : void
44  {
45  $factory = $this->getFieldFactory();
46  $url = $factory->url("Test Label", "Test Byline");
47 
48  $this->assertInstanceOf(\ILIAS\UI\Component\Input\Container\Form\FormInput::class, $url);
49  $this->assertInstanceOf(Field\Url::class, $url);
50  }
Interface Observer Contains several chained tasks and infos about them.
$url
Definition: shib_logout.php:66

◆ testRendering()

UrlInputTest::testRendering ( )

Definition at line 52 of file UrlInputTest.php.

References $renderer, and $url.

52  : void
53  {
54  $factory = $this->getFieldFactory();
55  $renderer = $this->getDefaultRenderer();
56  $label = "Test Label";
57  $byline = "Test Byline";
58  $url = $factory->url($label, $byline)->withNameFrom($this->name_source);
59  $expected = $this->getFormWrappedHtml(
60  'url-field-input',
61  $label,
62  '<input id="id_1" type="url" name="name_0" class="c-field-url" />',
63  $byline,
64  'id_1'
65  );
66  $this->assertEquals($expected, $this->render($url));
67  }
$renderer
$url
Definition: shib_logout.php:66

◆ testRenderValue()

UrlInputTest::testRenderValue ( )

Definition at line 69 of file UrlInputTest.php.

References $url, and null.

69  : void
70  {
71  $factory = $this->getFieldFactory();
72  $label = "Test Label";
73  $value = "https://www.ilias.de/";
74  $url = $factory->url($label)->withValue($value)
75  ->withNameFrom($this->name_source);
76  $expected = $this->getFormWrappedHtml(
77  'url-field-input',
78  $label,
79  '<input id="id_1" type="url" value="https://www.ilias.de/" name="name_0" class="c-field-url" />',
80  null,
81  'id_1'
82  );
83  $this->assertEquals($expected, $this->render($url));
84  }
$url
Definition: shib_logout.php:66
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

Field Documentation

◆ $name_source

DefNamesource UrlInputTest::$name_source
private

Definition at line 36 of file UrlInputTest.php.


The documentation for this class was generated from the following file: