'start', 'description' => 'Start the bot', ]; $command = BotCommand::fromArray($data); $this->assertInstanceOf(BotCommand::class, $command); $this->assertSame('start', $command->name); $this->assertSame('Start the bot', $command->description); $arrayResult = $command->toArray(); $this->assertIsArray($arrayResult); $this->assertSame($data, $arrayResult); } #[Test] public function canBeCreatedFromArrayWithOptionalDataNull(): void { $command = BotCommand::fromArray([ 'name' => 'help', 'description' => null, ]); $this->assertInstanceOf(BotCommand::class, $command); $this->assertSame('help', $command->name); $this->assertNull($command->description); } }