From 81adf9da4bd0497f959b309467b31bd69f408df9 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Wed, 8 Jul 2026 20:54:08 -0400 Subject: [PATCH] chore(internal/librarian/php): fix table driven test structure --- internal/librarian/php/generate_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/librarian/php/generate_test.go b/internal/librarian/php/generate_test.go index 1522dcef5f2..04b9744a344 100644 --- a/internal/librarian/php/generate_test.go +++ b/internal/librarian/php/generate_test.go @@ -114,7 +114,7 @@ func TestGatherProtos(t *testing.T) { } func TestGapicOpts(t *testing.T) { - tests := []struct { + for _, test := range []struct { name string api *config.API apiMetadata *serviceconfig.API @@ -143,7 +143,8 @@ func TestGapicOpts(t *testing.T) { }, grpcConfigPath: "grpc_config.json", want: []string{ - "metadata", "transport=grpc+rest", "migration-mode=NEW_SURFACE_ONLY", "rest-numeric-enums", "generate-snippets", + "metadata", "transport=grpc+rest", "migration-mode=NEW_SURFACE_ONLY", + "rest-numeric-enums", "generate-snippets", "grpc_service_config=grpc_config.json", "service_yaml=service.yaml", }, @@ -154,7 +155,8 @@ func TestGapicOpts(t *testing.T) { apiMetadata: &serviceconfig.API{ SkipRESTNumericEnums: []string{"php"}, }, - want: []string{"metadata", "transport=grpc+rest", "migration-mode=NEW_SURFACE_ONLY", "generate-snippets"}, + want: []string{"metadata", "transport=grpc+rest", "migration-mode=NEW_SURFACE_ONLY", + "generate-snippets"}, }, { name: "custom transport", @@ -164,10 +166,10 @@ func TestGapicOpts(t *testing.T) { "php": serviceconfig.Transport("rest"), }, }, - want: []string{"metadata", "transport=rest", "migration-mode=NEW_SURFACE_ONLY", "rest-numeric-enums", "generate-snippets"}, + want: []string{"metadata", "transport=rest", "migration-mode=NEW_SURFACE_ONLY", + "rest-numeric-enums", "generate-snippets"}, }, - } - for _, test := range tests { + } { t.Run(test.name, func(t *testing.T) { got := gapicOpts(test.api, test.apiMetadata, test.grpcConfigPath) if diff := cmp.Diff(test.want, got); diff != "" {