2 /*********************************************************************************
3 * By installing or using this file, you are confirming on behalf of the entity
4 * subscribed to the SugarCRM Inc. product ("Company") that Company is bound by
5 * the SugarCRM Inc. Master Subscription Agreement (“MSA”), which is viewable at:
6 * http://www.sugarcrm.com/master-subscription-agreement
8 * If Company is not bound by the MSA, then by installing or using this file
9 * you are agreeing unconditionally that Company will be bound by the MSA and
10 * certifying that you have authority to bind Company accordingly.
12 * Copyright (C) 2004-2013 SugarCRM Inc. All rights reserved.
13 ********************************************************************************/
16 require_once 'tests/service/SOAPTestCase.php';
17 require_once 'modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php';
18 require_once 'modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php';
20 class Bug62094Test extends SOAPTestCase
22 protected $definition;
24 public function setUp()
26 $this->definition = Array(
27 'id' => 'a3468352-8fd0-ec13-708a-517087f79ada',
28 'relationship_name' => 'accounts_meetings_1',
29 'lhs_module' => 'Accounts',
30 'lhs_table' => 'accounts',
32 'rhs_module' => 'Meetings',
33 'rhs_table' => 'meetings',
35 'join_table' => 'accounts_meetings_1_c',
36 'join_key_lhs' => 'accounts_meetings_1accounts_ida',
37 'join_key_rhs' => 'accounts_meetings_1meetings_idb',
38 'relationship_type' => 'one-to-many',
39 'relationship_role_column' => '',
40 'relationship_role_column_value' =>'',
54 public function tearDown()
59 public function testGetModuleFields()
61 $relationship = new AbstractRelationship62094($this->definition);
62 $vardef = $relationship->getLinkFieldDefinition('Meetings', 'accounts_meetings_1');
64 $this->assertNotEmpty($vardef['module'], 'get_module_fields failed: empty module returned');
65 $this->assertNotEmpty($vardef['bean_name'], 'get_module_fields failed: empty bean_name returned');
67 $relationship = new ActivitiesRelationship62094($this->definition);
68 $vardef = $relationship->getLinkFieldDefinition('Meetings', 'accounts_meetings_1');
70 $this->assertNotEmpty($vardef['module'], 'get_module_fields failed: empty module returned');
71 $this->assertNotEmpty($vardef['bean_name'], 'get_module_fields failed: empty bean_name returned');
75 class AbstractRelationship62094 extends AbstractRelationship {
77 public function getLinkFieldDefinition ($sourceModule , $relationshipName)
79 return parent::getLinkFieldDefinition($sourceModule , $relationshipName);
84 class ActivitiesRelationship62094 extends ActivitiesRelationship {
86 public function getLinkFieldDefinition ($sourceModule , $relationshipName)
88 return parent::getLinkFieldDefinition($sourceModule , $relationshipName);