expect(ServerCreationData::parse($data))->toBe(['external_id'=>'external-123','name'=>'Example server','description'=>'Provisioned by the API','owner_id'=>10,'egg_id'=>20,'image'=>'ghcr.io/example/server:latest','startup'=>'./server','environment'=>['MODE'=>'production','QUERY_PORT'=>25565],'memory'=>1024,'swap'=>0,'disk'=>4096,'io'=>500,'cpu'=>100,'threads'=>'0-3','skip_scripts'=>true,'allocation_id'=>1,'allocation_additional'=>[2,3],'start_on_completion'=>true,'database_limit'=>1,'allocation_limit'=>2,'backup_limit'=>3,'oom_disabled'=>false,'extensions'=>$data['extensions']]);
});
test('defaults extension values to none and refuses values that were not validated',function():void{
return['external_id'=>'external-123','name'=>'Example server','description'=>'Provisioned by the API','owner_id'=>'10','egg_id'=>'20','image'=>'ghcr.io/example/server:latest','startup'=>'./server','environment'=>['MODE'=>'production','QUERY_PORT'=>25565],'memory'=>'1024','swap'=>'0','disk'=>'4096','io'=>'500','cpu'=>'100','threads'=>'0-3','skip_scripts'=>true,'allocation_id'=>'1','allocation_additional'=>['2',3],'start_on_completion'=>1,'database_limit'=>'1','allocation_limit'=>2,'backup_limit'=>3,'oom_disabled'=>false,'extensions'=>ValidatedExtensionValues::fromValidation(['billing'=>['plan'=>'pro']])];