(phpCode string)
| 199 | } |
| 200 | |
| 201 | func (s *IntegrationTestSuite) runPHPCode(phpCode string) (string, error) { |
| 202 | s.t.Helper() |
| 203 | |
| 204 | if s.frankenphpPath == "" { |
| 205 | return "", fmt.Errorf("FrankenPHP not compiled yet") |
| 206 | } |
| 207 | |
| 208 | phpFile := filepath.Join(s.tempDir, "test.php") |
| 209 | if err := os.WriteFile(phpFile, []byte(phpCode), 0o644); err != nil { |
| 210 | return "", fmt.Errorf("failed to create PHP file: %w", err) |
| 211 | } |
| 212 | |
| 213 | cmd := exec.Command(s.frankenphpPath, "php-cli", phpFile) |
| 214 | output, err := cmd.CombinedOutput() |
| 215 | if err != nil { |
| 216 | return "", fmt.Errorf("PHP execution failed: %w\nOutput: %s", err, string(output)) |
| 217 | } |
| 218 | |
| 219 | return string(output), nil |
| 220 | } |
| 221 | |
| 222 | // verifyPHPSymbols checks if PHP can find the exposed functions, classes, and constants |
| 223 | func (s *IntegrationTestSuite) verifyPHPSymbols(functions []string, classes []string, constants []string) error { |
no outgoing calls
no test coverage detected