Files
pack/core/providers/php/php_test.go
T
zeekay 7844a60aff refactor(pack): modernize to github.com/hanzoai/pack and remove upstream branding
- Migrate module path to github.com/hanzoai/pack across all Go packages
- Remove legacy upstream docs and competitor brand references
- Modernize LLM.md and mise.toml for pristine Hanzo Pack builder
2026-09-04 00:40:42 -07:00

51 lines
1.0 KiB
Go

package php
import (
"testing"
testingUtils "github.com/hanzoai/pack/core/testing"
"github.com/stretchr/testify/require"
)
func TestPhpProvider(t *testing.T) {
tests := []struct {
name string
path string
isPhp bool
isLaravel bool
}{
{
name: "vanilla php with index.php",
path: "../../../examples/php-vanilla",
isPhp: true,
isLaravel: false,
},
{
name: "laravel project with composer.json",
path: "../../../examples/php-laravel-12-react",
isPhp: true,
isLaravel: true,
},
{
name: "non-php project",
path: "../../../examples/node-npm",
isPhp: false,
isLaravel: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
ctx := testingUtils.CreateGenerateContext(t, tt.path)
provider := PhpProvider{}
isPhp, err := provider.Detect(ctx)
require.NoError(t, err)
require.Equal(t, tt.isPhp, isPhp)
isLaravel := provider.usesLaravel(ctx)
require.Equal(t, tt.isLaravel, isLaravel)
})
}
}