MCPcopy Create free account
hub / github.com/php/frankenphp / setupTest

Function setupTest

internal/extgen/integration_test.go:30–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func setupTest(t *testing.T) *IntegrationTestSuite {
31 t.Helper()
32
33 suite := &IntegrationTestSuite{t: t}
34
35 suite.genStubScript = os.Getenv("GEN_STUB_SCRIPT")
36 if suite.genStubScript == "" {
37 suite.genStubScript = "/usr/local/src/php/build/gen_stub.php"
38 }
39
40 if _, err := os.Stat(suite.genStubScript); os.IsNotExist(err) {
41 t.Skipf("GEN_STUB_SCRIPT not found at %q. Integration tests require PHP sources. Set GEN_STUB_SCRIPT environment variable to skip this message.", suite.genStubScript)
42 }
43
44 xcaddyPath, err := exec.LookPath("xcaddy")
45 if err != nil {
46 t.Skip("xcaddy not found in PATH. Integration tests require xcaddy to build FrankenPHP.")
47 }
48 suite.xcaddyPath = xcaddyPath
49
50 phpConfigPath, err := exec.LookPath("php-config")
51 if err != nil {
52 t.Skip("php-config not found in PATH. Integration tests require PHP development headers.")
53 }
54 suite.phpConfigPath = phpConfigPath
55
56 tempDir := t.TempDir()
57 suite.tempDir = tempDir
58
59 return suite
60}
61
62func (s *IntegrationTestSuite) createGoModule(sourceFile string) (string, error) {
63 s.t.Helper()

Callers 7

TestBasicFunctionFunction · 0.85
TestConstantsFunction · 0.85
TestNamespaceFunction · 0.85
TestInvalidSignatureFunction · 0.85
TestTypeMismatchFunction · 0.85
TestCallableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected