@@ -2,13 +2,13 @@ discard block |
||
2 | 2 | |
3 | 3 | class FP_eventsTest extends PHPUnit_Framework_TestCase { |
4 | 4 | |
5 | - public function testFP_events(){ |
|
5 | + public function testFP_events() { |
|
6 | 6 | |
7 | 7 | //execute the contructor and check for the Object type and attributes |
8 | 8 | $fpEvents = new FP_events(); |
9 | - $this->assertInstanceOf('FP_events',$fpEvents); |
|
10 | - $this->assertInstanceOf('Basic',$fpEvents); |
|
11 | - $this->assertInstanceOf('SugarBean',$fpEvents); |
|
9 | + $this->assertInstanceOf('FP_events', $fpEvents); |
|
10 | + $this->assertInstanceOf('Basic', $fpEvents); |
|
11 | + $this->assertInstanceOf('SugarBean', $fpEvents); |
|
12 | 12 | |
13 | 13 | $this->assertAttributeEquals('FP_events', 'module_dir', $fpEvents); |
14 | 14 | $this->assertAttributeEquals('FP_events', 'object_name', $fpEvents); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | } |
21 | 21 | |
22 | - public function testemail_templates(){ |
|
22 | + public function testemail_templates() { |
|
23 | 23 | |
24 | 24 | error_reporting(E_ERROR | E_PARSE); |
25 | 25 |
@@ -3,13 +3,13 @@ |
||
3 | 3 | |
4 | 4 | class AM_ProjectTemplatesTest extends PHPUnit_Framework_TestCase { |
5 | 5 | |
6 | - public function testAM_ProjectTemplates(){ |
|
6 | + public function testAM_ProjectTemplates() { |
|
7 | 7 | |
8 | 8 | //execute the contructor and check for the Object type and type attribute |
9 | 9 | $am_projectTemplate = new AM_ProjectTemplates(); |
10 | - $this->assertInstanceOf('AM_ProjectTemplates',$am_projectTemplate); |
|
11 | - $this->assertInstanceOf('Basic',$am_projectTemplate); |
|
12 | - $this->assertInstanceOf('SugarBean',$am_projectTemplate); |
|
10 | + $this->assertInstanceOf('AM_ProjectTemplates', $am_projectTemplate); |
|
11 | + $this->assertInstanceOf('Basic', $am_projectTemplate); |
|
12 | + $this->assertInstanceOf('SugarBean', $am_projectTemplate); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | $this->assertAttributeEquals('AM_ProjectTemplates', 'module_dir', $am_projectTemplate); |
@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | class AM_TaskTemplatesTest extends PHPUnit_Framework_TestCase { |
4 | 4 | |
5 | - public function testAM_TaskTemplates(){ |
|
5 | + public function testAM_TaskTemplates() { |
|
6 | 6 | |
7 | 7 | //execute the contructor and check for the Object type and type attribute |
8 | 8 | $am_taskTemplates = new AM_TaskTemplates(); |
9 | - $this->assertInstanceOf('AM_TaskTemplates',$am_taskTemplates); |
|
10 | - $this->assertInstanceOf('Basic',$am_taskTemplates); |
|
11 | - $this->assertInstanceOf('SugarBean',$am_taskTemplates); |
|
9 | + $this->assertInstanceOf('AM_TaskTemplates', $am_taskTemplates); |
|
10 | + $this->assertInstanceOf('Basic', $am_taskTemplates); |
|
11 | + $this->assertInstanceOf('SugarBean', $am_taskTemplates); |
|
12 | 12 | |
13 | 13 | $this->assertAttributeEquals('AM_TaskTemplates', 'module_dir', $am_taskTemplates); |
14 | 14 | $this->assertAttributeEquals('AM_TaskTemplates', 'object_name', $am_taskTemplates); |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -class ACLActionTest extends PHPUnit_Framework_TestCase{ |
|
4 | +class ACLActionTest extends PHPUnit_Framework_TestCase { |
|
5 | 5 | |
6 | 6 | |
7 | - public function testACLAction(){ |
|
7 | + public function testACLAction() { |
|
8 | 8 | |
9 | 9 | //execute the contructor and check for the Object type and type attribute |
10 | 10 | $aclAction = new ACLAction(); |
11 | - $this->assertInstanceOf('ACLAction',$aclAction); |
|
12 | - $this->assertInstanceOf('SugarBean',$aclAction); |
|
11 | + $this->assertInstanceOf('ACLAction', $aclAction); |
|
12 | + $this->assertInstanceOf('SugarBean', $aclAction); |
|
13 | 13 | |
14 | 14 | $this->assertAttributeEquals('ACLActions', 'module_dir', $aclAction); |
15 | 15 | $this->assertAttributeEquals('ACLAction', 'object_name', $aclAction); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | |
23 | - public function testaddActions(){ |
|
23 | + public function testaddActions() { |
|
24 | 24 | |
25 | 25 | error_reporting(E_ERROR | E_PARSE); |
26 | 26 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | - public function testremoveActions(){ |
|
36 | + public function testremoveActions() { |
|
37 | 37 | |
38 | 38 | //take count of actions initially and then after method execution and test if action count decreases |
39 | 39 | $action_count = count(ACLAction::getDefaultActions()); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | - public function testAccessName(){ |
|
47 | + public function testAccessName() { |
|
48 | 48 | |
49 | 49 | error_reporting(E_ERROR | E_PARSE); |
50 | 50 | |
@@ -55,95 +55,95 @@ discard block |
||
55 | 55 | |
56 | 56 | |
57 | 57 | |
58 | - public function testgetDefaultActions(){ |
|
58 | + public function testgetDefaultActions() { |
|
59 | 59 | global $beanList; |
60 | 60 | $actual = ACLAction::getDefaultActions(); |
61 | 61 | $this->assertTrue(is_array($actual)); //verify that it returns an array |
62 | - foreach($actual as $acl){ |
|
63 | - $this->assertInstanceOf("ACLAction",$acl); |
|
62 | + foreach ($actual as $acl) { |
|
63 | + $this->assertInstanceOf("ACLAction", $acl); |
|
64 | 64 | } |
65 | - $actual = ACLAction::getDefaultActions("module","list"); |
|
65 | + $actual = ACLAction::getDefaultActions("module", "list"); |
|
66 | 66 | $this->assertTrue(is_array($actual)); //verify that it returns an array |
67 | - foreach($actual as $acl){ |
|
68 | - $this->assertInstanceOf("ACLAction",$acl); |
|
69 | - $this->assertEquals("list",$acl->name); |
|
67 | + foreach ($actual as $acl) { |
|
68 | + $this->assertInstanceOf("ACLAction", $acl); |
|
69 | + $this->assertEquals("list", $acl->name); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | 73 | |
74 | - public function testgetUserActions(){ |
|
74 | + public function testgetUserActions() { |
|
75 | 75 | |
76 | 76 | $result1 = ACLAction::getUserActions('1'); |
77 | - $result2 = ACLAction::getUserActions('1',false,'Accounts'); |
|
78 | - $result3 = ACLAction::getUserActions('1',false,'Accounts','list'); |
|
77 | + $result2 = ACLAction::getUserActions('1', false, 'Accounts'); |
|
78 | + $result3 = ACLAction::getUserActions('1', false, 'Accounts', 'list'); |
|
79 | 79 | |
80 | 80 | //verify that all three results retunred are different |
81 | - $this->assertNotSame($result1,$result2); |
|
82 | - $this->assertNotSame($result1,$result3); |
|
83 | - $this->assertNotSame($result2,$result3); |
|
81 | + $this->assertNotSame($result1, $result2); |
|
82 | + $this->assertNotSame($result1, $result3); |
|
83 | + $this->assertNotSame($result2, $result3); |
|
84 | 84 | |
85 | 85 | } |
86 | 86 | |
87 | 87 | |
88 | - public function testhasAccess(){ |
|
88 | + public function testhasAccess() { |
|
89 | 89 | |
90 | 90 | $this->assertFalse(ACLAction::hasAccess()); //check with defaults |
91 | - $this->assertTrue(ACLAction::hasAccess(false,false,90)); //access All with is owner false |
|
92 | - $this->assertTrue(ACLAction::hasAccess(true,true,90)); //access All with is owner true |
|
93 | - $this->assertFalse(ACLAction::hasAccess(false,false,-98));// check access disabled |
|
94 | - $this->assertFalse(ACLAction::hasAccess(true,true,89)); //check access enabled |
|
95 | - $this->assertTrue(ACLAction::hasAccess(true,true,75)); //check owner access with is owner true |
|
96 | - $this->assertFalse(ACLAction::hasAccess(false,true,75)); //check owner access with is owner false |
|
91 | + $this->assertTrue(ACLAction::hasAccess(false, false, 90)); //access All with is owner false |
|
92 | + $this->assertTrue(ACLAction::hasAccess(true, true, 90)); //access All with is owner true |
|
93 | + $this->assertFalse(ACLAction::hasAccess(false, false, -98)); // check access disabled |
|
94 | + $this->assertFalse(ACLAction::hasAccess(true, true, 89)); //check access enabled |
|
95 | + $this->assertTrue(ACLAction::hasAccess(true, true, 75)); //check owner access with is owner true |
|
96 | + $this->assertFalse(ACLAction::hasAccess(false, true, 75)); //check owner access with is owner false |
|
97 | 97 | |
98 | 98 | } |
99 | 99 | |
100 | - public function testuserNeedsSecurityGroup(){ |
|
100 | + public function testuserNeedsSecurityGroup() { |
|
101 | 101 | |
102 | - $this->assertFalse( ACLAction::userNeedsSecurityGroup('1','',''));//test with empty module and action |
|
103 | - $this->assertFalse( ACLAction::userNeedsSecurityGroup('1','Accounts','list')); //test with valid module and action |
|
102 | + $this->assertFalse(ACLAction::userNeedsSecurityGroup('1', '', '')); //test with empty module and action |
|
103 | + $this->assertFalse(ACLAction::userNeedsSecurityGroup('1', 'Accounts', 'list')); //test with valid module and action |
|
104 | 104 | |
105 | 105 | } |
106 | 106 | |
107 | 107 | |
108 | - public function testuserHasAccess(){ |
|
108 | + public function testuserHasAccess() { |
|
109 | 109 | |
110 | - $this->assertFalse(ACLAction::userHasAccess('', '','')); //test with empty module and action |
|
111 | - $this->assertTrue(ACLAction::userHasAccess('', 'Accounts','list')); //test with e,pty user and valid module and action |
|
112 | - $this->assertTrue(ACLAction::userHasAccess('1', 'Accounts','list')); //test with valid User, module and action |
|
113 | - $this->assertTrue(ACLAction::userHasAccess('1', 'SecurityGroups','list')); //test with valid User, module and action |
|
114 | - $this->assertTrue(ACLAction::userHasAccess('1', 'Users','list')); //test with valid User, module and action |
|
110 | + $this->assertFalse(ACLAction::userHasAccess('', '', '')); //test with empty module and action |
|
111 | + $this->assertTrue(ACLAction::userHasAccess('', 'Accounts', 'list')); //test with e,pty user and valid module and action |
|
112 | + $this->assertTrue(ACLAction::userHasAccess('1', 'Accounts', 'list')); //test with valid User, module and action |
|
113 | + $this->assertTrue(ACLAction::userHasAccess('1', 'SecurityGroups', 'list')); //test with valid User, module and action |
|
114 | + $this->assertTrue(ACLAction::userHasAccess('1', 'Users', 'list')); //test with valid User, module and action |
|
115 | 115 | |
116 | 116 | } |
117 | 117 | |
118 | 118 | |
119 | - public function testgetUserAccessLevel(){ |
|
119 | + public function testgetUserAccessLevel() { |
|
120 | 120 | |
121 | 121 | //tes for accoounts module with two different actions |
122 | - $this->assertEquals(90,ACLAction::getUserAccessLevel('1', 'Accounts','list')); |
|
123 | - $this->assertEquals(89,ACLAction::getUserAccessLevel('1', 'Accounts','access')); |
|
122 | + $this->assertEquals(90, ACLAction::getUserAccessLevel('1', 'Accounts', 'list')); |
|
123 | + $this->assertEquals(89, ACLAction::getUserAccessLevel('1', 'Accounts', 'access')); |
|
124 | 124 | |
125 | 125 | //tes for users module with two different actions |
126 | - $this->assertEquals(90,ACLAction::getUserAccessLevel('1', 'Users','list')); |
|
127 | - $this->assertEquals(89,ACLAction::getUserAccessLevel('1', 'Users','access')); |
|
126 | + $this->assertEquals(90, ACLAction::getUserAccessLevel('1', 'Users', 'list')); |
|
127 | + $this->assertEquals(89, ACLAction::getUserAccessLevel('1', 'Users', 'access')); |
|
128 | 128 | |
129 | 129 | } |
130 | 130 | |
131 | 131 | |
132 | - public function testuserNeedsOwnership(){ |
|
132 | + public function testuserNeedsOwnership() { |
|
133 | 133 | |
134 | 134 | //test with invalid values |
135 | - $this->assertFalse(ACLAction::userNeedsOwnership('', '','')); |
|
135 | + $this->assertFalse(ACLAction::userNeedsOwnership('', '', '')); |
|
136 | 136 | |
137 | 137 | //test with valid values for different module and action combination |
138 | - $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Accounts','list')); |
|
139 | - $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Accounts','delete')); |
|
140 | - $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Users','delete')); |
|
141 | - $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Users','list')); |
|
138 | + $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Accounts', 'list')); |
|
139 | + $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Accounts', 'delete')); |
|
140 | + $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Users', 'delete')); |
|
141 | + $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Users', 'list')); |
|
142 | 142 | |
143 | 143 | } |
144 | 144 | |
145 | 145 | |
146 | - public function testsetupCategoriesMatrix(){ |
|
146 | + public function testsetupCategoriesMatrix() { |
|
147 | 147 | |
148 | 148 | //preset required data |
149 | 149 | $categories = Array(); |
@@ -153,13 +153,13 @@ discard block |
||
153 | 153 | |
154 | 154 | $names_expected = Array("list"=> "List", "edit"=>"Edit"); |
155 | 155 | |
156 | - $categories_expected = array ( |
|
156 | + $categories_expected = array( |
|
157 | 157 | 'Accounts' => |
158 | - array ( |
|
158 | + array( |
|
159 | 159 | 'module' => |
160 | - array ( |
|
161 | - 'list' => array ( 'list', 'accessColor' => false, 'accessName' => false, 'accessLabel' => false, 'accessOptions' => array ( 90 => 'All', 80 => 'Group', 75 => 'Owner', 0 => 'Not Set', -99 => 'None', ), ), |
|
162 | - 'edit' => array ( 'edit', 'accessColor' => false, 'accessName' => false, 'accessLabel' => false, 'accessOptions' => array ( 90 => 'All', 80 => 'Group', 75 => 'Owner', 0 => 'Not Set', -99 => 'None' ), ), |
|
160 | + array( |
|
161 | + 'list' => array('list', 'accessColor' => false, 'accessName' => false, 'accessLabel' => false, 'accessOptions' => array(90 => 'All', 80 => 'Group', 75 => 'Owner', 0 => 'Not Set', -99 => 'None',),), |
|
162 | + 'edit' => array('edit', 'accessColor' => false, 'accessName' => false, 'accessLabel' => false, 'accessOptions' => array(90 => 'All', 80 => 'Group', 75 => 'Owner', 0 => 'Not Set', -99 => 'None'),), |
|
163 | 163 | ), |
164 | 164 | ), |
165 | 165 | ); |
@@ -172,37 +172,37 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | |
175 | - public function testtoArray(){ |
|
175 | + public function testtoArray() { |
|
176 | 176 | |
177 | 177 | $aclAction = new ACLAction(); |
178 | 178 | |
179 | 179 | //wihout any fields set |
180 | 180 | $expected = Array("id"=> NULL, "aclaccess"=> NULL); |
181 | 181 | $actual = $aclAction->toArray(); |
182 | - $this->assertSame($expected,$actual); |
|
182 | + $this->assertSame($expected, $actual); |
|
183 | 183 | |
184 | 184 | |
185 | 185 | //with fileds pre populated |
186 | - $aclAction->populateFromRow(Array("id"=>"1234","aclaccess"=>"9999")); |
|
187 | - $expected = Array("id"=>"1234","aclaccess"=>"9999"); |
|
186 | + $aclAction->populateFromRow(Array("id"=>"1234", "aclaccess"=>"9999")); |
|
187 | + $expected = Array("id"=>"1234", "aclaccess"=>"9999"); |
|
188 | 188 | $actual = $aclAction->toArray(); |
189 | - $this->assertSame($expected,$actual); |
|
189 | + $this->assertSame($expected, $actual); |
|
190 | 190 | |
191 | 191 | } |
192 | 192 | |
193 | - public function testfromArray(){ |
|
193 | + public function testfromArray() { |
|
194 | 194 | |
195 | 195 | $aclAction = new ACLAction(); |
196 | - $arr = Array("id"=>"1234","name"=>"test"); |
|
196 | + $arr = Array("id"=>"1234", "name"=>"test"); |
|
197 | 197 | |
198 | 198 | //execute the method and verify that it retunrs expected results |
199 | 199 | $aclAction->fromArray($arr); |
200 | - $this->assertSame($aclAction->id,"1234"); |
|
201 | - $this->assertSame($aclAction->name,"test"); |
|
200 | + $this->assertSame($aclAction->id, "1234"); |
|
201 | + $this->assertSame($aclAction->name, "test"); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | |
205 | - public function testclearSessionCache(){ |
|
205 | + public function testclearSessionCache() { |
|
206 | 206 | |
207 | 207 | $aclAction = new ACLAction(); |
208 | 208 |
@@ -2,14 +2,14 @@ discard block |
||
2 | 2 | |
3 | 3 | class AOS_Products_QuotesTest extends PHPUnit_Framework_TestCase { |
4 | 4 | |
5 | - public function testAOS_Products_Quotes(){ |
|
5 | + public function testAOS_Products_Quotes() { |
|
6 | 6 | |
7 | 7 | |
8 | 8 | //execute the contructor and check for the Object type and attributes |
9 | 9 | $aosProductsQuotes = new AOS_Products_Quotes(); |
10 | - $this->assertInstanceOf('AOS_Products_Quotes',$aosProductsQuotes); |
|
11 | - $this->assertInstanceOf('Basic',$aosProductsQuotes); |
|
12 | - $this->assertInstanceOf('SugarBean',$aosProductsQuotes); |
|
10 | + $this->assertInstanceOf('AOS_Products_Quotes', $aosProductsQuotes); |
|
11 | + $this->assertInstanceOf('Basic', $aosProductsQuotes); |
|
12 | + $this->assertInstanceOf('SugarBean', $aosProductsQuotes); |
|
13 | 13 | |
14 | 14 | $this->assertAttributeEquals('AOS_Products_Quotes', 'module_dir', $aosProductsQuotes); |
15 | 15 | $this->assertAttributeEquals('AOS_Products_Quotes', 'object_name', $aosProductsQuotes); |
@@ -20,18 +20,18 @@ discard block |
||
20 | 20 | |
21 | 21 | } |
22 | 22 | |
23 | - public function testsave_lines(){ |
|
23 | + public function testsave_lines() { |
|
24 | 24 | |
25 | 25 | error_reporting(E_ERROR | E_PARSE); |
26 | 26 | |
27 | 27 | $aosProductsQuotes = new AOS_Products_Quotes(); |
28 | 28 | |
29 | 29 | //populate required values |
30 | - $post_data= Array(); |
|
31 | - $post_data["name"] = Array('test1','test2'); |
|
32 | - $post_data["group_number"] = Array('1','2'); |
|
33 | - $post_data["product_id"] = Array('1','1'); |
|
34 | - $post_data["product_unit_price"] = Array(100,200); |
|
30 | + $post_data = Array(); |
|
31 | + $post_data["name"] = Array('test1', 'test2'); |
|
32 | + $post_data["group_number"] = Array('1', '2'); |
|
33 | + $post_data["product_id"] = Array('1', '1'); |
|
34 | + $post_data["product_unit_price"] = Array(100, 200); |
|
35 | 35 | |
36 | 36 | //create parent bean |
37 | 37 | $aosQuote = new AOS_Quotes(); |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | |
42 | 42 | //get the linked beans and verify if records created |
43 | 43 | $product_quote_lines = $aosQuote->get_linked_beans('aos_products_quotes', $aosQuote->object_name); |
44 | - $this->assertEquals(count($post_data["name"]), count($product_quote_lines) ); |
|
44 | + $this->assertEquals(count($post_data["name"]), count($product_quote_lines)); |
|
45 | 45 | |
46 | 46 | } |
47 | 47 | |
48 | - public function testmark_lines_deleted(){ |
|
48 | + public function testmark_lines_deleted() { |
|
49 | 49 | |
50 | 50 | $aosProductsQuotes = new AOS_Products_Quotes(); |
51 | 51 | |
@@ -70,16 +70,16 @@ discard block |
||
70 | 70 | $product_quote_lines = $aosQuote->get_linked_beans('aos_products_quotes', $aosQuote->object_name); |
71 | 71 | $actual = count($product_quote_lines); |
72 | 72 | |
73 | - $this->assertLessThan($expected,$actual); |
|
73 | + $this->assertLessThan($expected, $actual); |
|
74 | 74 | |
75 | 75 | } |
76 | 76 | |
77 | - public function testsave(){ |
|
77 | + public function testsave() { |
|
78 | 78 | |
79 | 79 | $aosProductsQuotes = new AOS_Products_Quotes(); |
80 | 80 | |
81 | 81 | $aosProductsQuotes->name = 'test'; |
82 | - $aosProductsQuotes->product_id= 1; |
|
82 | + $aosProductsQuotes->product_id = 1; |
|
83 | 83 | $aosProductsQuotes->product_unit_price = 100; |
84 | 84 | |
85 | 85 | $aosProductsQuotes->save(); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | //mark the record as deleted and verify that this record cannot be retrieved anymore. |
94 | 94 | $aosProductsQuotes->mark_deleted($aosProductsQuotes->id); |
95 | 95 | $result = $aosProductsQuotes->retrieve($aosProductsQuotes->id); |
96 | - $this->assertEquals(null,$result); |
|
96 | + $this->assertEquals(null, $result); |
|
97 | 97 | |
98 | 98 | } |
99 | 99 |
@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | class AOK_KnowledgeBaseTest extends PHPUnit_Framework_TestCase { |
4 | 4 | |
5 | - public function testAOK_KnowledgeBase(){ |
|
5 | + public function testAOK_KnowledgeBase() { |
|
6 | 6 | |
7 | 7 | //execute the contructor and check for the Object type and type attribute |
8 | 8 | $aok_KnowledgeBase = new AOK_KnowledgeBase(); |
9 | - $this->assertInstanceOf('AOK_KnowledgeBase',$aok_KnowledgeBase); |
|
10 | - $this->assertInstanceOf('Basic',$aok_KnowledgeBase); |
|
11 | - $this->assertInstanceOf('SugarBean',$aok_KnowledgeBase); |
|
9 | + $this->assertInstanceOf('AOK_KnowledgeBase', $aok_KnowledgeBase); |
|
10 | + $this->assertInstanceOf('Basic', $aok_KnowledgeBase); |
|
11 | + $this->assertInstanceOf('SugarBean', $aok_KnowledgeBase); |
|
12 | 12 | |
13 | 13 | $this->assertAttributeEquals('AOK_KnowledgeBase', 'module_dir', $aok_KnowledgeBase); |
14 | 14 | $this->assertAttributeEquals('AOK_KnowledgeBase', 'object_name', $aok_KnowledgeBase); |
@@ -2,13 +2,13 @@ discard block |
||
2 | 2 | |
3 | 3 | class AOS_Line_Item_GroupsTest extends PHPUnit_Framework_TestCase { |
4 | 4 | |
5 | - public function testAOS_Line_Item_Groups(){ |
|
5 | + public function testAOS_Line_Item_Groups() { |
|
6 | 6 | |
7 | 7 | //execute the contructor and check for the Object type and attributes |
8 | 8 | $aosLineItemGroup = new AOS_Line_Item_Groups(); |
9 | - $this->assertInstanceOf('AOS_Line_Item_Groups',$aosLineItemGroup); |
|
10 | - $this->assertInstanceOf('Basic',$aosLineItemGroup); |
|
11 | - $this->assertInstanceOf('SugarBean',$aosLineItemGroup); |
|
9 | + $this->assertInstanceOf('AOS_Line_Item_Groups', $aosLineItemGroup); |
|
10 | + $this->assertInstanceOf('Basic', $aosLineItemGroup); |
|
11 | + $this->assertInstanceOf('SugarBean', $aosLineItemGroup); |
|
12 | 12 | |
13 | 13 | $this->assertAttributeEquals('AOS_Line_Item_Groups', 'module_dir', $aosLineItemGroup); |
14 | 14 | $this->assertAttributeEquals('AOS_Line_Item_Groups', 'object_name', $aosLineItemGroup); |
@@ -21,18 +21,18 @@ discard block |
||
21 | 21 | |
22 | 22 | } |
23 | 23 | |
24 | - public function testsave_groups(){ |
|
24 | + public function testsave_groups() { |
|
25 | 25 | |
26 | 26 | error_reporting(E_ERROR | E_PARSE); |
27 | 27 | |
28 | 28 | $aosLineItemGroup = new AOS_Line_Item_Groups(); |
29 | 29 | |
30 | 30 | //populate required values |
31 | - $post_data= Array(); |
|
32 | - $post_data["group_number"] = Array(0,0); |
|
33 | - $post_data["name"] = Array('test1','test2'); |
|
34 | - $post_data["total_amount"] = Array('100','200'); |
|
35 | - $post_data["total_amount_usdollar"] = Array('100','200'); |
|
31 | + $post_data = Array(); |
|
32 | + $post_data["group_number"] = Array(0, 0); |
|
33 | + $post_data["name"] = Array('test1', 'test2'); |
|
34 | + $post_data["total_amount"] = Array('100', '200'); |
|
35 | + $post_data["total_amount_usdollar"] = Array('100', '200'); |
|
36 | 36 | |
37 | 37 | //create parent bean for line item groups |
38 | 38 | $aosContract = new AOS_Contracts(); |
@@ -43,23 +43,23 @@ discard block |
||
43 | 43 | //get the linked beans and verify if records created |
44 | 44 | $line_item_groups = $aosContract->get_linked_beans('aos_line_item_groups', $aosContract->object_name); |
45 | 45 | |
46 | - $this->assertEquals(count($post_data["group_number"]), count($line_item_groups) ); |
|
46 | + $this->assertEquals(count($post_data["group_number"]), count($line_item_groups)); |
|
47 | 47 | |
48 | 48 | //cleanup afterwards |
49 | - foreach($line_item_groups as $lineItem){ |
|
49 | + foreach ($line_item_groups as $lineItem) { |
|
50 | 50 | $lineItem->mark_deleted($lineItem->id); |
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | } |
55 | 55 | |
56 | - public function testsave(){ |
|
56 | + public function testsave() { |
|
57 | 57 | |
58 | 58 | |
59 | 59 | |
60 | 60 | $aosLineItemGroup = new AOS_Line_Item_Groups(); |
61 | 61 | $aosLineItemGroup->name = 'test'; |
62 | - $aosLineItemGroup->total_amount= 100; |
|
62 | + $aosLineItemGroup->total_amount = 100; |
|
63 | 63 | $aosLineItemGroup->total_amount_usdollar = 100; |
64 | 64 | |
65 | 65 | $aosLineItemGroup->save(); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | //mark the record as deleted and verify that this record cannot be retrieved anymore. |
74 | 74 | $aosLineItemGroup->mark_deleted($aosLineItemGroup->id); |
75 | 75 | $result = $aosLineItemGroup->retrieve($aosLineItemGroup->id); |
76 | - $this->assertEquals(null,$result); |
|
76 | + $this->assertEquals(null, $result); |
|
77 | 77 | |
78 | 78 | |
79 | 79 | } |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | //execute the contructor and check for the Object type and attributes |
9 | 9 | $emailTemplate = new EmailTemplate(); |
10 | 10 | |
11 | - $this->assertInstanceOf('EmailTemplate',$emailTemplate); |
|
12 | - $this->assertInstanceOf('SugarBean',$emailTemplate); |
|
11 | + $this->assertInstanceOf('EmailTemplate', $emailTemplate); |
|
12 | + $this->assertInstanceOf('SugarBean', $emailTemplate); |
|
13 | 13 | |
14 | 14 | $this->assertAttributeEquals('EmailTemplates', 'module_dir', $emailTemplate); |
15 | 15 | $this->assertAttributeEquals('EmailTemplate', 'object_name', $emailTemplate); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $actual = $emailTemplate->generateFieldDefsJS(); |
32 | 32 | //$this->assertSame($expected,$actual); |
33 | 33 | |
34 | - $this->assertGreaterThan(0 , strlen($actual)); |
|
34 | + $this->assertGreaterThan(0, strlen($actual)); |
|
35 | 35 | |
36 | 36 | } |
37 | 37 | |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | $emailTemplate = new EmailTemplate(); |
41 | 41 | |
42 | 42 | //test without setting name |
43 | - $this->assertEquals(Null,$emailTemplate->get_summary_text()); |
|
43 | + $this->assertEquals(Null, $emailTemplate->get_summary_text()); |
|
44 | 44 | |
45 | 45 | //test with name set |
46 | 46 | $emailTemplate->name = "test"; |
47 | - $this->assertEquals('test',$emailTemplate->get_summary_text()); |
|
47 | + $this->assertEquals('test', $emailTemplate->get_summary_text()); |
|
48 | 48 | |
49 | 49 | } |
50 | 50 | |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | |
55 | 55 | //test with empty string params |
56 | 56 | $expected = " SELECT email_templates.* , jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner , 'Users' assigned_user_name_mod FROM email_templates LEFT JOIN users jt0 ON email_templates.assigned_user_id=jt0.id AND jt0.deleted=0\n\n AND jt0.deleted=0 where email_templates.deleted=0"; |
57 | - $actual = $emailTemplate->create_export_query('',''); |
|
58 | - $this->assertSame($expected,$actual); |
|
57 | + $actual = $emailTemplate->create_export_query('', ''); |
|
58 | + $this->assertSame($expected, $actual); |
|
59 | 59 | |
60 | 60 | |
61 | 61 | //test with valid string params |
62 | 62 | $expected = " SELECT email_templates.* , jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner , 'Users' assigned_user_name_mod FROM email_templates LEFT JOIN users jt0 ON email_templates.assigned_user_id=jt0.id AND jt0.deleted=0\n\n AND jt0.deleted=0 where (email_templates.name=\"\") AND email_templates.deleted=0"; |
63 | - $actual = $emailTemplate->create_export_query('email_templates.id','email_templates.name=""'); |
|
64 | - $this->assertSame($expected,$actual); |
|
63 | + $actual = $emailTemplate->create_export_query('email_templates.id', 'email_templates.name=""'); |
|
64 | + $this->assertSame($expected, $actual); |
|
65 | 65 | |
66 | 66 | } |
67 | 67 | |
@@ -121,13 +121,13 @@ discard block |
||
121 | 121 | $emailTemplate = new EmailTemplate(); |
122 | 122 | |
123 | 123 | //execute the method and verify that it retunrs expected results |
124 | - $expected = array ( |
|
124 | + $expected = array( |
|
125 | 125 | 'DELETED' => 0, |
126 | 126 | 'DATE_MODIFIED' => false, |
127 | 127 | ); |
128 | 128 | |
129 | 129 | $actual = $emailTemplate->get_list_view_data(); |
130 | - $this->assertSame($expected,$actual); |
|
130 | + $this->assertSame($expected, $actual); |
|
131 | 131 | |
132 | 132 | } |
133 | 133 | |
@@ -144,14 +144,14 @@ discard block |
||
144 | 144 | $expected = array( |
145 | 145 | "subject"=> "test subject", "body_html"=>"test html", "body"=>"test body text" |
146 | 146 | ); |
147 | - $actual = $emailTemplate->parse_email_template(array('subject'=>"test subject",'body_html'=>"test html",'body'=>"test body text"),'Accounts', $account, $macro_nv ); |
|
147 | + $actual = $emailTemplate->parse_email_template(array('subject'=>"test subject", 'body_html'=>"test html", 'body'=>"test body text"), 'Accounts', $account, $macro_nv); |
|
148 | 148 | $this->assertSame($expected, $actual); |
149 | 149 | |
150 | 150 | |
151 | 151 | |
152 | 152 | //test Parse_tracker_urls |
153 | - $tracker_url_template= 'localhost/index.php?entryPoint=campaign_trackerv2&track=%s&identifier=tracker_key'; |
|
154 | - $removeme_url_template= 'localhost/index.php?entryPoint=removeme&identifier=tracker_key'; |
|
153 | + $tracker_url_template = 'localhost/index.php?entryPoint=campaign_trackerv2&track=%s&identifier=tracker_key'; |
|
154 | + $removeme_url_template = 'localhost/index.php?entryPoint=removeme&identifier=tracker_key'; |
|
155 | 155 | $tracker_urls = array(); |
156 | 156 | |
157 | 157 | $result = $emailTemplate->parse_tracker_urls($actual, $tracker_url_template, $tracker_urls, $removeme_url_template); |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | |
165 | 165 | $emailTemplate = new EmailTemplate(); |
166 | 166 | |
167 | - $this->assertEquals( 10 ,$emailTemplate->_convertToType('float',10)); |
|
168 | - $this->assertEquals( "test text" ,$emailTemplate->_convertToType('text',"test text")); |
|
169 | - $this->assertEquals( "$10.00" ,$emailTemplate->_convertToType('currency',10)); |
|
167 | + $this->assertEquals(10, $emailTemplate->_convertToType('float', 10)); |
|
168 | + $this->assertEquals("test text", $emailTemplate->_convertToType('text', "test text")); |
|
169 | + $this->assertEquals("$10.00", $emailTemplate->_convertToType('currency', 10)); |
|
170 | 170 | |
171 | 171 | } |
172 | 172 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | //execute the method and verify that it retunrs expected results |
181 | 181 | |
182 | - $expected = array ( |
|
182 | + $expected = array( |
|
183 | 183 | 'contact_user_name' => '', |
184 | 184 | 'contact_user_id' => '', |
185 | 185 | 'contact_user_user_name' => '', |
@@ -267,11 +267,11 @@ discard block |
||
267 | 267 | $this->assertEquals("", $actual); |
268 | 268 | |
269 | 269 | //test with valid string |
270 | - $actual = $emailTemplate->parse_template_bean("test", "Users", $user ); |
|
270 | + $actual = $emailTemplate->parse_template_bean("test", "Users", $user); |
|
271 | 271 | $this->assertEquals("test", $actual); |
272 | 272 | |
273 | 273 | //test with empty string and different module |
274 | - $actual = $emailTemplate->parse_template_bean("", "Accounts", $account ); |
|
274 | + $actual = $emailTemplate->parse_template_bean("", "Accounts", $account); |
|
275 | 275 | $this->assertEquals("", $actual); |
276 | 276 | |
277 | 277 | } |
@@ -285,12 +285,12 @@ discard block |
||
285 | 285 | |
286 | 286 | //test with empty string |
287 | 287 | $result = $emailTemplate->parse_template("", $bean_arr); |
288 | - $this->assertEquals("",$result); |
|
288 | + $this->assertEquals("", $result); |
|
289 | 289 | |
290 | 290 | |
291 | 291 | //test with valid string |
292 | 292 | $result = $emailTemplate->parse_template("some value", $bean_arr); |
293 | - $this->assertEquals("some value",$result); |
|
293 | + $this->assertEquals("some value", $result); |
|
294 | 294 | |
295 | 295 | } |
296 | 296 | |
@@ -307,13 +307,13 @@ discard block |
||
307 | 307 | public function testgetTypeOptionsForSearch() |
308 | 308 | { |
309 | 309 | //execute the method and verify that it retunrs expected results |
310 | - $expected = array ( |
|
310 | + $expected = array( |
|
311 | 311 | '' => '', |
312 | 312 | 'campaign' => 'Campaign', |
313 | 313 | 'email' => 'Email', |
314 | 314 | ); |
315 | 315 | $actual = EmailTemplate::getTypeOptionsForSearch(); |
316 | - $this->assertSame($expected,$actual); |
|
316 | + $this->assertSame($expected, $actual); |
|
317 | 317 | |
318 | 318 | } |
319 | 319 | |
@@ -322,12 +322,12 @@ discard block |
||
322 | 322 | $emailTemplate = new EmailTemplate(); |
323 | 323 | |
324 | 324 | //test without id attribute |
325 | - $this->assertEquals(false,$emailTemplate->is_used_by_email_marketing()); |
|
325 | + $this->assertEquals(false, $emailTemplate->is_used_by_email_marketing()); |
|
326 | 326 | |
327 | 327 | |
328 | 328 | //test with id attribute |
329 | 329 | $emailTemplate->id = 1; |
330 | - $this->assertEquals(false,$emailTemplate->is_used_by_email_marketing()); |
|
330 | + $this->assertEquals(false, $emailTemplate->is_used_by_email_marketing()); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | public function testcleanBean() |
@@ -337,13 +337,13 @@ discard block |
||
337 | 337 | |
338 | 338 | //test without body_html attribute |
339 | 339 | $emailTemplate->cleanBean(); |
340 | - $this->assertEquals("",$emailTemplate->body_html); |
|
340 | + $this->assertEquals("", $emailTemplate->body_html); |
|
341 | 341 | |
342 | 342 | |
343 | 343 | //test with body_html attribute |
344 | 344 | $emailTemplate->body_html = "<h1>text</h1>"; |
345 | 345 | $emailTemplate->cleanBean(); |
346 | - $this->assertEquals("<h1>text</h1>",$emailTemplate->body_html); |
|
346 | + $this->assertEquals("<h1>text</h1>", $emailTemplate->body_html); |
|
347 | 347 | |
348 | 348 | } |
349 | 349 |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | |
4 | 4 | class AOW_ActionTest extends PHPUnit_Framework_TestCase { |
5 | 5 | |
6 | - public function testAOW_Action(){ |
|
6 | + public function testAOW_Action() { |
|
7 | 7 | |
8 | 8 | //execute the contructor and check for the Object type and attributes |
9 | 9 | $aowAction = new AOW_Action(); |
10 | - $this->assertInstanceOf('AOW_Action',$aowAction); |
|
11 | - $this->assertInstanceOf('Basic',$aowAction); |
|
12 | - $this->assertInstanceOf('SugarBean',$aowAction); |
|
10 | + $this->assertInstanceOf('AOW_Action', $aowAction); |
|
11 | + $this->assertInstanceOf('Basic', $aowAction); |
|
12 | + $this->assertInstanceOf('SugarBean', $aowAction); |
|
13 | 13 | |
14 | 14 | $this->assertAttributeEquals('AOW_Actions', 'module_dir', $aowAction); |
15 | 15 | $this->assertAttributeEquals('AOW_Action', 'object_name', $aowAction); |
@@ -21,17 +21,17 @@ discard block |
||
21 | 21 | |
22 | 22 | } |
23 | 23 | |
24 | - public function testsave_lines(){ |
|
24 | + public function testsave_lines() { |
|
25 | 25 | |
26 | 26 | error_reporting(E_ERROR | E_PARSE); |
27 | 27 | |
28 | 28 | $aowAction = new AOW_Action(); |
29 | 29 | |
30 | 30 | //populate required values |
31 | - $post_data= Array(); |
|
32 | - $post_data["name"] = Array('test1','test2'); |
|
33 | - $post_data["action"] = Array('action1','action2'); |
|
34 | - $post_data["param"] = Array(array('param1'=>'value'),array('value'=>array('param2'=>'value'))); |
|
31 | + $post_data = Array(); |
|
32 | + $post_data["name"] = Array('test1', 'test2'); |
|
33 | + $post_data["action"] = Array('action1', 'action2'); |
|
34 | + $post_data["param"] = Array(array('param1'=>'value'), array('value'=>array('param2'=>'value'))); |
|
35 | 35 | |
36 | 36 | |
37 | 37 | //create parent bean |
@@ -44,17 +44,17 @@ discard block |
||
44 | 44 | |
45 | 45 | //get the linked beans and verify if records created |
46 | 46 | $aow_actions = $aowWorkFlow->get_linked_beans('aow_actions', $aowWorkFlow->object_name); |
47 | - $this->assertEquals(count($post_data["action"]), count($aow_actions) ); |
|
47 | + $this->assertEquals(count($post_data["action"]), count($aow_actions)); |
|
48 | 48 | |
49 | 49 | |
50 | 50 | //cleanup afterwards |
51 | - foreach($aow_actions as $lineItem){ |
|
51 | + foreach ($aow_actions as $lineItem) { |
|
52 | 52 | $lineItem->mark_deleted($lineItem->id); |
53 | 53 | } |
54 | 54 | |
55 | 55 | } |
56 | 56 | |
57 | - public function testbean_implements(){ |
|
57 | + public function testbean_implements() { |
|
58 | 58 | |
59 | 59 | error_reporting(E_ERROR | E_PARSE); |
60 | 60 |