(t *testing.T)
| 266 | } |
| 267 | |
| 268 | func TestGoTypeToPHPType(t *testing.T) { |
| 269 | tests := []struct { |
| 270 | goType string |
| 271 | expected phpType |
| 272 | }{ |
| 273 | {"string", phpString}, |
| 274 | {"*string", phpString}, |
| 275 | {"int", phpInt}, |
| 276 | {"int64", phpInt}, |
| 277 | {"*int", phpInt}, |
| 278 | {"float64", phpFloat}, |
| 279 | {"*float32", phpFloat}, |
| 280 | {"bool", phpBool}, |
| 281 | {"*bool", phpBool}, |
| 282 | {"[]string", phpArray}, |
| 283 | {"map[string]int", phpArray}, |
| 284 | {"*[]int", phpArray}, |
| 285 | {"any", phpMixed}, |
| 286 | {"CustomType", phpMixed}, |
| 287 | } |
| 288 | |
| 289 | parser := classParser{} |
| 290 | for _, tt := range tests { |
| 291 | t.Run(tt.goType, func(t *testing.T) { |
| 292 | result := parser.goTypeToPHPType(tt.goType) |
| 293 | assert.Equal(t, tt.expected, result, "goTypeToPHPType(%s) = %s, want %s", tt.goType, result, tt.expected) |
| 294 | }) |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | func TestTypeToString(t *testing.T) { |
| 299 | tests := []struct { |
nothing calls this directly
no test coverage detected