6 use InvalidArgumentException;
27 yield
'array or the wrong thing' => [
48 $this->assertSame( [], $slots->getSlots() );
51 $slots->setSlot( $slotA );
52 $this->assertTrue( $slots->hasSlot(
'some' ) );
53 $this->assertSame( $slotA, $slots->getSlot(
'some' ) );
54 $this->assertSame( [
'some' => $slotA ], $slots->getSlots() );
57 $slots->setSlot( $slotB );
58 $this->assertTrue( $slots->hasSlot(
'other' ) );
59 $this->assertSame( $slotB, $slots->getSlot(
'other' ) );
60 $this->assertSame( [
'some' => $slotA,
'other' => $slotB ], $slots->getSlots() );
66 $this->assertSame( [], $slots->getSlots() );
69 $slots->setSlot( $slotA );
71 $this->assertSame( [
'main' => $slotA ], $slots->getSlots() );
74 $slots->setSlot( $slotB );
76 $this->assertSame( [
'main' => $slotB ], $slots->getSlots() );
91 $slots->setSlot( $slotA );
94 $slots->inheritSlot( $slotB );
95 $slots->inheritSlot( $slotC );
96 $this->assertSame( [
'main',
'foo' ], $slots->getSlotRoles() );
98 $this->assertNotSame( $slotC, $slots->getSlot(
'foo' ) );
100 $this->assertTrue( $slots->getSlot(
'foo' )->isInherited() );
101 $this->assertSame( $slotB->getContent(), $slots->getSlot(
SlotRecord::MAIN )->getContent() );
102 $this->assertSame( $slotC->getContent(), $slots->getSlot(
'foo' )->getContent() );
108 $this->assertSame( [], $slots->getSlots() );
111 $slots->setSlot( $slotA );
113 $this->assertSame( [
'main' => $slotA ], $slots->getSlots() );
124 $this->assertSame( [
'main' => $slotA ], $slots->getSlots() );
127 $this->assertSame( [], $slots->getSlots() );
139 $this->assertSame( [
'some',
'other' ], $slots->getSlotRoles() );
140 $this->assertNotSame( $parentSlots[
'some'], $slots->getSlot(
'some' ) );
141 $this->assertNotSame( $parentSlots[
'other'], $slots->getSlot(
'other' ) );
142 $this->assertTrue( $slots->getSlot(
'some' )->isInherited() );
143 $this->assertTrue( $slots->getSlot(
'other' )->isInherited() );
144 $this->assertSame( $parentSlots[
'some']->getContent(), $slots->getContent(
'some' ) );
145 $this->assertSame( $parentSlots[
'other']->getContent(), $slots->getContent(
'other' ) );