Added unit test for the issue

https://github.com/ezsystems/ezpublish-kernel/pull/637