Add test for #8860

Closes #8860.