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

Public Member Functions

 testGetItems ()
 
 testValidation ()
 
 testRendered ()
 
- Public Member Functions inherited from CharacteristicValueTest
 testInterfaces ()
 

Private Member Functions

 getExpectedHtml ()
 

Additional Inherited Members

- Protected Member Functions inherited from CharacteristicValueTest
 getCharacteristicValueFactory ()
 
 getTextItemsMock ()
 
 getInvalidTextItemsMocks ()
 

Detailed Description

Definition at line 23 of file CharacteristicValueTextTest.php.

Member Function Documentation

◆ getExpectedHtml()

CharacteristicValueTextTest::getExpectedHtml ( )
private

Definition at line 65 of file CharacteristicValueTextTest.php.

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 }

Referenced by testRendered().

+ Here is the caller graph for this function:

◆ testGetItems()

CharacteristicValueTextTest::testGetItems ( )

Definition at line 25 of file CharacteristicValueTextTest.php.

25 : void
26 {
28
29 $items = $this->getTextItemsMock();
30 $textListing = $f->text($items);
31 $this->assertEquals($items, $textListing->getItems());
32 }

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

+ Here is the call graph for this function:

◆ testRendered()

CharacteristicValueTextTest::testRendered ( )

Definition at line 51 of file CharacteristicValueTextTest.php.

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 }

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

+ Here is the call graph for this function:

◆ testValidation()

CharacteristicValueTextTest::testValidation ( )

Definition at line 34 of file CharacteristicValueTextTest.php.

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 }

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

+ Here is the call graph for this function:

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