[BUG #8561] Add unit test
(cherry picked from commit ea14f5e3a6e22c46b2e551379401f02b0937c0c5)