nameSource = new class() extends AbstractNameSource { }; } public function testConstructor(): void { $this->assertInstanceOf(NameSourceInterface::class, $this->nameSource); $this->expectException(\TypeError::class); $this->nameSource->getName(); } public function testName(): void { $name = 'Hello World!'; $this->nameSource->setName($name); $this->assertEquals($name, $this->nameSource->getName()); } }