19 declare(strict_types=1);
35 $vocab = $factory->standard(
36 SlotIdentifier::LIFECYCLE_STATUS,
41 $this->assertSame(SlotIdentifier::LIFECYCLE_STATUS,
$vocab->slot());
42 $this->assertSame(Type::STANDARD,
$vocab->type());
43 $this->assertSame(SlotIdentifier::LIFECYCLE_STATUS->value,
$vocab->id());
45 $this->assertSame([
'value 1',
'value 2'], iterator_to_array(
$vocab->values()));
46 $this->assertTrue(
$vocab->isActive());
53 $vocab = $factory->standard(
54 SlotIdentifier::LIFECYCLE_STATUS,
57 )->withIsDeactivated(
true)->get();
59 $this->assertFalse(
$vocab->isActive());
66 $vocab = $factory->controlledString(
67 SlotIdentifier::GENERAL_COVERAGE,
74 $this->assertSame(SlotIdentifier::GENERAL_COVERAGE,
$vocab->slot());
75 $this->assertSame(Type::CONTROLLED_STRING,
$vocab->type());
76 $this->assertSame(
'some identifier',
$vocab->id());
77 $this->assertSame(
'some source',
$vocab->source());
78 $this->assertSame([
'value 1',
'value 2'], iterator_to_array(
$vocab->values()));
79 $this->assertTrue(
$vocab->isActive());
80 $this->assertTrue(
$vocab->allowsCustomInputs());
87 $vocab = $factory->controlledString(
88 SlotIdentifier::GENERAL_COVERAGE,
93 )->withIsDeactivated(
true)->get();
95 $this->assertFalse(
$vocab->isActive());
102 $vocab = $factory->controlledString(
103 SlotIdentifier::GENERAL_COVERAGE,
108 )->withDisallowsCustomInputs(
true)->get();
110 $this->assertFalse(
$vocab->allowsCustomInputs());
117 $vocab = $factory->controlledVocabValue(
118 SlotIdentifier::GENERAL_COVERAGE,
125 $this->assertSame(SlotIdentifier::GENERAL_COVERAGE,
$vocab->slot());
126 $this->assertSame(Type::CONTROLLED_VOCAB_VALUE,
$vocab->type());
127 $this->assertSame(
'some identifier',
$vocab->id());
128 $this->assertSame(
'some source',
$vocab->source());
129 $this->assertSame([
'value 1',
'value 2'], iterator_to_array(
$vocab->values()));
130 $this->assertTrue(
$vocab->isActive());
131 $this->assertTrue(
$vocab->allowsCustomInputs());
138 $vocab = $factory->controlledVocabValue(
139 SlotIdentifier::GENERAL_COVERAGE,
144 )->withIsDeactivated(
true)->get();
146 $this->assertFalse(
$vocab->isActive());
153 $vocab = $factory->copyright(
158 $this->assertSame(SlotIdentifier::RIGHTS_DESCRIPTION,
$vocab->slot());
160 $this->assertSame(SlotIdentifier::RIGHTS_DESCRIPTION->value,
$vocab->id());
162 $this->assertSame([
'value 1',
'value 2'], iterator_to_array(
$vocab->values()));
163 $this->assertTrue(
$vocab->isActive());
170 $vocab = $factory->null();
172 $this->assertInstanceOf(NullVocabulary::class,
$vocab);