+ (webdir / 'test.php').write_text("<?php\necho 'OK\n';")
+
+
+ @staticmethod
+ def test_run_api(tmp_path):
+ assert exec_utils.run_api_script('test', tmp_path) == 0
+
+ @staticmethod
+ def test_run_api_execution_error(tmp_path):
+ assert exec_utils.run_api_script('badname', tmp_path) != 0
+
+ @staticmethod
+ def test_run_api_with_extra_env(tmp_path):
+ extra_env = dict(SCRIPT_FILENAME=str(tmp_path / 'website' / 'test.php'))
+ assert exec_utils.run_api_script('badname', tmp_path, extra_env=extra_env) == 0