Add test cases for https://github.com/mapserver/mapserver/pull/5052