public function testCustomRelatedLink() { $layout_def = array('name' => 'account_id_c', 'label' => 'Account Link', 'table_key' => 'self', 'table_alias' => 'opportunities_cstm', 'column_key' => 'self:account_link_c', 'type' => 'relate', 'fields' => array('PRIMARYID' => '10765534-ff52-52ec-5840-4f16faec901f', 'OPPORTUNITIES_NAME' => 'Trait Institute Inc - 1000 units', 'OPPORTUNITIES_AMOUNT_UBC8F31' => '52183382.29', 'OPPORTUNITIES_AMOUNT' => '52183382.29', 'OPPORTUNITIES_AMOUNT_C9AC638' => '-99', 'OPPORTUNITIES_CSTM_ACCE36316' => '13ce632e-605e-93ac-c209-4f16fa14e616', 'ACCOUNTS1_NAME' => 'OTC Holdings')); $fakeLayoutManager = new Bug45716Helper(); $sugarWidget = new SugarWidgetFieldrelate($fakeLayoutManager); $output = $sugarWidget->displayList($layout_def); $this->assertContains('record=13ce', $output, 'Missing the id in the output url'); }
public function testCustomRelateFieldInDashlet() { $id = $this->relateField->ext3; $this->contact2->{$id} = $this->account->id; $this->contact2->save(); $layoutDef = array('name' => $this->relateField->name, 'id_name' => $this->relateField->ext3, 'type' => 'relate', 'ext2' => 'Accounts', 'custom_module' => 'Contacts', 'table' => 'contacts_cstm', 'table_alias' => 'contacts', 'module' => 'Accounts', 'input_name0' => array(0 => $this->account->id)); $out = $this->sugarWidget->queryFilterone_of($layoutDef); $this->assertContains($this->contact2->id, $out, 'The request for custom relate field was made incorrectly'); }