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

Public Member Functions

 testPropertyListingConstruction ()
 
 testPropertyListingWithProperty ()
 
 testPropertyListingWithItems ()
 
 testPropertyListingRendering ()
 
- 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

 getListingFactory ()
 
- 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

Definition at line 24 of file PropertyListingTest.php.

Member Function Documentation

◆ getListingFactory()

PropertyListingTest::getListingFactory ( )
protected

Definition at line 26 of file PropertyListingTest.php.

Referenced by testPropertyListingConstruction(), testPropertyListingRendering(), testPropertyListingWithItems(), and testPropertyListingWithProperty().

26  : Listing\Factory
27  {
28  return new Listing\Factory();
29  }
+ Here is the caller graph for this function:

◆ testPropertyListingConstruction()

PropertyListingTest::testPropertyListingConstruction ( )

Definition at line 31 of file PropertyListingTest.php.

References getListingFactory().

31  : void
32  {
33  $pl = $this->getListingFactory()->property();
34  $this->assertInstanceOf(I\Listing\Listing::class, $pl);
35  $this->assertInstanceOf(I\Listing\Property::class, $pl);
36  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ testPropertyListingRendering()

PropertyListingTest::testPropertyListingRendering ( )

Definition at line 64 of file PropertyListingTest.php.

References ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getListingFactory().

64  : void
65  {
66  $props = [
67  ['label1', 'value1', true],
68  ['label2', 'value2', false]
69  ];
70  $pl = $this->getListingFactory()->property()
71  ->withItems($props);
72 
73  $expected = $this->brutallyTrimHTML('
74 <div class="l-bar__space-keeper c-listing-property">
75  <div class="l-bar__group c-listing-property__property">
76  <span class="l-bar__element c-listing-property__propertylabel">label1</span>
77  <span class="l-bar__element c-listing-property__propertyvalue">value1</span>
78  </div>
79  <div class="l-bar__group c-listing-property__property">
80  <span class="l-bar__element c-listing-property__propertyvalue">value2</span>
81  </div>
82 </div>
83  ');
84 
85  $this->assertEquals(
86  $expected,
87  $this->brutallyTrimHTML($this->getDefaultRenderer()->render($pl))
88  );
89  }
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
+ Here is the call graph for this function:

◆ testPropertyListingWithItems()

PropertyListingTest::testPropertyListingWithItems ( )

Definition at line 51 of file PropertyListingTest.php.

References getListingFactory().

51  : void
52  {
53  $props = [
54  ['label1', 'value1', true],
55  ['label2', 'value2', false]
56  ];
57  $pl = $this->getListingFactory()->property()
58  ->withProperty('overwritten', 'by props');
59 
60  $pl = $pl->withItems($props);
61  $this->assertEquals($props, $pl->getItems());
62  }
+ Here is the call graph for this function:

◆ testPropertyListingWithProperty()

PropertyListingTest::testPropertyListingWithProperty ( )

Definition at line 38 of file PropertyListingTest.php.

References getListingFactory().

38  : void
39  {
40  $props = [
41  ['label1', 'value1', true],
42  ['label2', 'value2', false]
43  ];
44  $pl = $this->getListingFactory()->property()
45  ->withProperty(...$props[0])
46  ->withProperty(...$props[1]);
47 
48  $this->assertEquals($props, $pl->getItems());
49  }
+ Here is the call graph for this function:

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