toContain('right_gprint.gprint_text AS right_axis_format_text') ->toContain('left_gprint.gprint_text AS left_axis_format_text') ->toContain('ON right_gprint.id = gtg.right_axis_format') ->toContain('ON left_gprint.id = gtg.left_axis_format') ->toContain("\$format = \$graph['right_axis_format_text'];") ->toContain("\$format = \$graph['left_axis_format_text'];") ->not->toContain("db_fetch_cell_prepared('SELECT gprint_text from graph_templates_gprint"); }); test('CDEF polling intervals come from the graph item query', function () use ($source) { expect($source) ->toContain('dtd.rrd_step') ->toContain('ON dtd.local_data_id = dtr.local_data_id') ->toContain("\$polling_interval = \$graph_item['rrd_step'];") ->not->toContain("db_fetch_cell_prepared('SELECT rrd_step FROM data_template_data WHERE local_data_id = ?'"); }); test('graph substitutions preload the data source host id', function () use ($source) { expect($source) ->toContain('dl.host_id AS data_source_host_id') ->toContain("if (!empty(\$graph_item['data_source_host_id']))") ->toContain("\$host_id = \$graph_item['data_source_host_id'];"); });