From f69337a09f76af62b62c236f725bd964b2c90601 Mon Sep 17 00:00:00 2001 From: jcm Date: Wed, 13 Jul 2022 09:46:09 +0200 Subject: [PATCH 1/2] QA - pcntl_exec - check stringable parameters error --- ext/pcntl/tests/pcntl_exec_004.phpt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ext/pcntl/tests/pcntl_exec_004.phpt diff --git a/ext/pcntl/tests/pcntl_exec_004.phpt b/ext/pcntl/tests/pcntl_exec_004.phpt new file mode 100644 index 0000000000000..0a9019b463ff3 --- /dev/null +++ b/ext/pcntl/tests/pcntl_exec_004.phpt @@ -0,0 +1,28 @@ +--TEST-- +pcntl_exec() - Testing error when non-stringable arguments are passed for $args and $env_vars. +--EXTENSIONS-- +pcntl +--SKIPIF-- + +--FILE-- +getMessage() . "\n"; +} + +try { + pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), ['-n'], [new stdClass()]); +} catch (Error $error) { + echo $error->getMessage() . "\n"; +} + +echo "ok\n"; +?> +--EXPECT-- +Object of class stdClass could not be converted to string +Object of class stdClass could not be converted to string +ok From ad72c36a7460cd48d3de7a3f0c11bf430c7be8a2 Mon Sep 17 00:00:00 2001 From: jcm Date: Wed, 13 Jul 2022 13:06:28 +0200 Subject: [PATCH 2/2] Taking out the "ok" string message from test --- ext/pcntl/tests/pcntl_exec_004.phpt | 3 --- 1 file changed, 3 deletions(-) diff --git a/ext/pcntl/tests/pcntl_exec_004.phpt b/ext/pcntl/tests/pcntl_exec_004.phpt index 0a9019b463ff3..270fdb755ca15 100644 --- a/ext/pcntl/tests/pcntl_exec_004.phpt +++ b/ext/pcntl/tests/pcntl_exec_004.phpt @@ -19,10 +19,7 @@ try { } catch (Error $error) { echo $error->getMessage() . "\n"; } - -echo "ok\n"; ?> --EXPECT-- Object of class stdClass could not be converted to string Object of class stdClass could not be converted to string -ok