// Setup the general settings required to build a link.
$id_field->options
['alter'
]['make_link'
] = TRUE;
$id_field->options
['alter'
]['path'
] =
$path =
$this->
randomMachineName();
// Tests that the suffix/prefix appears on the output.
$id_field->options
['alter'
]['prefix'
] =
$prefix =
$this->
randomMachineName();
$id_field->options
['alter'
]['suffix'
] =
$suffix =
$this->
randomMachineName();
$output =
$renderer->
executeInRenderContext(new RenderContext(),
function D
) use ($id_field,
$row) { return $id_field->
theme($row);
});
$this->
assertSubString($output,
$prefix);
$this->
assertSubString($output,
$suffix);
unset($id_field->options
['alter'
]['prefix'
]);
unset($id_field->options
['alter'
]['suffix'
]);
$output =
$renderer->
executeInRenderContext(new RenderContext(),
function D
) use ($id_field,
$row) { return $id_field->
theme($row);
});
$this->
assertSubString($output,
$path, 'Make sure that the path is part of the output'
);
// Some generic test code adapted from the UrlTest class, which tests
// mostly the different options for the path.