ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

Referenced by testRendered().

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:

◆ testGetItems()

CharacteristicValueTextTest::testGetItems ( )

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:

◆ testRendered()

CharacteristicValueTextTest::testRendered ( )

Definition at line 51 of file CharacteristicValueTextTest.php.

References Vendor\Package\$f, $r, CharacteristicValueTest\getCharacteristicValueFactory(), 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  }
$r
+ Here is the call graph for this function:

◆ testValidation()

CharacteristicValueTextTest::testValidation ( )

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: