ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
KeyValueInterruptiveItemTest Class Reference
+ Inheritance diagram for KeyValueInterruptiveItemTest:
+ Collaboration diagram for KeyValueInterruptiveItemTest:

Public Member Functions

 setUp ()
 
 testGetKey ()
 
 testGetValue ()
 
 testRender ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getHelpTextRetriever ()
 
 getUploadLimitResolver ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Protected Member Functions

 getItem ()
 
- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

Private Attributes

string $id
 
string $key
 
string $value
 

Detailed Description

Definition at line 28 of file KeyValueInterruptiveItemTest.php.

Member Function Documentation

◆ getItem()

KeyValueInterruptiveItemTest::getItem ( )
protected

Definition at line 41 of file KeyValueInterruptiveItemTest.php.

Referenced by testGetKey(), testGetValue(), and testRender().

41  : KeyValue
42  {
43  return new KeyValue(
44  $this->id,
45  $this->key,
46  $this->value
47  );
48  }
+ Here is the caller graph for this function:

◆ setUp()

KeyValueInterruptiveItemTest::setUp ( )

Definition at line 34 of file KeyValueInterruptiveItemTest.php.

34  : void
35  {
36  $this->id = 'id';
37  $this->key = 'key';
38  $this->value = 'value';
39  }

◆ testGetKey()

KeyValueInterruptiveItemTest::testGetKey ( )

Definition at line 50 of file KeyValueInterruptiveItemTest.php.

References getItem().

50  : void
51  {
52  $item = $this->getItem();
53  $this->assertEquals($this->key, $item->getKey());
54  }
+ Here is the call graph for this function:

◆ testGetValue()

KeyValueInterruptiveItemTest::testGetValue ( )

Definition at line 56 of file KeyValueInterruptiveItemTest.php.

References getItem().

56  : void
57  {
58  $item = $this->getItem();
59  $this->assertEquals($this->value, $item->getValue());
60  }
+ Here is the call graph for this function:

◆ testRender()

KeyValueInterruptiveItemTest::testRender ( )

Definition at line 62 of file KeyValueInterruptiveItemTest.php.

References $r, ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getItem().

62  : void
63  {
64  $r = $this->getDefaultRenderer();
65  $html = $r->render($this->getItem());
66 
67  $expected = <<<EOT
68 <div class="c-modal--interruptive__items__key-value">
69  <dt class="c-modal--interruptive__items__key-value__key">
70  key <input type="hidden" name="interruptive_items[]" value="id">
71  </dt>
72  <dd class="c-modal--interruptive__items__key-value__value">
73  value
74  </dd>
75 </div>
76 EOT;
77 
78  $this->assertEquals(
79  $this->brutallyTrimHTML($expected),
80  $this->brutallyTrimHTML($html)
81  );
82  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:377
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition: Base.php:475
$r
+ Here is the call graph for this function:

Field Documentation

◆ $id

string KeyValueInterruptiveItemTest::$id
private

Definition at line 30 of file KeyValueInterruptiveItemTest.php.

◆ $key

string KeyValueInterruptiveItemTest::$key
private

Definition at line 31 of file KeyValueInterruptiveItemTest.php.

◆ $value

string KeyValueInterruptiveItemTest::$value
private

Definition at line 32 of file KeyValueInterruptiveItemTest.php.


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