'id', 'Type' => 'bigint']]; } }; $payload = json_decode($resource->handle(new Request)->content, true, 512, JSON_THROW_ON_ERROR); expect($payload['users'][0]['Field'])->toBe('id'); }); test('DatabaseSchema_handle_Bad_returns_an_empty_json_object_when_no_tables_are_available', function (): void { $resource = new class extends DatabaseSchema { protected function tables(): array { return []; } }; expect($resource->handle(new Request)->content)->toBe('[]'); }); test('DatabaseSchema_handle_Ugly_aggregates_multiple_tables_in_a_single_response', function (): void { $resource = new class extends DatabaseSchema { protected function tables(): array { return ['users', 'posts']; } protected function describeTable(string $tableName): array { return [['table' => $tableName]]; } }; $payload = json_decode($resource->handle(new Request)->content, true, 512, JSON_THROW_ON_ERROR); expect(array_keys($payload))->toBe(['users', 'posts']); });