diff --git a/src/Adapters/Symfony/Component/Process/Process.php b/src/Adapters/Symfony/Component/Process/Process.php index 1ebae185c..05bdcb45e 100644 --- a/src/Adapters/Symfony/Component/Process/Process.php +++ b/src/Adapters/Symfony/Component/Process/Process.php @@ -79,4 +79,22 @@ public function createNewConsole(): void $options['bypass_shell'] = true; $optionsReflectionProperty->setValue($this, $options); } + + /** + * @param array $arguments + */ + public static function __callStatic(string $name, array $arguments):mixed + { + if ($name === 'fromShellCommandline') { + $command = array_shift($arguments); + $process = new self([], ...$arguments); // @phpstan-ignore-line + $processCommandLineProperty = new \ReflectionProperty(SymfonyProcess::class, 'commandline'); + $processCommandLineProperty->setAccessible(true); + $processCommandLineProperty->setValue($process, $command); + + return $process; + } + + return null; + } } diff --git a/tests/Issue/BlogArchiveCest.php b/tests/Issue/BlogArchiveCest.php deleted file mode 100644 index b723c08a5..000000000 --- a/tests/Issue/BlogArchiveCest.php +++ /dev/null @@ -1,6 +0,0 @@ -suppress_errors = true; // Due to a WooCommerce activation issue in older versions. $this->_handleAjax('test_ajax_action'); } catch (\WPAjaxDieContinueException) { $response = json_decode($this->_last_response); } + $wpdb->suppress_errors = false; + $this->assertNotNull($response); $this->assertFalse($response->success); $this->assertEquals('Number not only once is invalid', $response->data);