Add test for the issue 5673

closes #5673
Merge pull request #8007 from skirpichev/5673-fix

Add test for the issue 5673