19 declare(strict_types=1);
47 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Entity\\Standard", $entity);
48 $this->assertEquals(
'primary', $entity->getPrimaryIdentifier());
49 $this->assertEquals(
'secondary', $entity->getSecondaryIdentifier());
55 $this->assertEquals([$this->
legacy(
'bc')], $entity->withBlockingAvailabilityConditions($this->legacy(
'bc'))->getBlockingAvailabilityConditions());
56 $this->assertEquals([$this->
legacy(
'fp')], $entity->withFeaturedProperties($this->legacy(
'fp'))->getFeaturedProperties());
57 $this->assertEquals([$this->
legacy(
'md')], $entity->withMainDetails($this->legacy(
'md'))->getMainDetails());
58 $this->assertEquals([$this->
legacy(
'ps')], $entity->withPersonalStatus($this->legacy(
'ps'))->getPersonalStatus());
59 $this->assertEquals([$this->
legacy(
'a')], $entity->withAvailability($this->legacy(
'a'))->getAvailability());
60 $this->assertEquals([$this->
legacy(
'd')], $entity->withDetails($this->legacy(
'd'))->getDetails());
65 $shy_button =
new Button\Shy(
'the label',
'#');
66 $shy_link =
new Link\Standard(
'the label',
'#');
67 $image =
new Image\Image(
I\
Image\Image::STANDARD,
'source',
'alt');
84 $this->assertEquals($identifier, $entity->getPrimaryIdentifier());
85 $this->assertEquals($identifier, $entity->getSecondaryIdentifier());
91 $tag =
new Button\Tag(
'tag',
'#');
92 $shy =
new Button\Shy(
'shy',
'#');
94 ->withPrioritizedReactions($glyph, $tag)
95 ->withReactions($glyph, $glyph, $glyph)
98 $this->assertEquals([$glyph, $tag], $entity->getPrioritizedReactions());
99 $this->assertEquals([$glyph,$glyph,$glyph], $entity->getReactions());
100 $this->assertEquals([$shy], $entity->getActions());
106 $tag =
new Button\Tag(
'tag',
'#');
107 $shy =
new Button\Shy(
'shy',
'#');
109 ->withPrioritizedReactions($glyph, $tag)
110 ->withReactions($glyph)
113 $this->assertEquals([$glyph, $tag], $entity->getPrioritizedReactions());
114 $this->assertEquals([$glyph], $entity->getReactions());
115 $this->assertEquals([$shy], $entity->getActions());
131 $tag =
new Button\Tag(
'tag',
'#');
132 $shy =
new Button\Shy(
'shy',
'#');
134 ->withPrioritizedReactions($glyph, $tag)
135 ->withReactions($glyph, $glyph)
136 ->withActions($shy, $shy)
137 ->withBlockingAvailabilityConditions($this->
legacy(
'bc'))
138 ->withFeaturedProperties($this->
legacy(
'fp'))
139 ->withMainDetails($this->
legacy(
'md'))
140 ->withPersonalStatus($this->
legacy(
'ps'))
141 ->withAvailability($this->
legacy(
'a'))
142 ->withDetails($this->
legacy(
'd'));
144 $r = $this->getDefaultRenderer();
145 $html = $this->brutallyTrimHTML(
$r->render($entity));
146 $expected = $this->brutallyTrimHTML(
' 147 <div class="c-entity __container"> 148 <div class="c-entity __blocking-conditions">bc</div> 149 <div class="c-entity __actions"> 150 <div class="dropdown" id="id_9"> 151 <button class="btn btn-default dropdown-toggle" type="button" aria-label="actions" aria-haspopup="true" aria-expanded="false" aria-controls="id_9_menu"><span class="caret"></span></button> 152 <ul id="id_9_menu" class="dropdown-menu"> 153 <li><button class="btn btn-link" data-action="#" id="id_7">shy</button></li> 154 <li><button class="btn btn-link" data-action="#" id="id_8">shy</button></li> 158 <div class="c-entity __secondary-identifier --string ">secondary</div> 159 <div class="c-entity __primary-identifier">primary</div> 160 <div class="c-entity __featured">fp</div> 161 <div class="c-entity __personal-status">ps</div> 162 <div class="c-entity __main-details">md</div> 163 <div class="c-entity __availability">a</div> 164 <div class="c-entity __details">d</div> 165 <div class="c-entity __reactions"> 166 <a class="glyph" aria-label="some glyph"><span class="glyphicon il-glyphicon-laugh" aria-hidden="true"></span></a> 167 <a class="glyph" aria-label="some glyph"><span class="glyphicon il-glyphicon-laugh" aria-hidden="true"></span></a> 169 <div class="c-entity __featured-reactions"> 170 <a class="glyph" aria-label="some glyph"><span class="glyphicon il-glyphicon-laugh" aria-hidden="true"></span></a> 171 <button class="btn btn-tag btn-tag-relevance-veryhigh" data-action="#" id="id_10">tag</button> 175 $this->assertEquals($expected, $html);
testEntityComponentProperties()
This is the factory for Entities.
Builds a Color from either hex- or rgb values.
testEntityActionProperties()
testEntityIdentifiers($identifier)
getEntityAllowedIdentiferTypes
This describes the specific behavior of an ILIAS standard icon.
static getEntityAllowedIdentiferTypes()
testEntityBasicProperties()