toContain('WHERE dtr.local_data_id IN ($placeholders)') ->toContain('WHERE local_data_id IN ($placeholders)') ->toContain("\$ds_types[(int) \$row['local_data_id']][\$row['data_source_name']]") ->toContain("\$last_values[(int) \$row['local_data_id']][\$row['rrd_name']]") ->not->toContain("db_fetch_cell_prepared('SELECT SQL_NO_CACHE `value`") ->not->toContain("db_fetch_cell_prepared('SELECT rrd_step\n") ->not->toContain("db_fetch_cell_prepared('SELECT data_source_type_id\n"); }); test('poller output preserves sequential last values and quotes string tuples', function () use ($source) { expect($source) ->toContain("\$last_values[(int) \$result['local_data_id']][\$result['rrd_name']] = \$lastval;") ->toContain("db_qstr(\$result['rrd_name'])") ->toContain("db_qstr(\$result['time'])") ->toContain('$out_length = strlen($cachebuf);') ->toContain('$last_length = strlen($lastbuf);') ->not->toContain('$out_length += strlen($cachebuf);') ->not->toContain('$last_length += strlen($lastbuf);'); }); test('unknown decimal counters are not passed to round', function () use ($source) { expect($source) ->toContain("\$ds_type == 6 && \$lastval != 'NULL'") ->toContain("\$ds_type == 7 && \$lastval != 'NULL'"); });