'ipd', 'key' => 'refer_back_dest_trend', 'sql' => "SELECT COUNT(c.universal_item_value_text) AS cnt, concat(c.universal_item_value_text,' ',h.name) AS dest FROM universal_head b LEFT JOIN universal_detail c ON b.universal_head_id = c.universal_head_id LEFT OUTER JOIN hospcode h ON c.universal_item_value_text=h.hospcode WHERE b.universal_form_id = '124' AND b.vn IN (SELECT an FROM ipt WHERE dchdate BETWEEN :start AND :end) AND c.universal_item_id = '4713' GROUP BY c.universal_item_value_text ORDER BY c.universal_item_value_text" ]; // Mock php://input file_put_contents('php://memory', json_encode($fake_post)); // wait, we can't easily mock php://input without a wrapper. // So let's just make a curl request to the file via CLI using php -S if possible, or just look at the code.