[ ['name' => 'start', 'description' => 'Start the bot'], ], ]); $this->assertCount(1, $info->commands); $this->assertInstanceOf(BotCommand::class, $info->commands[0]); $this->assertSame('start', $info->commands[0]->name); $this->assertSame('Start the bot', $info->commands[0]->description); } #[Test] public function commandsAreNullWhenTheBotHasNone(): void { $this->assertNull(BotCommandsInfo::fromArray([])->commands); } #[Test] public function toArraySerializesCommands(): void { $info = new BotCommandsInfo([new BotCommand('help', 'Help')]); $this->assertSame(['commands' => [['name' => 'help', 'description' => 'Help']]], $info->toArray()); } }