19 declare(strict_types=1);
44 protected bool $active,
54 public function type():
Type 59 public function isActive():
bool 69 ): ControlledRepository {
73 protected int $active_count
77 public function countActiveVocabulariesForSlot(
SlotIdentifier $slot):
int 79 if ($slot === $this->slot) {
80 return $this->active_count;
90 ): StandardRepository {
91 return new class ($slot, $active) extends NullStandardRepository {
94 protected bool $active
100 if ($slot === $this->slot) {
101 return $this->active;
111 [5,
true,
true,
true],
112 [5,
true,
false,
true],
113 [1,
false,
true,
false],
114 [1,
false,
false,
true],
115 [0,
true,
true,
false],
116 [0,
true,
false,
true],
117 [0,
false,
false,
false]
121 #[\PHPUnit\Framework\Attributes\DataProvider('activeCountProvider')] 123 int $active_controlled_vocabs,
124 bool $is_standard_vocab_active,
125 bool $is_vocab_active,
126 bool $are_other_vocabs_active
129 $this->
getControlledRepo(SlotIdentifier::TECHNICAL_FORMAT, $active_controlled_vocabs),
130 $this->
getStandardRepo(SlotIdentifier::TECHNICAL_FORMAT, $is_standard_vocab_active)
135 SlotIdentifier::TECHNICAL_FORMAT
139 $are_other_vocabs_active,
140 $infos->isDeactivatable(
$vocab)
149 $this->assertTrue($infos->isDeactivatable(
$vocab));
152 #[\PHPUnit\Framework\Attributes\DataProvider('activeCountProvider')] 154 int $active_controlled_vocabs,
155 bool $is_standard_vocab_active,
156 bool $is_vocab_active,
157 bool $are_other_vocabs_active
160 $this->
getControlledRepo(SlotIdentifier::TECHNICAL_FORMAT, $active_controlled_vocabs),
161 $this->
getStandardRepo(SlotIdentifier::TECHNICAL_FORMAT, $is_standard_vocab_active)
164 Type::CONTROLLED_VOCAB_VALUE,
166 SlotIdentifier::TECHNICAL_FORMAT
170 $are_other_vocabs_active,
171 $infos->isDeactivatable(
$vocab)
180 $this->assertFalse($infos->isDeactivatable(
$vocab));
188 $this->assertFalse($infos->canDisallowCustomInput(
$vocab));
196 $this->assertTrue($infos->canDisallowCustomInput(
$vocab));
204 $this->assertFalse($infos->canDisallowCustomInput(
$vocab));
212 $this->assertFalse($infos->canDisallowCustomInput(
$vocab));
220 $this->assertFalse($infos->isCustomInputApplicable(
$vocab));
228 $this->assertTrue($infos->isCustomInputApplicable(
$vocab));
236 $this->assertFalse($infos->isCustomInputApplicable(
$vocab));
244 $this->assertTrue($infos->isCustomInputApplicable(
$vocab));
252 $this->assertFalse($infos->canBeDeleted(
$vocab));
260 $this->assertTrue($infos->canBeDeleted(
$vocab));
263 #[\PHPUnit\Framework\Attributes\DataProvider('activeCountProvider')] 265 int $active_controlled_vocabs,
266 bool $is_standard_vocab_active,
267 bool $is_vocab_active,
268 bool $are_other_vocabs_active
271 $this->
getControlledRepo(SlotIdentifier::TECHNICAL_FORMAT, $active_controlled_vocabs),
272 $this->
getStandardRepo(SlotIdentifier::TECHNICAL_FORMAT, $is_standard_vocab_active)
275 Type::CONTROLLED_VOCAB_VALUE,
277 SlotIdentifier::TECHNICAL_FORMAT
281 $are_other_vocabs_active,
282 $infos->canBeDeleted(
$vocab)
291 $this->assertFalse($infos->canBeDeleted(
$vocab));
__construct()
Constructor setup ILIAS global object public.