ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
DeckTest Class Reference

Test on deck implementation. More...

+ Inheritance diagram for DeckTest:
+ Collaboration diagram for DeckTest:

Public Member Functions

 getFactory ()
 
 test_implements_factory_interface ()
 
 test_get_cards ()
 
 test_with_cards ()
 
 test_get_size ()
 
 test_with_size ()
 
 test_render_content ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null)
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Detailed Description

Test on deck implementation.

Definition at line 14 of file DeckTest.php.

Member Function Documentation

◆ getFactory()

DeckTest::getFactory ( )
Returns

Definition at line 20 of file DeckTest.php.

Referenced by test_get_cards(), test_get_size(), test_implements_factory_interface(), test_render_content(), test_with_cards(), and test_with_size().

21  {
22  return new \ILIAS\UI\Implementation\Factory(
23  $this->createMock(C\Counter\Factory::class),
24  $this->createMock(C\Glyph\Factory::class),
25  $this->createMock(C\Button\Factory::class),
26  $this->createMock(C\Listing\Factory::class),
27  $this->createMock(C\Image\Factory::class),
28  $this->createMock(C\Panel\Factory::class),
29  $this->createMock(C\Modal\Factory::class),
30  $this->createMock(C\Dropzone\Factory::class),
31  $this->createMock(C\Popover\Factory::class),
32  $this->createMock(C\Divider\Factory::class),
33  $this->createMock(C\Link\Factory::class),
34  $this->createMock(C\Dropdown\Factory::class),
35  $this->createMock(C\Item\Factory::class),
36  $this->createMock(C\Icon\Factory::class),
37  $this->createMock(C\ViewControl\Factory::class),
38  $this->createMock(C\Chart\Factory::class),
39  $this->createMock(C\Input\Factory::class),
40  $this->createMock(C\Table\Factory::class),
41  $this->createMock(C\MessageBox\Factory::class),
42  new I\Component\Card\Factory()
43  );
44  }
+ Here is the caller graph for this function:

◆ test_get_cards()

DeckTest::test_get_cards ( )

Definition at line 55 of file DeckTest.php.

References $c, $d, $f, and getFactory().

56  {
57  $f = $this->getFactory();
58  $c = $f->card()->standard("Card Title");
59  $d = $f->deck(array($c));
60 
61  $this->assertEquals($d->getCards(), array($c));
62  }
getFactory()
Definition: DeckTest.php:20
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:

◆ test_get_size()

DeckTest::test_get_size ( )

Definition at line 74 of file DeckTest.php.

References $c, $d, $f, and getFactory().

75  {
76  $f = $this->getFactory();
77 
78  $c = $f->card()->standard("Card Title");
79  $d = $f->deck(array($c));
80 
81  $this->assertEquals($d->getCardsSize(), C\Deck\Deck::SIZE_S);
82  }
getFactory()
Definition: DeckTest.php:20
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:

◆ test_implements_factory_interface()

DeckTest::test_implements_factory_interface ( )

Definition at line 46 of file DeckTest.php.

References $c, $f, and getFactory().

47  {
48  $f = $this->getFactory();
49 
50  $this->assertInstanceOf("ILIAS\\UI\\Factory", $f);
51  $c = $f->card()->standard("Card Title");
52  $this->assertInstanceOf("ILIAS\\UI\\Component\\Deck\\Deck", $f->deck(array($c)));
53  }
getFactory()
Definition: DeckTest.php:20
+ Here is the call graph for this function:

◆ test_render_content()

DeckTest::test_render_content ( )

Definition at line 110 of file DeckTest.php.

References $c, $d, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().

111  {
112  $r = $this->getDefaultRenderer();
113  $f = $this->getFactory();
114  $c = $f->card()->standard("Card Title");
115  $d = $f->deck(array($c));
116 
117  $d = $d->withCards(array($c,$c,$c,$c,$c,$c,$c))->withLargeCardsSize();
118 
119  $html = $r->render($d);
120 
121  $expected_html =
122  '<div class="il-deck">
123  <div class="row row-eq-height">
124  <div class="col-sm-12 col-md-4"><div class="il-card thumbnail"><div class="card-no-highlight"></div><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
125  <div class="col-sm-12 col-md-4"><div class="il-card thumbnail"><div class="card-no-highlight"></div><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
126  <div class="col-sm-12 col-md-4"><div class="il-card thumbnail"><div class="card-no-highlight"></div><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
127  </div>
128  <div class="row row-eq-height">
129  <div class="col-sm-12 col-md-4"><div class="il-card thumbnail"><div class="card-no-highlight"></div><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
130  <div class="col-sm-12 col-md-4"><div class="il-card thumbnail"><div class="card-no-highlight"></div><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
131  <div class="col-sm-12 col-md-4"><div class="il-card thumbnail"><div class="card-no-highlight"></div><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
132  </div>
133  <div class="row row-eq-height">
134  <div class="col-sm-12 col-md-4"><div class="il-card thumbnail"><div class="card-no-highlight"></div><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
135  </div>
136  </div>';
137 
138  $this->assertHTMLEquals($expected_html, $html);
139  }
getFactory()
Definition: DeckTest.php:20
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:228
$r
Definition: example_031.php:79
assertHTMLEquals($expected_html_as_string, $html_as_string)
Definition: Base.php:270
$html
Definition: example_001.php:87
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:

◆ test_with_cards()

DeckTest::test_with_cards ( )

Definition at line 64 of file DeckTest.php.

References $c, $d, $f, and getFactory().

65  {
66  $f = $this->getFactory();
67  $c = $f->card()->standard("Card Title");
68  $d = $f->deck(array($c));
69 
70  $d = $d->withCards(array($c,$c));
71  $this->assertEquals($d->getCards(), array($c,$c));
72  }
getFactory()
Definition: DeckTest.php:20
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:

◆ test_with_size()

DeckTest::test_with_size ( )

Definition at line 84 of file DeckTest.php.

References $c, $d, $f, and getFactory().

85  {
86  $f = $this->getFactory();
87 
88  $c = $f->card()->standard("Card Title");
89  $d = $f->deck(array($c));
90 
91  $d = $d->withExtraSmallCardsSize();
92  $this->assertEquals($d->getCardsSize(), C\Deck\Deck::SIZE_XS);
93 
94  $d = $d->withSmallCardsSize();
95  $this->assertEquals($d->getCardsSize(), C\Deck\Deck::SIZE_S);
96 
97  $d = $d->withNormalCardsSize();
98  $this->assertEquals($d->getCardsSize(), C\Deck\Deck::SIZE_M);
99 
100  $d = $d->withLargeCardsSize();
101  $this->assertEquals($d->getCardsSize(), C\Deck\Deck::SIZE_L);
102 
103  $d = $d->withExtraLargeCardsSize();
104  $this->assertEquals($d->getCardsSize(), C\Deck\Deck::SIZE_XL);
105 
106  $d = $d->withFullSizedCardsSize();
107  $this->assertEquals($d->getCardsSize(), C\Deck\Deck::SIZE_FULL);
108  }
getFactory()
Definition: DeckTest.php:20
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:

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