toContain("get_sequence(\$sequence, 'sequence', 'graph_templates_item', ['local_graph_id' => gfrv('local_graph_id')])") // ... and must never rebuild that filter by concatenating a request value ->and($src)->not->toContain("get_sequence(\$sequence, 'sequence', 'graph_templates_item', 'local_graph_id=' . grv('local_graph_id'))") ->and($src)->not->toContain("get_sequence(\$sequence, 'sequence', 'graph_templates_item', 'local_graph_id=' . gfrv('local_graph_id'))"); }); test('build_where_from_array binds an injection payload as a parameter rather than inlining it', function () { $params = []; $payload = "1) UNION SELECT username, password FROM user_auth -- "; $where = build_where_from_array(['local_graph_id' => $payload], $params); expect($where)->toBe('`local_graph_id` = ?') ->and($params)->toBe([$payload]) ->and($where)->not->toContain('UNION'); }); test('build_where_from_array binds a valid integer as a parameter', function () { $params = []; $where = build_where_from_array(['local_graph_id' => 7], $params); expect($where)->toBe('`local_graph_id` = ?') ->and($params)->toBe([7]); });