/**
  * @depends testSuperUserCustomFieldsWalkthroughForLeadsModule
  */
 public function testSuperUserAddCustomFieldsToLayoutsForLeadsModule()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     //Add custom fields to LeadEditAndDetailsView.
     $this->setGetArray(array('moduleClassName' => 'LeadsModule', 'viewClassName' => 'LeadEditAndDetailsView'));
     $layout = ContactsDesignerWalkthroughHelperUtil::getContactEditAndDetailsViewLayoutWithAllCustomFieldsPlaced('LeadStateDropDown');
     $this->setPostArray(array('save' => 'Save', 'layout' => $layout, 'LayoutPanelsTypeForm' => array('type' => FormLayout::PANELS_DISPLAY_TYPE_ALL)));
     $content = $this->runControllerWithExitExceptionAndGetContent('designer/default/LayoutEdit');
     $this->assertContains('Layout saved successfully', $content);
     //Add all fields to LeadsSearchView.
     $this->setGetArray(array('moduleClassName' => 'LeadsModule', 'viewClassName' => 'LeadsSearchView'));
     $layout = ContactsDesignerWalkthroughHelperUtil::getContactsSearchViewLayoutWithAllCustomFieldsPlaced('LeadStateDropDown');
     $this->setPostArray(array('save' => 'Save', 'layout' => $layout));
     $content = $this->runControllerWithExitExceptionAndGetContent('designer/default/LayoutEdit');
     $this->assertContains('Layout saved successfully', $content);
     //Add all fields to LeadsListView.
     $this->setGetArray(array('moduleClassName' => 'LeadsModule', 'viewClassName' => 'LeadsListView'));
     $layout = ContactsDesignerWalkthroughHelperUtil::getContactsListViewLayoutWithAllStandardAndCustomFieldsPlaced();
     $this->setPostArray(array('save' => 'Save', 'layout' => $layout));
     $content = $this->runControllerWithExitExceptionAndGetContent('designer/default/LayoutEdit');
     $this->assertContains('Layout saved successfully', $content);
     //Add all fields to LeadsMassEditView.
     $this->setGetArray(array('moduleClassName' => 'LeadsModule', 'viewClassName' => 'LeadsMassEditView'));
     $layout = ContactsDesignerWalkthroughHelperUtil::getContactsMassEditViewLayoutWithAllStandardAndCustomFieldsPlaced('LeadStateDropDown');
     $this->setPostArray(array('save' => 'Save', 'layout' => $layout));
     $content = $this->runControllerWithExitExceptionAndGetContent('designer/default/LayoutEdit');
     $this->assertContains('Layout saved successfully', $content);
     //Add all fields to LeadsModalListView.
     $this->setGetArray(array('moduleClassName' => 'LeadsModule', 'viewClassName' => 'LeadsModalListView'));
     $layout = ContactsDesignerWalkthroughHelperUtil::getContactsListViewLayoutWithAllStandardAndCustomFieldsPlaced();
     $this->setPostArray(array('save' => 'Save', 'layout' => $layout));
     $content = $this->runControllerWithExitExceptionAndGetContent('designer/default/LayoutEdit');
     $this->assertContains('Layout saved successfully', $content);
 }
コード例 #2
0
 /**
  * @depends testDeleteOfTheContactForTheCustomFieldsPlacedForContactsModule
  */
 public function testWhetherSearchWorksForTheCustomFieldsPlacedForContactsModuleAfterDeletingTheContact()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     //Retrieve the super account id and the super user id.
     $accountId = self::getModelIdByModelNameAndName('Account', 'superAccount');
     $superUserId = $super->id;
     //Retrieve the Contact State (Status) Id based on the name.
     $contactState = ContactState::getByName('RecycledC');
     $contactStateId = $contactState[0]->id;
     //Search a created contact using the customfields.
     $this->resetPostArray();
     $this->setGetArray(array('ContactsSearchForm' => ContactsDesignerWalkthroughHelperUtil::fetchContactsSearchFormGetData($contactStateId, $superUserId, $accountId), 'ajax' => 'list-view'));
     $content = $this->runControllerWithNoExceptionsAndGetContent('contacts/default');
     //Assert that the edit contact does not exits after the search.
     $this->assertTrue(strpos($content, "No results found.") > 0);
     $this->assertFalse(strpos($content, "26378 South Arlington Ave") > 0);
 }