contact = SugarTestContactUtilities::createContact(); $this->contact->salutation = 'Ms.'; $this->contact->first_name = 'Lady'; $this->contact->last_name = 'Gaga'; //Save contact with salutation $this->contact->save(); } public function tearDown() { SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); SugarTestContactUtilities::removeAllCreatedContacts(); } public function testSearchNamePopulatedCorrectly() { require_once('include/Popups/PopupSmarty.php'); $popupSmarty = new PopupSmarty($this->contact, $this->contact->module_dir); $this->contact->_create_proper_name_field(); $search_data = array(); $search_data[] = array('ID'=>$this->contact->id, 'NAME'=>$this->contact->name, 'FIRST_NAME'=>$this->contact->first_name, 'LAST_NAME'=>$this->contact->last_name); $data = array('data'=>$search_data); $data['pageData']['offsets']['lastOffsetOnPage'] = 0; $data['pageData']['offsets']['current'] = 0; $popupSmarty->data = $data; $popupSmarty->fieldDefs = array(); $popupSmarty->view= 'popup'; $popupSmarty->tpl = 'include/Popups/tpls/PopupGeneric.tpl'; $this->expectOutputRegex('/\"NAME\":\"Lady Gaga\"/', 'Assert that NAME value was set to "Lady Gaga"'); echo $popupSmarty->display(); } } ?>