$output =
$renderer->
executeInRenderContext(new RenderContext(),
function D
) use ($id_field,
$row) { return $id_field->
theme($row);
});
$this->
assertSubString($output, 'http://www.example.com'
);
// Setup a not external URL, which shouldn't lead to an external URL.
$id_field->options
['alter'
]['external'
] = FALSE;
$id_field->options
['alter'
]['path'
] =
$path = 'www.example.com';
$output =
$renderer->
executeInRenderContext(new RenderContext(),
function D
) use ($id_field,
$row) { return $id_field->
theme($row);
});
$this->
assertNotSubString($output, 'http://www.example.com'
);
// Tests the transforming of the case setting.
$id_field->options
['alter'
]['path'
] =
$path =
$this->
randomMachineName();
$id_field->options
['alter'
]['path_case'
] = 'none';
$output =
$renderer->
executeInRenderContext(new RenderContext(),
function D
) use ($id_field,
$row) { return $id_field->
theme($row);
});
$this->
assertSubString($output,
$path);
// Switch to uppercase and lowercase.
$id_field->options
['alter'
]['path_case'
] = 'upper';