package php import ( "testing" testingUtils "github.com/railwayapp/railpack/core/testing" "github.com/stretchr/testify/require" ) func TestDetect(t *testing.T) { tests := []struct { name string path string want bool }{ { name: "index.php", path: "../../../examples/php-vanilla", want: true, }, { name: "composer", path: "../../../examples/php-laravel-inertia", want: true, }, { name: "no php", path: "../../../examples/node-npm", want: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ctx := testingUtils.CreateGenerateContext(t, tt.path) provider := PhpProvider{} got, err := provider.Detect(ctx) require.NoError(t, err) require.Equal(t, tt.want, got) }) } }