19declare(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');
78 #[\PHPUnit\Framework\Attributes\DataProvider('getEntityAllowedIdentiferTypes')]
82 $this->assertEquals($identifier, $entity->getPrimaryIdentifier());
83 $this->assertEquals($identifier, $entity->getSecondaryIdentifier());
92 ->withPrioritizedReactions($glyph, $tag)
93 ->withReactions($glyph, $glyph, $glyph)
96 $this->assertEquals([$glyph, $tag], $entity->getPrioritizedReactions());
97 $this->assertEquals([$glyph,$glyph,$glyph], $entity->getReactions());
98 $this->assertEquals([$shy], $entity->getActions());
107 ->withPrioritizedReactions($glyph, $tag)
108 ->withReactions($glyph)
111 $this->assertEquals([$glyph, $tag], $entity->getPrioritizedReactions());
112 $this->assertEquals([$glyph], $entity->getReactions());
113 $this->assertEquals([$shy], $entity->getActions());
132 ->withPrioritizedReactions($glyph, $tag)
133 ->withReactions($glyph, $glyph)
134 ->withActions($shy, $shy)
135 ->withBlockingAvailabilityConditions($this->
legacy(
'bc'))
136 ->withFeaturedProperties($this->
legacy(
'fp'))
137 ->withMainDetails($this->
legacy(
'md'))
138 ->withPersonalStatus($this->
legacy(
'ps'))
139 ->withAvailability($this->
legacy(
'a'))
140 ->withDetails($this->
legacy(
'd'));
142 $r = $this->getDefaultRenderer();
143 $html = $this->brutallyTrimHTML($r->render($entity));
144 $expected = $this->brutallyTrimHTML(
'
145<div class="c-entity __container">
146 <div class="c-entity __blocking-conditions">bc</div>
147 <div class="c-entity __actions">
148 <div class="dropdown" id="id_9">
149 <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>
150 <ul id="id_9_menu" class="dropdown-menu">
151 <li><button class="btn btn-link" data-action="#" id="id_7">shy</button></li>
152 <li><button class="btn btn-link" data-action="#" id="id_8">shy</button></li>
156 <div class="c-entity __secondary-identifier --string ">secondary</div>
157 <div class="c-entity __primary-identifier">primary</div>
158 <div class="c-entity __featured">fp</div>
159 <div class="c-entity __personal-status">ps</div>
160 <div class="c-entity __main-details">md</div>
161 <div class="c-entity __availability">a</div>
162 <div class="c-entity __details">d</div>
163 <div class="c-entity __reactions">
164 <a class="glyph" aria-label="some glyph"><span class="glyphicon il-glyphicon-laugh" aria-hidden="true"></span></a>
165 <a class="glyph" aria-label="some glyph"><span class="glyphicon il-glyphicon-laugh" aria-hidden="true"></span></a>
167 <div class="c-entity __featured-reactions">
168 <a class="glyph" aria-label="some glyph"><span class="glyphicon il-glyphicon-laugh" aria-hidden="true"></span></a>
169 <button class="btn btn-tag btn-tag-relevance-veryhigh" data-action="#" id="id_10">tag</button>
173 $this->assertEquals($expected, $html);
static getEntityAllowedIdentiferTypes()
testEntityBasicProperties()
testEntityActionProperties()
testEntityComponentProperties()
testEntityIdentifiers($identifier)
Builds a Color from either hex- or rgb values.
Provides common functionality for UI tests.
This is the factory for Entities.
This describes the specific behavior of an ILIAS standard icon.