Add test for issue 6157

closes #6157