-- test case for issue CRM-12216

Added a function to test the scenario of CRM-12216.