diff --git a/php_binary_child_test.go b/php_binary_child_test.go new file mode 100644 index 00000000..0ba8db43 --- /dev/null +++ b/php_binary_child_test.go @@ -0,0 +1,67 @@ +package main + +import ( + "bytes" + "context" + "os" + "os/exec" + "path/filepath" + "strings" + "testing" + "time" +) + +// PHP_BINARY must run scripts when invoked as [binary, path.php] (go test / Windows proc_open). +func TestPHPBinaryRunsChildScript(t *testing.T) { + executable, err := os.Executable() + if err != nil { + t.Fatal(err) + } + child := filepath.Join(t.TempDir(), "stream-child.php") + script := `