Added unit test for #5869