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

Public Member Functions

 setUp ()
 
 testGetTitle ()
 
 testGetIcon ()
 
 testGetDescription ()
 
 testRender ()
 
 testRenderWithoutDescription ()
 
 testRenderWithoutIcon ()
 

Protected Member Functions

 getItem ()
 
 getItemWithoutDescription ()
 
 getItemWithoutIcon ()
 

Private Attributes

string $id
 
string $title
 
I Image Image $image
 
string $description
 

Detailed Description

Definition at line 28 of file StandardInterruptiveItemTest.php.

Member Function Documentation

◆ getItem()

StandardInterruptiveItemTest::getItem ( )
protected

Definition at line 43 of file StandardInterruptiveItemTest.php.

43 : Standard
44 {
45 return new Standard(
46 $this->id,
47 $this->title,
48 $this->image,
49 $this->description
50 );
51 }

Referenced by testGetDescription(), testGetIcon(), testGetTitle(), and testRender().

+ Here is the caller graph for this function:

◆ getItemWithoutDescription()

StandardInterruptiveItemTest::getItemWithoutDescription ( )
protected

Definition at line 53 of file StandardInterruptiveItemTest.php.

53 : Standard
54 {
55 return new Standard(
56 $this->id,
57 $this->title,
58 $this->image
59 );
60 }

Referenced by testGetDescription(), and testRenderWithoutDescription().

+ Here is the caller graph for this function:

◆ getItemWithoutIcon()

StandardInterruptiveItemTest::getItemWithoutIcon ( )
protected

Definition at line 62 of file StandardInterruptiveItemTest.php.

62 : Standard
63 {
64 return new Standard(
65 $this->id,
66 $this->title,
67 null,
68 $this->description
69 );
70 }

Referenced by testGetIcon(), and testRenderWithoutIcon().

+ Here is the caller graph for this function:

◆ setUp()

StandardInterruptiveItemTest::setUp ( )

Definition at line 35 of file StandardInterruptiveItemTest.php.

35 : void
36 {
37 $this->id = 'id';
38 $this->title = 'title';
39 $this->image = new I\Image\Image(C\Image\Image::STANDARD, 'path', 'alt');
40 $this->description = 'description';
41 }

◆ testGetDescription()

StandardInterruptiveItemTest::testGetDescription ( )

Definition at line 86 of file StandardInterruptiveItemTest.php.

86 : void
87 {
88 $item = $this->getItem();
89 $this->assertEquals($this->description, $item->getDescription());
90 $item = $this->getItemWithoutDescription();
91 $this->assertEquals('', $item->getDescription());
92 }

References getItem(), and getItemWithoutDescription().

+ Here is the call graph for this function:

◆ testGetIcon()

StandardInterruptiveItemTest::testGetIcon ( )

Definition at line 78 of file StandardInterruptiveItemTest.php.

78 : void
79 {
80 $item = $this->getItem();
81 $this->assertEquals($this->image, $item->getIcon());
82 $item = $this->getItemWithoutIcon();
83 $this->assertNull($item->getIcon());
84 }

References getItem(), and getItemWithoutIcon().

+ Here is the call graph for this function:

◆ testGetTitle()

StandardInterruptiveItemTest::testGetTitle ( )

Definition at line 72 of file StandardInterruptiveItemTest.php.

72 : void
73 {
74 $item = $this->getItem();
75 $this->assertEquals($this->title, $item->getTitle());
76 }

References getItem().

+ Here is the call graph for this function:

◆ testRender()

StandardInterruptiveItemTest::testRender ( )

Definition at line 94 of file StandardInterruptiveItemTest.php.

94 : void
95 {
96 $r = $this->getDefaultRenderer();
97 $html = $r->render($this->getItem());
98
99 $expected = <<<EOT
100<tr class="c-modal--interruptive__items__standard">
101 <td>
102 <img src="path" class="img-standard" alt="alt" />
103 </td>
104 <td>
105 title <br>
106 description
107 </td>
108 <td>
109 <input type="hidden" name="interruptive_items[]" value="id">
110 </td>
111</tr>
112EOT;
113
114 $this->assertEquals(
115 $this->brutallyTrimHTML($expected),
116 $this->brutallyTrimHTML($html)
117 );
118 }

References getItem().

+ Here is the call graph for this function:

◆ testRenderWithoutDescription()

StandardInterruptiveItemTest::testRenderWithoutDescription ( )

Definition at line 120 of file StandardInterruptiveItemTest.php.

120 : void
121 {
122 $r = $this->getDefaultRenderer();
123 $html = $r->render($this->getItemWithoutDescription());
124
125 $expected = <<<EOT
126<tr class="c-modal--interruptive__items__standard">
127 <td>
128 <img src="path" class="img-standard" alt="alt" />
129 </td>
130 <td>
131 title
132 </td>
133 <td>
134 <input type="hidden" name="interruptive_items[]" value="id">
135 </td>
136</tr>
137EOT;
138
139 $this->assertEquals(
140 $this->brutallyTrimHTML($expected),
141 $this->brutallyTrimHTML($html)
142 );
143 }

References getItemWithoutDescription().

+ Here is the call graph for this function:

◆ testRenderWithoutIcon()

StandardInterruptiveItemTest::testRenderWithoutIcon ( )

Definition at line 145 of file StandardInterruptiveItemTest.php.

145 : void
146 {
147 $r = $this->getDefaultRenderer();
148 $html = $r->render($this->getItemWithoutIcon());
149
150 $expected = <<<EOT
151<tr class="c-modal--interruptive__items__standard">
152 <td></td>
153 <td>
154 title <br>
155 description
156 </td>
157 <td>
158 <input type="hidden" name="interruptive_items[]" value="id">
159 </td>
160</tr>
161EOT;
162
163 $this->assertEquals(
164 $this->brutallyTrimHTML($expected),
165 $this->brutallyTrimHTML($html)
166 );
167 }

References getItemWithoutIcon().

+ Here is the call graph for this function:

Field Documentation

◆ $description

string StandardInterruptiveItemTest::$description
private

Definition at line 33 of file StandardInterruptiveItemTest.php.

◆ $id

string StandardInterruptiveItemTest::$id
private

Definition at line 30 of file StandardInterruptiveItemTest.php.

◆ $image

I Image Image StandardInterruptiveItemTest::$image
private

Definition at line 32 of file StandardInterruptiveItemTest.php.

◆ $title

string StandardInterruptiveItemTest::$title
private

Definition at line 31 of file StandardInterruptiveItemTest.php.


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