ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PropertyListingTest Class Reference
+ Inheritance diagram for PropertyListingTest:
+ Collaboration diagram for PropertyListingTest:

Public Member Functions

 testPropertyListingConstruction ()
 
 testPropertyListingWithProperty ()
 
 testPropertyListingWithItems ()
 
 testPropertyListingRendering ()
 

Protected Member Functions

 getListingFactory ()
 

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.

26 : Listing\Factory
27 {
28 return new Listing\Factory(
29 new Listing\Workflow\Factory(),
30 new Listing\CharacteristicValue\Factory(),
31 new Listing\Entity\Factory(),
32 );
33 }

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

+ Here is the caller graph for this function:

◆ testPropertyListingConstruction()

PropertyListingTest::testPropertyListingConstruction ( )

Definition at line 35 of file PropertyListingTest.php.

35 : void
36 {
37 $pl = $this->getListingFactory()->property();
38 $this->assertInstanceOf(I\Listing\Listing::class, $pl);
39 $this->assertInstanceOf(I\Listing\Property::class, $pl);
40 }

References getListingFactory().

+ Here is the call graph for this function:

◆ testPropertyListingRendering()

PropertyListingTest::testPropertyListingRendering ( )

Definition at line 68 of file PropertyListingTest.php.

68 : void
69 {
70 $props = [
71 ['label1', 'value1', true],
72 ['label2', 'value2', false]
73 ];
74 $pl = $this->getListingFactory()->property()
75 ->withItems($props);
76
77 $expected = $this->brutallyTrimHTML('
78<div class="l-bar__space-keeper c-listing-property">
79 <div class="l-bar__group c-listing-property__property">
80 <span class="l-bar__element c-listing-property__propertylabel">label1</span>
81 <span class="l-bar__element c-listing-property__propertyvalue">value1</span>
82 </div>
83 <div class="l-bar__group c-listing-property__property">
84 <span class="l-bar__element c-listing-property__propertyvalue">value2</span>
85 </div>
86</div>
87 ');
88
89 $this->assertEquals(
90 $expected,
91 $this->brutallyTrimHTML($this->getDefaultRenderer()->render($pl))
92 );
93 }

References getListingFactory().

+ Here is the call graph for this function:

◆ testPropertyListingWithItems()

PropertyListingTest::testPropertyListingWithItems ( )

Definition at line 55 of file PropertyListingTest.php.

55 : void
56 {
57 $props = [
58 ['label1', 'value1', true],
59 ['label2', 'value2', false]
60 ];
61 $pl = $this->getListingFactory()->property()
62 ->withProperty('overwritten', 'by props');
63
64 $pl = $pl->withItems($props);
65 $this->assertEquals($props, $pl->getItems());
66 }

References getListingFactory().

+ Here is the call graph for this function:

◆ testPropertyListingWithProperty()

PropertyListingTest::testPropertyListingWithProperty ( )

Definition at line 42 of file PropertyListingTest.php.

42 : void
43 {
44 $props = [
45 ['label1', 'value1', true],
46 ['label2', 'value2', false]
47 ];
48 $pl = $this->getListingFactory()->property()
49 ->withProperty(...$props[0])
50 ->withProperty(...$props[1]);
51
52 $this->assertEquals($props, $pl->getItems());
53 }

References getListingFactory().

+ Here is the call graph for this function:

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