]);
$view->
preview();
$counter =
$view->style_plugin->
getField(0, 'counter'
);
$this->
assertEquals('1',
$counter,
new FormattableMarkup('Make sure the expected number (@expected) patches with the rendered number (@counter)',
['@expected' => 1, '@counter' =>
$counter]));
$counter =
$view->style_plugin->
getField(1, 'counter'
);
$this->
assertEquals('2',
$counter,
new FormattableMarkup('Make sure the expected number (@expected) patches with the rendered number (@counter)',
['@expected' => 2, '@counter' =>
$counter]));
$counter =
$view->style_plugin->
getField(2, 'counter'
);
$this->
assertEquals('3',
$counter,
new FormattableMarkup('Make sure the expected number (@expected) patches with the rendered number (@counter)',
['@expected' => 3, '@counter' =>
$counter]));
$view->
destroy();
$view->storage->
invalidateCaches();
$view->
setDisplay();
$rand_start =
rand(5, 10
);
$view->displayHandlers->
get('default'
)->
overrideOption('fields',
[ 'counter' =>
[ 'id' => 'counter',
'table' => 'views',
'field' => 'counter',
'relationship' => 'none',
'counter_start' =>
$rand_start,
],