ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ()
 
 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 19 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().

19  {
20  return new \ILIAS\UI\Implementation\Factory();
21  }
+ Here is the caller graph for this function:

◆ test_get_cards()

DeckTest::test_get_cards ( )

Definition at line 31 of file DeckTest.php.

References $d, array, and getFactory().

31  {
32  $f = $this->getFactory();
33  $c = $f->card("Card Title");
34  $d = $f->deck(array($c));
35 
36  $this->assertEquals($d->getCards(), array($c));
37  }
getFactory()
Definition: DeckTest.php:19
for($col=0; $col< 50; $col++) $d
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ test_get_size()

DeckTest::test_get_size ( )

Definition at line 48 of file DeckTest.php.

References $d, array, and getFactory().

48  {
49  $f = $this->getFactory();
50 
51  $c = $f->card("Card Title");
52  $d = $f->deck(array($c));
53 
54  $this->assertEquals($d->getCardsSize(), C\Deck\Deck::SIZE_S);
55  }
getFactory()
Definition: DeckTest.php:19
for($col=0; $col< 50; $col++) $d
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ test_implements_factory_interface()

DeckTest::test_implements_factory_interface ( )

Definition at line 23 of file DeckTest.php.

References array, and getFactory().

23  {
24  $f = $this->getFactory();
25 
26  $this->assertInstanceOf("ILIAS\\UI\\Factory", $f);
27  $c = $f->card("Card Title");
28  $this->assertInstanceOf( "ILIAS\\UI\\Component\\Deck\\Deck", $f->deck(array($c)));
29  }
getFactory()
Definition: DeckTest.php:19
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ test_render_content()

DeckTest::test_render_content ( )

Definition at line 67 of file DeckTest.php.

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

67  {
68  $r = $this->getDefaultRenderer();
69  $f = $this->getFactory();
70  $c = $f->card("Card Title");
71  $d = $f->deck(array($c));
72 
73  $d = $d->withCards(array($c,$c,$c,$c,$c,$c,$c));
74  $d = $d->withCardsSize(C\Deck\Deck::SIZE_L);
75 
76  $html = $r->render($d);
77 
78  $expected_html =
79  '<div class="il-deck">
80  <div class="row">
81  <div class="col-md-4"><div class="il-card thumbnail"><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
82  <div class="col-md-4"><div class="il-card thumbnail"><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
83  <div class="col-md-4"><div class="il-card thumbnail"><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
84  </div>
85  <div class="row">
86  <div class="col-md-4"><div class="il-card thumbnail"><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
87  <div class="col-md-4"><div class="il-card thumbnail"><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
88  <div class="col-md-4"><div class="il-card thumbnail"><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
89  </div>
90  <div class="row">
91  <div class="col-md-4"><div class="il-card thumbnail"><div class="caption"><h5 class="card-title">Card Title</h5></div></div></div>
92  </div>
93  </div>';
94 
95  $this->assertHTMLEquals($expected_html, $html);
96  }
getFactory()
Definition: DeckTest.php:19
for($col=0; $col< 50; $col++) $d
$r
Definition: example_031.php:79
assertHTMLEquals($expected_html_as_string, $html_as_string)
Definition: Base.php:118
Create styles array
The data for the language used.
getDefaultRenderer()
Definition: Base.php:100
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ test_with_cards()

DeckTest::test_with_cards ( )

Definition at line 39 of file DeckTest.php.

References $d, array, and getFactory().

39  {
40  $f = $this->getFactory();
41  $c = $f->card("Card Title");
42  $d = $f->deck(array($c));
43 
44  $d = $d->withCards(array($c,$c));
45  $this->assertEquals($d->getCards(), array($c,$c));
46  }
getFactory()
Definition: DeckTest.php:19
for($col=0; $col< 50; $col++) $d
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ test_with_size()

DeckTest::test_with_size ( )

Definition at line 57 of file DeckTest.php.

References $d, array, and getFactory().

57  {
58  $f = $this->getFactory();
59 
60  $c = $f->card("Card Title");
61  $d = $f->deck(array($c));
62  $d = $d->withCardsSize(C\Deck\Deck::SIZE_L);
63 
64  $this->assertEquals($d->getCardsSize(), C\Deck\Deck::SIZE_L);
65  }
getFactory()
Definition: DeckTest.php:19
for($col=0; $col< 50; $col++) $d
Create styles array
The data for the language used.
+ Here is the call graph for this function:

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