ILIAS  release_8 Revision v8.23
CharacteristicValueTextTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for CharacteristicValueTextTest:
+ Collaboration diagram for CharacteristicValueTextTest:

Public Member Functions

 test_getItems ()
 
 test_validation ()
 
 test_rendered ()
 
- Public Member Functions inherited from CharacteristicValueTest
 test_interfaces ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 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)
 

Private Member Functions

 getExpectedHtml ()
 

Additional Inherited Members

- Protected Member Functions inherited from CharacteristicValueTest
 getCharacteristicValueFactory ()
 
 getTextItemsMock ()
 
 getInvalidTextItemsMocks ()
 
- 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...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 23 of file CharacteristicValueTextTest.php.

Member Function Documentation

◆ getExpectedHtml()

CharacteristicValueTextTest::getExpectedHtml ( )
private

Definition at line 65 of file CharacteristicValueTextTest.php.

Referenced by test_rendered().

65  : string
66  {
67  $html = '<div class="il-listing-characteristic-value clearfix">';
68  $html .= ' <div class="il-listing-characteristic-value-row clearfix">';
69  $html .= ' <div class="il-listing-characteristic-value-label">label1</div>';
70  $html .= ' <div class="il-listing-characteristic-value-item">item1</div>';
71  $html .= ' </div>';
72  $html .= ' <div class="il-listing-characteristic-value-row clearfix">';
73  $html .= ' <div class="il-listing-characteristic-value-label">label2</div>';
74  $html .= ' <div class="il-listing-characteristic-value-item">item2</div>';
75  $html .= ' </div>';
76  $html .= ' <div class="il-listing-characteristic-value-row clearfix">';
77  $html .= ' <div class="il-listing-characteristic-value-label">label3</div>';
78  $html .= ' <div class="il-listing-characteristic-value-item">item3</div>';
79  $html .= ' </div>';
80  $html .= '</div>';
81 
82  return $html;
83  }
+ Here is the caller graph for this function:

◆ test_getItems()

CharacteristicValueTextTest::test_getItems ( )

Definition at line 25 of file CharacteristicValueTextTest.php.

References Vendor\Package\$f, CharacteristicValueTest\getCharacteristicValueFactory(), and CharacteristicValueTest\getTextItemsMock().

25  : void
26  {
28 
29  $items = $this->getTextItemsMock();
30  $textListing = $f->text($items);
31  $this->assertEquals($items, $textListing->getItems());
32  }
+ Here is the call graph for this function:

◆ test_rendered()

CharacteristicValueTextTest::test_rendered ( )

Definition at line 51 of file CharacteristicValueTextTest.php.

References Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), CharacteristicValueTest\getCharacteristicValueFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), getExpectedHtml(), and CharacteristicValueTest\getTextItemsMock().

51  : void
52  {
54  $r = $this->getDefaultRenderer();
55 
56  $items = $this->getTextItemsMock();
57  $textListing = $f->text($items);
58  $actualHtml = $r->render($textListing);
59 
60  $expectedHtml = $this->getExpectedHtml();
61 
62  $this->assertHTMLEquals($expectedHtml, $actualHtml);
63  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
Definition: Base.php:427
+ Here is the call graph for this function:

◆ test_validation()

CharacteristicValueTextTest::test_validation ( )

Definition at line 34 of file CharacteristicValueTextTest.php.

References Vendor\Package\$e, Vendor\Package\$f, CharacteristicValueTest\getCharacteristicValueFactory(), and CharacteristicValueTest\getInvalidTextItemsMocks().

34  : void
35  {
37 
38  foreach ($this->getInvalidTextItemsMocks() as $invalidItemsMock) {
39  try {
40  $f->text($invalidItemsMock);
41 
42  $this->throwException(new Exception(
43  'expected InvalidArgumentException, catched none'
44  ));
45  } catch (InvalidArgumentException $e) {
46  $this->assertInstanceOf('InvalidArgumentException', $e);
47  }
48  }
49  }
+ Here is the call graph for this function:

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