assertEquals('test payload', $command->getName()); $handler = new ExampleHandler(); $result = $handler($command); $this->assertEquals('Hello, test payload!', $result); } public function testThrowsException(): void { $class = new readonly class extends Command { }; $this->expectException(\TypeError::class); $handler = new ExampleHandler(); $handler($class); } }