(t *testing.T)
| 28 | } |
| 29 | |
| 30 | func 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 | |
| 62 | func (s *IntegrationTestSuite) createGoModule(sourceFile string) (string, error) { |
| 63 | s.t.Helper() |
no outgoing calls
no test coverage detected