classAttribut = new class() implements ClassAttributInterface { use ClassAttribut; }; } public function testConstructor(): void { $this->assertFalse($this->classAttribut->hasClass()); $this->expectException(\TypeError::class); $this->classAttribut->getClass(); } public function testAccessors(): void { $class = AbstractSource::class; $this->assertNull($this->classAttribut->setClass($class)); $this->assertTrue($this->classAttribut->hasClass()); $this->assertEquals($class, $this->classAttribut->getClass()); } public function testException(): void { $class = 'NOTEXISTINGCLASS'; $this->expectException(NotFoundHttpException::class); $this->classAttribut->setClass($class); } }