]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/include/SugarFields/Fields/Relate/Bug43770Test.php
Release 6.3.0beta1
[Github/sugarcrm.git] / tests / include / SugarFields / Fields / Relate / Bug43770Test.php
1 <?php
2 require_once('include/SugarFields/Fields/Relate/SugarFieldRelate.php');
3
4 class Bug43770Test extends Sugar_PHPUnit_Framework_TestCase
5 {
6     private $_fieldOutput;
7
8     public function setUp()
9     {
10         $sfr = new SugarFieldRelate('relate');
11         $vardef = array(
12             'name' => 'assigned_user_name',
13             'id_name' => 'assigned_user_id',
14             'module' => 'Users'
15         );
16         $displayParams = array(
17             'idName' => 'Contactsassigned_user_name'
18         );
19         $this->_fieldOutput = $sfr->getEditViewSmarty(array(), $vardef, $displayParams, 1);
20     }
21     /**
22      * @group   bug43770
23      */
24     public function testCustomIdName()
25     {
26         $this->assertContains('id="Contacts{$Array.assigned_user_name.id_name}"', $this->_fieldOutput);
27     }
28
29     public function testCustomIdNameJS()
30     {
31         $this->assertContains('"id":"Contactsassigned_user_id"', $this->_fieldOutput);
32     }
33 }