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