--added webtest for CRM-12018 and did some code cleanup

added webtest for issue CRM-12018 and replaced open() with openCiviPage()