2 declare(strict_types = 1);
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
56 $this->assertTrue($subject->hasAspect($aspectName));
84 $this->assertFalse($subject->hasAspect($aspectName));
96 $this->assertTrue($subject->hasAspect(
'coolio'));
97 $this->assertFalse($subject->hasAspect(
'uncoolio'));
110 $this->expectException(AspectNotFoundException::class);
111 $this->expectExceptionCode(1527777641);
112 $subject->getAspect(
'uncoolio');
125 $this->assertSame($aspect, $subject->getAspect(
'coolio'));
138 $this->expectException(AspectNotFoundException::class);
139 $this->expectExceptionCode(1527777868);
140 $subject->getPropertyFromAspect(
'uncoolio',
'does not matter');
148 $defaultValue =
'default value';
154 $result = $subject->getPropertyFromAspect(
'coolio',
'unknownproperty', $defaultValue);
155 $this->assertEquals($defaultValue, $result);
168 $result = $subject->getPropertyFromAspect(
'coolio',
'id');
169 $this->assertEquals(13, $result);
180 $subject->setAspect(
'coolio', $aspect);
181 $this->assertSame($aspect, $subject->getAspect(
'coolio'));
192 'coolio' => $initialAspect
195 $subject->setAspect(
'coolio', $aspectOverride);
196 $this->assertNotSame($initialAspect, $subject->getAspect(
'coolio'));
197 $this->assertSame($aspectOverride, $subject->getAspect(
'coolio'));