not->toBeFalse('Failed to read aggregate_graphs.php'); return $src; } test('form_save gate accepts save_component_item posts', function () { $source = getAggregateGraphsSource(); // The gate must combine all three component guards in one condition; item // was the missing term (#7338). Order and wrapping are free to change. $pattern = "/if \((?=[^{]*!isrv\('save_component_graph'\))(?=[^{]*!isrv\('save_component_input'\))(?=[^{]*!isrv\('save_component_item'\))[^{]*\)\s*\{/"; expect(preg_match($pattern, $source))->toBe(1, 'form_save() must let save_component_item posts reach the item-save branch' ); }); test('migrate-to-template confirmation posts aggregate_template_id', function () { $source = getAggregateGraphsSource(); // api_aggregate_convert_template() reads gnrv('aggregate_template_id'). // The sub-array's key order is not pinned. $pattern = "/'extra'\s*=>\s*\[\s*'aggregate_template_id'\s*=>\s*\[/"; expect(preg_match($pattern, $source))->toBe(1, 'the drp_action 2 extra input must be named aggregate_template_id' ); }); test('combine confirmation posts aggregate_name', function () { $source = getAggregateGraphsSource(); // the drp_action 3 handler reads grv('aggregate_name'). // The sub-array's key order is not pinned. $pattern = "/'extra'\s*=>\s*\[\s*'aggregate_name'\s*=>\s*\[/"; expect(preg_match($pattern, $source))->toBe(1, 'the drp_action 3 extra input must be named aggregate_name' ); }); test('no confirmation extra input is misnamed title_format', function () { $source = getAggregateGraphsSource(); // Match title_format used as an extra-input field name (a key mapping to a // definition array) anywhere, not just as the first key of an 'extra' // block. Anchoring to the first key let the bug slip back in as a // later/second key. The '=> [' shape still excludes the legitimate scalar // uses (gnrv('title_format'), $aginfo['title_format'], SQL), and key order // and whitespace stay unpinned. $pattern = "/'title_format'\s*=>\s*\[/"; expect(preg_match($pattern, $source))->toBe(0, 'no bulk-action dialog may post its input as title_format' ); });