4 require_once(
"libs/composer/vendor/autoload.php");
5 require_once(__DIR__ .
"/../../Base.php");
7 use \ILIAS\UI\Component as
C;
8 use \ILIAS\UI\Implementation as
I;
17 return new I\Component\Table\Factory(
25 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Table\\Factory",
$f);
27 $pt =
$f->presentation(
'title', array(),
function () {
29 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Table\\Presentation", $pt);
31 $this->assertEquals(
"title", $pt->getTitle());
32 $this->assertEquals(array(), $pt->getViewControls());
33 $this->assertInstanceOf(\Closure::class, $pt->getRowMapping());
36 ->withEnvironment(array(
'k' =>
'v'))
37 ->withData(array(
'dk' =>
'dv'));
38 $this->assertEquals(array(
'k' =>
'v'), $pt->getEnvironment());
39 $this->assertEquals(array(
'dk' =>
'dv'), $pt->getData());
46 $pt =
$f->presentation(
'title', array(),
function () {
49 '<div class="il-table-presentation">' .
50 ' <h3 class="ilHeader">title</h3>' .
51 ' <div class="il-table-presentation-data"> </div>' .
59 $pt =
$f->presentation(
'title', array(),
function () {
61 $row = new \ILIAS\UI\Implementation\Component\Table\PresentationRow($pt->getSignalGenerator());
63 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Table\\PresentationRow",
$row);
64 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Signal",
$row->getShowSignal());
65 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Signal",
$row->getCloseSignal());
66 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Signal",
$row->getToggleSignal());
70 $row->withHeadline(
"headline")->getHeadline()
74 $row->withSubheadline(
"subheadline")->getSubheadline()
78 $row->withImportantFields(array(
"f1" =>
"v1"))->getImportantFields()
82 $row->withFurtherFieldsHeadline(
"field_headline")->getFurtherFieldsHeadline()
85 array(
"ff1" =>
"fv1"),
86 $row->withFurtherFields(array(
"ff1" =>
"fv1"))->getFurtherFields()
Tests for Presentation Table.
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Provides common functionality for UI tests.
assertHTMLEquals($expected_html_as_string, $html_as_string)