@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | //execute the contructor and check for the Object type and attributes |
9 | 9 | $projectTask = new ProjectTask(); |
10 | 10 | |
11 | - $this->assertInstanceOf('ProjectTask',$projectTask); |
|
12 | - $this->assertInstanceOf('SugarBean',$projectTask); |
|
11 | + $this->assertInstanceOf('ProjectTask', $projectTask); |
|
12 | + $this->assertInstanceOf('SugarBean', $projectTask); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | $this->assertAttributeEquals('project_task', 'table_name', $projectTask); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | //$projectTask->project_id = "1"; |
48 | 48 | $projectTask->assigned_user_id = "1"; |
49 | 49 | $projectTask->description = "test description"; |
50 | - $projectTask->parent_task_id =1; |
|
50 | + $projectTask->parent_task_id = 1; |
|
51 | 51 | |
52 | 52 | $projectTask->save(); |
53 | 53 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | //mark the record as deleted and verify that this record cannot be retrieved anymore. |
65 | 65 | $projectTask->mark_deleted($projectTask->id); |
66 | 66 | $result = $projectTask->retrieve($projectTask->id); |
67 | - $this->assertEquals(null,$result); |
|
67 | + $this->assertEquals(null, $result); |
|
68 | 68 | |
69 | 69 | } |
70 | 70 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | $result = $projectTask->_get_depends_on_name($id); |
77 | 77 | |
78 | - $this->assertEquals("1", $projectTask->depends_on_name_owner) ; |
|
78 | + $this->assertEquals("1", $projectTask->depends_on_name_owner); |
|
79 | 79 | $this->assertEquals("ProjectTask", $projectTask->depends_on_name_mod); |
80 | 80 | $this->assertEquals("test", $result); |
81 | 81 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | $projectTask = new ProjectTask(); |
106 | 106 | |
107 | - $projectTask->parent_task_id =1; |
|
107 | + $projectTask->parent_task_id = 1; |
|
108 | 108 | $result = $projectTask->getProjectTaskParent(); |
109 | 109 | $this->assertEquals(false, $result); |
110 | 110 | |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | $projectTask = new ProjectTask(); |
181 | 181 | |
182 | 182 | //test without setting name |
183 | - $this->assertEquals(Null,$projectTask->get_summary_text()); |
|
183 | + $this->assertEquals(Null, $projectTask->get_summary_text()); |
|
184 | 184 | |
185 | 185 | //test with name set |
186 | 186 | $projectTask->name = "test"; |
187 | - $this->assertEquals('test',$projectTask->get_summary_text()); |
|
187 | + $this->assertEquals('test', $projectTask->get_summary_text()); |
|
188 | 188 | |
189 | 189 | } |
190 | 190 | |
@@ -228,17 +228,17 @@ discard block |
||
228 | 228 | //test with empty string params |
229 | 229 | $expected = "project_task.name like '%'"; |
230 | 230 | $actual = $projectTask->build_generic_where_clause(''); |
231 | - $this->assertSame($expected,$actual); |
|
231 | + $this->assertSame($expected, $actual); |
|
232 | 232 | |
233 | 233 | |
234 | 234 | //test with valid string params |
235 | 235 | $expected = "project_task.name like '%'"; |
236 | 236 | $actual = $projectTask->build_generic_where_clause('test'); |
237 | - $this->assertSame($expected,$actual); |
|
237 | + $this->assertSame($expected, $actual); |
|
238 | 238 | |
239 | 239 | } |
240 | 240 | |
241 | - public function testget_list_view_data(){ |
|
241 | + public function testget_list_view_data() { |
|
242 | 242 | |
243 | 243 | $projectTask = new ProjectTask(); |
244 | 244 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $projectTask->description = "test assigned user"; |
247 | 247 | $projectTask->parent_type = "Project"; |
248 | 248 | |
249 | - $expected = array ( |
|
249 | + $expected = array( |
|
250 | 250 | 'NAME' => 'tes user', |
251 | 251 | 'DESCRIPTION' => 'test assigned user', |
252 | 252 | 'ORDER_NUMBER' => '1', |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | |
267 | 267 | } |
268 | 268 | |
269 | - public function testbean_implements(){ |
|
269 | + public function testbean_implements() { |
|
270 | 270 | |
271 | 271 | $projectTask = new ProjectTask(); |
272 | 272 | |
@@ -275,13 +275,13 @@ discard block |
||
275 | 275 | $this->assertEquals(true, $projectTask->bean_implements('ACL')); //test with valid value |
276 | 276 | } |
277 | 277 | |
278 | - public function testlistviewACLHelper(){ |
|
278 | + public function testlistviewACLHelper() { |
|
279 | 279 | |
280 | 280 | $projectTask = new ProjectTask(); |
281 | 281 | |
282 | - $expected = array( 'MAIN' => 'a', 'PARENT' => 'a', 'PARENT_TASK' => 'a' ); |
|
282 | + $expected = array('MAIN' => 'a', 'PARENT' => 'a', 'PARENT_TASK' => 'a'); |
|
283 | 283 | $actual = $projectTask->listviewACLHelper(); |
284 | - $this->assertSame($expected,$actual); |
|
284 | + $this->assertSame($expected, $actual); |
|
285 | 285 | |
286 | 286 | } |
287 | 287 | |
@@ -292,14 +292,14 @@ discard block |
||
292 | 292 | |
293 | 293 | //test with empty string params |
294 | 294 | $expected = "SELECT\n project_task.*,\n users.user_name as assigned_user_name FROM project_task LEFT JOIN project ON project_task.project_id=project.id AND project.deleted=0 LEFT JOIN users\n ON project_task.assigned_user_id=users.id where project_task.deleted=0 "; |
295 | - $actual = $projectTask->create_export_query('',''); |
|
296 | - $this->assertSame($expected,$actual); |
|
295 | + $actual = $projectTask->create_export_query('', ''); |
|
296 | + $this->assertSame($expected, $actual); |
|
297 | 297 | |
298 | 298 | |
299 | 299 | //test with valid string params |
300 | 300 | $expected = "SELECT\n project_task.*,\n users.user_name as assigned_user_name FROM project_task LEFT JOIN project ON project_task.project_id=project.id AND project.deleted=0 LEFT JOIN users\n ON project_task.assigned_user_id=users.id where (users.user_name= \"\") AND project_task.deleted=0 ORDER BY project_task.id"; |
301 | - $actual = $projectTask->create_export_query('project_task.id','users.user_name= ""'); |
|
302 | - $this->assertSame($expected,$actual); |
|
301 | + $actual = $projectTask->create_export_query('project_task.id', 'users.user_name= ""'); |
|
302 | + $this->assertSame($expected, $actual); |
|
303 | 303 | |
304 | 304 | } |
305 | 305 | |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | |
311 | 311 | $expected = "<select name=\"utilization\">\n<OPTION value='0'>none</OPTION>\n<OPTION value='25'>25</OPTION>\n<OPTION value='50'>50</OPTION>\n<OPTION value='75'>75</OPTION>\n<OPTION value='100'>100</OPTION></select>"; |
312 | 312 | $actual = getUtilizationDropdown($projectTask, 'utilization', '0', 'EditView'); |
313 | - $this->assertSame($expected,$actual); |
|
313 | + $this->assertSame($expected, $actual); |
|
314 | 314 | |
315 | 315 | } |
316 | 316 |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | //execute the contructor and check for the Object type and attributes |
11 | 11 | $document = new Document(); |
12 | - $this->assertInstanceOf('Document',$document); |
|
13 | - $this->assertInstanceOf('File',$document); |
|
14 | - $this->assertInstanceOf('SugarBean',$document); |
|
12 | + $this->assertInstanceOf('Document', $document); |
|
13 | + $this->assertInstanceOf('File', $document); |
|
14 | + $this->assertInstanceOf('SugarBean', $document); |
|
15 | 15 | |
16 | 16 | $this->assertAttributeEquals('Documents', 'module_dir', $document); |
17 | 17 | $this->assertAttributeEquals('Document', 'object_name', $document); |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | $document = new Document(); |
30 | 30 | |
31 | 31 | $document->filename = "test"; |
32 | - $document->file_url ="test_url"; |
|
33 | - $document->file_url_noimage= "test_image_url"; |
|
34 | - $document->last_rev_created_name= "test"; |
|
32 | + $document->file_url = "test_url"; |
|
33 | + $document->file_url_noimage = "test_image_url"; |
|
34 | + $document->last_rev_created_name = "test"; |
|
35 | 35 | $document->category_id = "1"; |
36 | - $document->subcategory_id = "1" ; |
|
36 | + $document->subcategory_id = "1"; |
|
37 | 37 | $document->document_name = "test"; |
38 | 38 | |
39 | 39 | $document->save(); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | //mark the record as deleted and verify that this record cannot be retrieved anymore. |
53 | 53 | $document->mark_deleted($document->id); |
54 | 54 | $result = $document->retrieve($document->id); |
55 | - $this->assertEquals(null,$result); |
|
55 | + $this->assertEquals(null, $result); |
|
56 | 56 | |
57 | 57 | } |
58 | 58 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | $document = new Document(); |
63 | 63 | |
64 | 64 | //test without setting name |
65 | - $this->assertEquals(Null,$document->get_summary_text()); |
|
65 | + $this->assertEquals(Null, $document->get_summary_text()); |
|
66 | 66 | |
67 | 67 | //test with name set |
68 | 68 | $document->document_name = "test"; |
69 | - $this->assertEquals('test',$document->get_summary_text()); |
|
69 | + $this->assertEquals('test', $document->get_summary_text()); |
|
70 | 70 | |
71 | 71 | } |
72 | 72 | |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | $document = new Document(); |
77 | 77 | |
78 | 78 | //test without presetting attributes |
79 | - $this->assertEquals(null,$document->is_authenticated()); |
|
79 | + $this->assertEquals(null, $document->is_authenticated()); |
|
80 | 80 | |
81 | 81 | |
82 | 82 | //test with attributes preset |
83 | - $document->authenticated= true; |
|
84 | - $this->assertEquals(true,$document->is_authenticated()); |
|
83 | + $document->authenticated = true; |
|
84 | + $this->assertEquals(true, $document->is_authenticated()); |
|
85 | 85 | |
86 | 86 | } |
87 | 87 | |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | //test with empty string parameters |
144 | 144 | $expected = "SELECT\n documents.* FROM documents WHERE documents.deleted = 0 ORDER BY documents.document_name"; |
145 | 145 | $actual = $document->create_export_query('', ''); |
146 | - $this->assertSame($expected,$actual); |
|
146 | + $this->assertSame($expected, $actual); |
|
147 | 147 | |
148 | 148 | |
149 | 149 | //test with valid string parameters |
150 | 150 | $expected = "SELECT\n documents.* FROM documents WHERE documents.document_name = \"\" AND documents.deleted = 0 ORDER BY documents.id"; |
151 | 151 | $actual = $document->create_export_query('documents.id', 'documents.document_name = ""'); |
152 | - $this->assertSame($expected,$actual); |
|
152 | + $this->assertSame($expected, $actual); |
|
153 | 153 | |
154 | 154 | } |
155 | 155 | |
@@ -160,15 +160,15 @@ discard block |
||
160 | 160 | //execute the method and verify that it retunrs expected results |
161 | 161 | |
162 | 162 | $document->filename = "test"; |
163 | - $document->file_url ="test_url"; |
|
164 | - $document->file_url_noimage= "test_image_url"; |
|
165 | - $document->last_rev_created_name= "test"; |
|
163 | + $document->file_url = "test_url"; |
|
164 | + $document->file_url_noimage = "test_image_url"; |
|
165 | + $document->last_rev_created_name = "test"; |
|
166 | 166 | $document->category_id = "1"; |
167 | - $document->subcategory_id = "1" ; |
|
167 | + $document->subcategory_id = "1"; |
|
168 | 168 | $document->document_name = "test"; |
169 | 169 | |
170 | 170 | |
171 | - $expected = array ( |
|
171 | + $expected = array( |
|
172 | 172 | 'DELETED' => 0, |
173 | 173 | 'DOCUMENT_NAME' => 'test', |
174 | 174 | 'DOC_TYPE' => 'Sugar', |
@@ -191,10 +191,10 @@ discard block |
||
191 | 191 | ); |
192 | 192 | |
193 | 193 | $actual = $document->get_list_view_data(); |
194 | - foreach($expected as $expectedKey => $expectedVal){ |
|
195 | - if($expectedKey == 'FILE_URL'){ |
|
196 | - $this->assertRegExp($expected[$expectedKey],$actual[$expectedKey]); |
|
197 | - }else { |
|
194 | + foreach ($expected as $expectedKey => $expectedVal) { |
|
195 | + if ($expectedKey == 'FILE_URL') { |
|
196 | + $this->assertRegExp($expected[$expectedKey], $actual[$expectedKey]); |
|
197 | + } else { |
|
198 | 198 | $this->assertSame($expected[$expectedKey], $actual[$expectedKey]); |
199 | 199 | } |
200 | 200 | } |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | class AOR_ConditionTest extends PHPUnit_Framework_TestCase { |
4 | 4 | |
5 | 5 | |
6 | - public function testAOR_Condition(){ |
|
6 | + public function testAOR_Condition() { |
|
7 | 7 | |
8 | 8 | //execute the contructor and check for the Object type and attributes |
9 | 9 | $aor_Condition = new AOR_Condition(); |
10 | - $this->assertInstanceOf('AOR_Condition',$aor_Condition); |
|
11 | - $this->assertInstanceOf('Basic',$aor_Condition); |
|
12 | - $this->assertInstanceOf('SugarBean',$aor_Condition); |
|
10 | + $this->assertInstanceOf('AOR_Condition', $aor_Condition); |
|
11 | + $this->assertInstanceOf('Basic', $aor_Condition); |
|
12 | + $this->assertInstanceOf('SugarBean', $aor_Condition); |
|
13 | 13 | |
14 | 14 | $this->assertAttributeEquals('AOR_Conditions', 'module_dir', $aor_Condition); |
15 | 15 | $this->assertAttributeEquals('AOR_Condition', 'object_name', $aor_Condition); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | } |
24 | 24 | |
25 | - public function testsave_lines(){ |
|
25 | + public function testsave_lines() { |
|
26 | 26 | |
27 | 27 | error_reporting(E_ERROR | E_PARSE); |
28 | 28 |
@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | class AOD_IndexEventTest extends PHPUnit_Framework_TestCase { |
4 | 4 | |
5 | - public function testAOD_IndexEvent(){ |
|
5 | + public function testAOD_IndexEvent() { |
|
6 | 6 | |
7 | 7 | //execute the contructor and check for the Object type and type attribute |
8 | 8 | $aod_indexEvent = new AOD_IndexEvent(); |
9 | - $this->assertInstanceOf('AOD_IndexEvent',$aod_indexEvent); |
|
10 | - $this->assertInstanceOf('Basic',$aod_indexEvent); |
|
11 | - $this->assertInstanceOf('SugarBean',$aod_indexEvent); |
|
9 | + $this->assertInstanceOf('AOD_IndexEvent', $aod_indexEvent); |
|
10 | + $this->assertInstanceOf('Basic', $aod_indexEvent); |
|
11 | + $this->assertInstanceOf('SugarBean', $aod_indexEvent); |
|
12 | 12 | |
13 | 13 | $this->assertAttributeEquals('AOD_IndexEvent', 'module_dir', $aod_indexEvent); |
14 | 14 | $this->assertAttributeEquals('AOD_IndexEvent', 'object_name', $aod_indexEvent); |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | //execute the contructor and check for the Object type and attributes |
9 | 9 | $tracker = new Tracker(); |
10 | 10 | |
11 | - $this->assertInstanceOf('Tracker',$tracker); |
|
12 | - $this->assertInstanceOf('SugarBean',$tracker); |
|
11 | + $this->assertInstanceOf('Tracker', $tracker); |
|
12 | + $this->assertInstanceOf('SugarBean', $tracker); |
|
13 | 13 | |
14 | 14 | $this->assertAttributeEquals('tracker', 'table_name', $tracker); |
15 | 15 | $this->assertAttributeEquals('Trackers', 'module_dir', $tracker); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $result = $tracker->get_recently_viewed(1); |
30 | 30 | |
31 | - $this->assertInstanceOf('BreadCrumbStack',$_SESSION['breadCrumbs']); |
|
31 | + $this->assertInstanceOf('BreadCrumbStack', $_SESSION['breadCrumbs']); |
|
32 | 32 | $this->assertTrue(is_array($result)); |
33 | 33 | |
34 | 34 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | |
73 | 73 | //test with headerDisplayed set |
74 | - $GLOBALS['app']->headerDisplayed = 1; |
|
74 | + $GLOBALS['app']->headerDisplayed = 1; |
|
75 | 75 | Tracker::logPage(); |
76 | 76 | $this->assertEquals(time(), $_SESSION['lpage']); |
77 | 77 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class MeetingTest extends PHPUnit_Framework_TestCase { |
|
3 | +class MeetingTest extends PHPUnit_Framework_TestCase { |
|
4 | 4 | |
5 | 5 | |
6 | 6 | public function testMeeting() { |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | //execute the contructor and check for the Object type and attributes |
11 | 11 | $meeting = new Meeting(); |
12 | 12 | |
13 | - $this->assertInstanceOf('Meeting',$meeting); |
|
14 | - $this->assertInstanceOf('SugarBean',$meeting); |
|
13 | + $this->assertInstanceOf('Meeting', $meeting); |
|
14 | + $this->assertInstanceOf('SugarBean', $meeting); |
|
15 | 15 | |
16 | 16 | $this->assertAttributeEquals('Meetings', 'module_dir', $meeting); |
17 | 17 | $this->assertAttributeEquals('Meeting', 'object_name', $meeting); |
@@ -32,23 +32,23 @@ discard block |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | - public function testACLAccess(){ |
|
35 | + public function testACLAccess() { |
|
36 | 36 | |
37 | 37 | $meeting = new Meeting(); |
38 | 38 | |
39 | 39 | //test without recurring_source |
40 | - $this->assertEquals(true,$meeting->ACLAccess('edit')); |
|
41 | - $this->assertEquals(true,$meeting->ACLAccess('save')); |
|
42 | - $this->assertEquals(true,$meeting->ACLAccess('editview')); |
|
43 | - $this->assertEquals(true,$meeting->ACLAccess('delete')); |
|
40 | + $this->assertEquals(true, $meeting->ACLAccess('edit')); |
|
41 | + $this->assertEquals(true, $meeting->ACLAccess('save')); |
|
42 | + $this->assertEquals(true, $meeting->ACLAccess('editview')); |
|
43 | + $this->assertEquals(true, $meeting->ACLAccess('delete')); |
|
44 | 44 | |
45 | 45 | |
46 | 46 | //test with recurring_source |
47 | 47 | $meeting->recurring_source = "test"; |
48 | - $this->assertEquals(false,$meeting->ACLAccess('edit')); |
|
49 | - $this->assertEquals(false,$meeting->ACLAccess('save')); |
|
50 | - $this->assertEquals(false,$meeting->ACLAccess('editview')); |
|
51 | - $this->assertEquals(false,$meeting->ACLAccess('delete')); |
|
48 | + $this->assertEquals(false, $meeting->ACLAccess('edit')); |
|
49 | + $this->assertEquals(false, $meeting->ACLAccess('save')); |
|
50 | + $this->assertEquals(false, $meeting->ACLAccess('editview')); |
|
51 | + $this->assertEquals(false, $meeting->ACLAccess('delete')); |
|
52 | 52 | |
53 | 53 | } |
54 | 54 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $meeting->status = "Not Held"; |
72 | 72 | $meeting->type = "Sugar"; |
73 | 73 | $meeting->description = "test description"; |
74 | - $meeting->duration_hours = 1 ; |
|
74 | + $meeting->duration_hours = 1; |
|
75 | 75 | $meeting->duration_minutes = 1; |
76 | 76 | $meeting->date_start = "2016-02-11 17:30:00"; |
77 | 77 | $meeting->date_end = "2016-02-11 17:30:00"; |
@@ -87,17 +87,17 @@ discard block |
||
87 | 87 | |
88 | 88 | //test set_accept_status with User object |
89 | 89 | $user = new User(); |
90 | - $meeting->set_accept_status($user,"accept"); |
|
90 | + $meeting->set_accept_status($user, "accept"); |
|
91 | 91 | |
92 | 92 | |
93 | 93 | //test set_accept_status with contact object |
94 | 94 | $contact = new Contact(); |
95 | - $meeting->set_accept_status($contact,"accept"); |
|
95 | + $meeting->set_accept_status($contact, "accept"); |
|
96 | 96 | |
97 | 97 | |
98 | 98 | //test set_accept_status with Lead object |
99 | 99 | $lead = new Lead(); |
100 | - $meeting->set_accept_status($lead,"accept"); |
|
100 | + $meeting->set_accept_status($lead, "accept"); |
|
101 | 101 | |
102 | 102 | |
103 | 103 | //mark all created relationships as deleted |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | //mark the record as deleted and verify that this record cannot be retrieved anymore. |
108 | 108 | $meeting->mark_deleted($meeting->id); |
109 | 109 | $result = $meeting->retrieve($meeting->id); |
110 | - $this->assertEquals(null,$result); |
|
110 | + $this->assertEquals(null, $result); |
|
111 | 111 | |
112 | 112 | } |
113 | 113 | |
@@ -117,29 +117,29 @@ discard block |
||
117 | 117 | $meeting = new Meeting(); |
118 | 118 | |
119 | 119 | //test without setting name |
120 | - $this->assertEquals(Null,$meeting->get_summary_text()); |
|
120 | + $this->assertEquals(Null, $meeting->get_summary_text()); |
|
121 | 121 | |
122 | 122 | //test with name set |
123 | 123 | $meeting->name = "test"; |
124 | - $this->assertEquals('test',$meeting->get_summary_text()); |
|
124 | + $this->assertEquals('test', $meeting->get_summary_text()); |
|
125 | 125 | |
126 | 126 | |
127 | 127 | } |
128 | 128 | |
129 | - public function testcreate_export_query(){ |
|
129 | + public function testcreate_export_query() { |
|
130 | 130 | |
131 | 131 | $meeting = new Meeting(); |
132 | 132 | |
133 | 133 | //test with empty string params |
134 | 134 | $expected = "SELECT meetings.*, users.user_name as assigned_user_name FROM meetings LEFT JOIN users ON meetings.assigned_user_id=users.id where meetings.deleted=0"; |
135 | - $actual = $meeting->create_export_query('',''); |
|
136 | - $this->assertSame($expected,$actual); |
|
135 | + $actual = $meeting->create_export_query('', ''); |
|
136 | + $this->assertSame($expected, $actual); |
|
137 | 137 | |
138 | 138 | |
139 | 139 | //test with valid string params |
140 | 140 | $expected = "SELECT meetings.*, users.user_name as assigned_user_name FROM meetings LEFT JOIN users ON meetings.assigned_user_id=users.id where users.user_name=\"\" AND meetings.deleted=0"; |
141 | - $actual = $meeting->create_export_query('meetings.id','users.user_name=""'); |
|
142 | - $this->assertSame($expected,$actual); |
|
141 | + $actual = $meeting->create_export_query('meetings.id', 'users.user_name=""'); |
|
142 | + $this->assertSame($expected, $actual); |
|
143 | 143 | |
144 | 144 | } |
145 | 145 | |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | $meeting = new Meeting(); |
149 | 149 | |
150 | 150 | //preset required attributes |
151 | - $meeting->assigned_user_id =1; |
|
152 | - $meeting->modified_user_id =1; |
|
153 | - $meeting->created_by =1; |
|
154 | - $meeting->contact_id =1; |
|
151 | + $meeting->assigned_user_id = 1; |
|
152 | + $meeting->modified_user_id = 1; |
|
153 | + $meeting->created_by = 1; |
|
154 | + $meeting->contact_id = 1; |
|
155 | 155 | |
156 | 156 | $meeting->fill_in_additional_detail_fields(); |
157 | 157 | |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | $this->assertTrue(isset($meeting->duration_minutes)); |
167 | 167 | $this->assertEquals(-1, $meeting->reminder_time ); |
168 | 168 | $this->assertTrue(isset($meeting->reminder_time)); |
169 | - $this->assertEquals(false, $meeting->reminder_checked ); |
|
169 | + $this->assertEquals(false, $meeting->reminder_checked); |
|
170 | 170 | $this->assertEquals(-1, $meeting->email_reminder_time ); |
171 | - $this->assertEquals(false, $meeting->email_reminder_checked ); |
|
171 | + $this->assertEquals(false, $meeting->email_reminder_checked); |
|
172 | 172 | $this->assertEquals("Accounts", $meeting->parent_type); |
173 | 173 | |
174 | 174 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $meeting->contact_name = "test"; |
185 | 185 | $meeting->parent_name = "Account"; |
186 | 186 | |
187 | - $expected = array ( |
|
187 | + $expected = array( |
|
188 | 188 | 'DELETED' => 0, |
189 | 189 | 'PARENT_TYPE' => 'Accounts', |
190 | 190 | 'STATUS' => 'Planned', |
@@ -233,24 +233,24 @@ discard block |
||
233 | 233 | $meeting->status = "Not Held"; |
234 | 234 | $meeting->type = "Sugar"; |
235 | 235 | $meeting->description = "test description"; |
236 | - $meeting->duration_hours = 1 ; |
|
236 | + $meeting->duration_hours = 1; |
|
237 | 237 | $meeting->duration_minutes = 1; |
238 | 238 | $meeting->date_start = "2016-02-11 17:30:00"; |
239 | 239 | $meeting->date_end = "2016-02-11 17:30:00"; |
240 | 240 | |
241 | 241 | $result = $meeting->set_notification_body(new Sugar_Smarty(), $meeting); |
242 | 242 | |
243 | - $this->assertEquals($meeting->name ,$result->_tpl_vars['MEETING_SUBJECT']); |
|
244 | - $this->assertEquals($meeting->status ,$result->_tpl_vars['MEETING_STATUS']); |
|
245 | - $this->assertEquals("SuiteCRM" ,$result->_tpl_vars['MEETING_TYPE']); |
|
246 | - $this->assertEquals($meeting->duration_hours ,$result->_tpl_vars['MEETING_HOURS']); |
|
247 | - $this->assertEquals($meeting->duration_minutes ,$result->_tpl_vars['MEETING_MINUTES']); |
|
248 | - $this->assertEquals($meeting->description ,$result->_tpl_vars['MEETING_DESCRIPTION']); |
|
243 | + $this->assertEquals($meeting->name, $result->_tpl_vars['MEETING_SUBJECT']); |
|
244 | + $this->assertEquals($meeting->status, $result->_tpl_vars['MEETING_STATUS']); |
|
245 | + $this->assertEquals("SuiteCRM", $result->_tpl_vars['MEETING_TYPE']); |
|
246 | + $this->assertEquals($meeting->duration_hours, $result->_tpl_vars['MEETING_HOURS']); |
|
247 | + $this->assertEquals($meeting->duration_minutes, $result->_tpl_vars['MEETING_MINUTES']); |
|
248 | + $this->assertEquals($meeting->description, $result->_tpl_vars['MEETING_DESCRIPTION']); |
|
249 | 249 | |
250 | 250 | } |
251 | 251 | |
252 | 252 | |
253 | - public function testcreate_notification_email(){ |
|
253 | + public function testcreate_notification_email() { |
|
254 | 254 | |
255 | 255 | $meeting = new Meeting(); |
256 | 256 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | } |
269 | 269 | |
270 | 270 | |
271 | - public function testsend_assignment_notifications(){ |
|
271 | + public function testsend_assignment_notifications() { |
|
272 | 272 | |
273 | 273 | $meeting = new Meeting(); |
274 | 274 | |
@@ -343,9 +343,9 @@ discard block |
||
343 | 343 | |
344 | 344 | $meeting = new Meeting(); |
345 | 345 | |
346 | - $expected = array("MAIN"=>"a", "PARENT"=>"a", "CONTACT"=>"a" ); |
|
346 | + $expected = array("MAIN"=>"a", "PARENT"=>"a", "CONTACT"=>"a"); |
|
347 | 347 | $actual = $meeting->listviewACLHelper(); |
348 | - $this->assertSame($expected,$actual); |
|
348 | + $this->assertSame($expected, $actual); |
|
349 | 349 | |
350 | 350 | } |
351 | 351 | |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | } |
368 | 368 | |
369 | 369 | |
370 | - public function testafterImportSave(){ |
|
370 | + public function testafterImportSave() { |
|
371 | 371 | |
372 | 372 | require_once("data/Link.php"); |
373 | 373 | |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | |
398 | 398 | } |
399 | 399 | |
400 | - public function testgetDefaultStatus(){ |
|
400 | + public function testgetDefaultStatus() { |
|
401 | 401 | |
402 | 402 | $meeting = new Meeting(); |
403 | 403 | $result = $meeting->getDefaultStatus(); |
@@ -407,16 +407,16 @@ discard block |
||
407 | 407 | |
408 | 408 | |
409 | 409 | |
410 | - public function testgetMeetingsExternalApiDropDown(){ |
|
410 | + public function testgetMeetingsExternalApiDropDown() { |
|
411 | 411 | |
412 | 412 | $actual = getMeetingsExternalApiDropDown(); |
413 | - $expected= array( "Sugar"=>"SuiteCRM"); |
|
413 | + $expected = array("Sugar"=>"SuiteCRM"); |
|
414 | 414 | $this->assertSame($expected, $actual); |
415 | 415 | |
416 | 416 | } |
417 | 417 | |
418 | 418 | |
419 | - public function testgetMeetingTypeOptions(){ |
|
419 | + public function testgetMeetingTypeOptions() { |
|
420 | 420 | |
421 | 421 | global $dictionary, $app_list_strings; |
422 | 422 |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | //execute the contructor and check for the Object type and attributes |
9 | 9 | $project = new Project(); |
10 | 10 | |
11 | - $this->assertInstanceOf('Project',$project); |
|
12 | - $this->assertInstanceOf('SugarBean',$project); |
|
11 | + $this->assertInstanceOf('Project', $project); |
|
12 | + $this->assertInstanceOf('SugarBean', $project); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | $this->assertAttributeEquals('project', 'table_name', $project); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | $project = new Project(); |
63 | 63 | |
64 | - $project->id =1; |
|
64 | + $project->id = 1; |
|
65 | 65 | $_REQUEST['relate_id'] = 2; |
66 | 66 | $_REQUEST['relate_to'] = "contacts"; |
67 | 67 | |
@@ -97,16 +97,16 @@ discard block |
||
97 | 97 | $project = new Project(); |
98 | 98 | |
99 | 99 | //test without setting name |
100 | - $this->assertEquals(Null,$project->get_summary_text()); |
|
100 | + $this->assertEquals(Null, $project->get_summary_text()); |
|
101 | 101 | |
102 | 102 | //test with name set |
103 | 103 | $project->name = "test"; |
104 | - $this->assertEquals('test',$project->get_summary_text()); |
|
104 | + $this->assertEquals('test', $project->get_summary_text()); |
|
105 | 105 | |
106 | 106 | } |
107 | 107 | |
108 | 108 | |
109 | - public function testbuild_generic_where_clause () |
|
109 | + public function testbuild_generic_where_clause() |
|
110 | 110 | { |
111 | 111 | |
112 | 112 | $project = new Project(); |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | //test with empty string params |
115 | 115 | $expected = "project.name LIKE '%%'"; |
116 | 116 | $actual = $project->build_generic_where_clause(''); |
117 | - $this->assertSame($expected,$actual); |
|
117 | + $this->assertSame($expected, $actual); |
|
118 | 118 | |
119 | 119 | |
120 | 120 | //test with valid string params |
121 | 121 | $expected = "project.name LIKE '%%'"; |
122 | 122 | $actual = $project->build_generic_where_clause('test'); |
123 | - $this->assertSame($expected,$actual); |
|
123 | + $this->assertSame($expected, $actual); |
|
124 | 124 | |
125 | 125 | } |
126 | 126 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $project->user_name = "tes user"; |
132 | 132 | $project->assigned_user_name = "test assigned user"; |
133 | 133 | |
134 | - $expected = array ( |
|
134 | + $expected = array( |
|
135 | 135 | 'DELETED' => '0', |
136 | 136 | 'ASSIGNED_USER_NAME' => 'test assigned user', |
137 | 137 | 'USER_NAME' => 'tes user' |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | } |
145 | 145 | |
146 | - public function testbean_implements(){ |
|
146 | + public function testbean_implements() { |
|
147 | 147 | |
148 | 148 | $project = new Project(); |
149 | 149 | |
@@ -159,18 +159,18 @@ discard block |
||
159 | 159 | |
160 | 160 | //test with empty string params |
161 | 161 | $expected = "SELECT\n project.*,\n users.user_name as assigned_user_name FROM project LEFT JOIN users\n ON project.assigned_user_id=users.id where project.deleted=0 "; |
162 | - $actual = $project->create_export_query('',''); |
|
163 | - $this->assertSame($expected,$actual); |
|
162 | + $actual = $project->create_export_query('', ''); |
|
163 | + $this->assertSame($expected, $actual); |
|
164 | 164 | |
165 | 165 | |
166 | 166 | //test with valid string params |
167 | 167 | $expected = "SELECT\n project.*,\n users.user_name as assigned_user_name FROM project LEFT JOIN users\n ON project.assigned_user_id=users.id where (users.user_name) AND project.deleted=0 ORDER BY project.id"; |
168 | - $actual = $project->create_export_query('project.id','users.user_name'); |
|
169 | - $this->assertSame($expected,$actual); |
|
168 | + $actual = $project->create_export_query('project.id', 'users.user_name'); |
|
169 | + $this->assertSame($expected, $actual); |
|
170 | 170 | |
171 | 171 | } |
172 | 172 | |
173 | - public function testgetAllProjectTasks(){ |
|
173 | + public function testgetAllProjectTasks() { |
|
174 | 174 | |
175 | 175 | $project = new Project(); |
176 | 176 |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | //execute the contructor and check for the Object type and attributes |
9 | 9 | $vcal = new vCal(); |
10 | 10 | |
11 | - $this->assertInstanceOf('vCal',$vcal); |
|
12 | - $this->assertInstanceOf('SugarBean',$vcal); |
|
11 | + $this->assertInstanceOf('vCal', $vcal); |
|
12 | + $this->assertInstanceOf('SugarBean', $vcal); |
|
13 | 13 | |
14 | 14 | $this->assertAttributeEquals('vcals', 'table_name', $vcal); |
15 | 15 | $this->assertAttributeEquals('vCals', 'module_dir', $vcal); |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | $vcal = new vCal(); |
29 | 29 | |
30 | 30 | //test without setting name |
31 | - $this->assertEquals(Null,$vcal->get_summary_text()); |
|
31 | + $this->assertEquals(Null, $vcal->get_summary_text()); |
|
32 | 32 | |
33 | 33 | //test with name set |
34 | 34 | $vcal->name = "test"; |
35 | - $this->assertEquals('',$vcal->get_summary_text()); |
|
35 | + $this->assertEquals('', $vcal->get_summary_text()); |
|
36 | 36 | |
37 | 37 | } |
38 | 38 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $user_bean = new User("1"); |
95 | 95 | |
96 | 96 | $expectedStart = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//SugarCRM//SugarCRM Calendar//EN\r\nBEGIN:VFREEBUSY\r\nORGANIZER;CN= :VFREEBUSY\r\n"; |
97 | - $expectedEnd ="END:VFREEBUSY\r\nEND:VCALENDAR\r\n"; |
|
97 | + $expectedEnd = "END:VFREEBUSY\r\nEND:VCALENDAR\r\n"; |
|
98 | 98 | |
99 | 99 | $result = $vcal->get_freebusy_lines_cache($user_bean); |
100 | 100 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $end_date_time = $now_date_time->get("tomorrow"); |
117 | 117 | |
118 | 118 | $result = $vcal->create_sugar_freebusy($user_bean, $start_date_time, $end_date_time); |
119 | - $this->assertGreaterThanOrEqual(0,strlen($result)); |
|
119 | + $this->assertGreaterThanOrEqual(0, strlen($result)); |
|
120 | 120 | |
121 | 121 | } |
122 | 122 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $user_focus = new User("1"); |
128 | 128 | |
129 | 129 | $expectedStart = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//SugarCRM//SugarCRM Calendar//EN\r\nBEGIN:VFREEBUSY\r\nORGANIZER;CN= :VFREEBUSY\r\n"; |
130 | - $expectedEnd ="END:VFREEBUSY\r\nEND:VCALENDAR\r\n"; |
|
130 | + $expectedEnd = "END:VFREEBUSY\r\nEND:VCALENDAR\r\n"; |
|
131 | 131 | |
132 | 132 | $result = $vcal->get_vcal_freebusy($user_focus); |
133 | 133 | |
@@ -175,13 +175,13 @@ discard block |
||
175 | 175 | { |
176 | 176 | |
177 | 177 | //test with short strings |
178 | - $result = vCal::fold_ical_lines("testkey","testvalue"); |
|
179 | - $this->assertEquals("testkey:testvalue",$result); |
|
178 | + $result = vCal::fold_ical_lines("testkey", "testvalue"); |
|
179 | + $this->assertEquals("testkey:testvalue", $result); |
|
180 | 180 | |
181 | 181 | |
182 | 182 | //test with longer strings |
183 | - $expected = "testkey11111111111111111111111111111111111111111111111111111111111111111111\r\n 11111111111111111111111111111111:testvalue11111111111111111111111111111111\r\n 11111111111111111111111111111111111111111111111111111111111111111111"; |
|
184 | - $result = vCal::fold_ical_lines("testkey" . str_repeat("1",100),"testvalue" . str_repeat("1",100)); |
|
183 | + $expected = "testkey11111111111111111111111111111111111111111111111111111111111111111111\r\n 11111111111111111111111111111111:testvalue11111111111111111111111111111111\r\n 11111111111111111111111111111111111111111111111111111111111111111111"; |
|
184 | + $result = vCal::fold_ical_lines("testkey".str_repeat("1", 100), "testvalue".str_repeat("1", 100)); |
|
185 | 185 | $this->assertEquals(); |
186 | 186 | |
187 | 187 | } |
@@ -192,19 +192,19 @@ discard block |
||
192 | 192 | |
193 | 193 | $iCalString = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//SugarCRM//SugarCRM Calendar//EN\r\nBEGIN:VFREEBUSY\r\nORGANIZER;CN= :VFREEBUSY\r\nDTSTART:2016-01-09 00:00:00\r\nDTEND:2016-03-09 00:00:00\r\nDTSTAMP:2016-01-10 11:07:15\r\nEND:VFREEBUSY\r\nEND:VCALENDAR\r\n"; |
194 | 194 | $expected = array( |
195 | - array ( 'BEGIN','VCALENDAR'), |
|
196 | - array ( 'VERSION','2.0'), |
|
197 | - array ( 'PRODID','-//SugarCRM//SugarCRM Calendar//EN'), |
|
198 | - array ( 'BEGIN', 'VFREEBUSY' ), |
|
199 | - array ( 'ORGANIZER;CN= ', 'VFREEBUSY' ), |
|
200 | - array ( 'DTSTART', '2016-01-09 00:00:00' ), |
|
201 | - array ( 'DTEND', '2016-03-09 00:00:00' ), |
|
202 | - array ( 'DTSTAMP', '2016-01-10 11:07:15' ), |
|
203 | - array ( 'END', 'VFREEBUSY' ), |
|
204 | - array ( 'END', 'VCALENDAR' ), |
|
195 | + array('BEGIN', 'VCALENDAR'), |
|
196 | + array('VERSION', '2.0'), |
|
197 | + array('PRODID', '-//SugarCRM//SugarCRM Calendar//EN'), |
|
198 | + array('BEGIN', 'VFREEBUSY'), |
|
199 | + array('ORGANIZER;CN= ', 'VFREEBUSY'), |
|
200 | + array('DTSTART', '2016-01-09 00:00:00'), |
|
201 | + array('DTEND', '2016-03-09 00:00:00'), |
|
202 | + array('DTSTAMP', '2016-01-10 11:07:15'), |
|
203 | + array('END', 'VFREEBUSY'), |
|
204 | + array('END', 'VCALENDAR'), |
|
205 | 205 | ); |
206 | 206 | $actual = vCal::create_ical_array_from_string($iCalString); |
207 | - $this->assertSame($expected, $actual ); |
|
207 | + $this->assertSame($expected, $actual); |
|
208 | 208 | |
209 | 209 | } |
210 | 210 | |
@@ -214,38 +214,38 @@ discard block |
||
214 | 214 | |
215 | 215 | $expected = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//SugarCRM//SugarCRM Calendar//EN\r\nBEGIN:VFREEBUSY\r\nORGANIZER;CN= :VFREEBUSY\r\nDTSTART:2016-01-09 00:00:00\r\nDTEND:2016-03-09 00:00:00\r\nDTSTAMP:2016-01-10 11:07:15\r\nEND:VFREEBUSY\r\nEND:VCALENDAR\r\n"; |
216 | 216 | $iCalArray = array( |
217 | - array ( 'BEGIN','VCALENDAR'), |
|
218 | - array ( 'VERSION','2.0'), |
|
219 | - array ( 'PRODID','-//SugarCRM//SugarCRM Calendar//EN'), |
|
220 | - array ( 'BEGIN', 'VFREEBUSY' ), |
|
221 | - array ( 'ORGANIZER;CN= ', 'VFREEBUSY' ), |
|
222 | - array ( 'DTSTART', '2016-01-09 00:00:00' ), |
|
223 | - array ( 'DTEND', '2016-03-09 00:00:00' ), |
|
224 | - array ( 'DTSTAMP', '2016-01-10 11:07:15' ), |
|
225 | - array ( 'END', 'VFREEBUSY' ), |
|
226 | - array ( 'END', 'VCALENDAR' ), |
|
217 | + array('BEGIN', 'VCALENDAR'), |
|
218 | + array('VERSION', '2.0'), |
|
219 | + array('PRODID', '-//SugarCRM//SugarCRM Calendar//EN'), |
|
220 | + array('BEGIN', 'VFREEBUSY'), |
|
221 | + array('ORGANIZER;CN= ', 'VFREEBUSY'), |
|
222 | + array('DTSTART', '2016-01-09 00:00:00'), |
|
223 | + array('DTEND', '2016-03-09 00:00:00'), |
|
224 | + array('DTSTAMP', '2016-01-10 11:07:15'), |
|
225 | + array('END', 'VFREEBUSY'), |
|
226 | + array('END', 'VCALENDAR'), |
|
227 | 227 | ); |
228 | 228 | $actual = vCal::create_ical_string_from_array($iCalArray); |
229 | - $this->assertSame($expected, $actual ); |
|
229 | + $this->assertSame($expected, $actual); |
|
230 | 230 | |
231 | 231 | } |
232 | 232 | |
233 | 233 | |
234 | 234 | public function testescape_ical_chars() |
235 | 235 | { |
236 | - $this->assertSame('',vCal::escape_ical_chars('')); |
|
237 | - $this->assertSame('\;\,',vCal::escape_ical_chars(';,')); |
|
236 | + $this->assertSame('', vCal::escape_ical_chars('')); |
|
237 | + $this->assertSame('\;\,', vCal::escape_ical_chars(';,')); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | |
241 | 241 | public function testunescape_ical_chars() |
242 | 242 | { |
243 | - $this->assertSame('',vCal::unescape_ical_chars('')); |
|
243 | + $this->assertSame('', vCal::unescape_ical_chars('')); |
|
244 | 244 | $this->assertSame("; , \\", vCal::unescape_ical_chars('\\; \\, \\\\')); |
245 | 245 | } |
246 | 246 | |
247 | 247 | |
248 | - public function testget_ical_event(){ |
|
248 | + public function testget_ical_event() { |
|
249 | 249 | |
250 | 250 | $user = new User(1); |
251 | 251 | $meeting = new Meeting(); |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $expectedStart = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//SugarCRM//SugarCRM Calendar//EN\r\nBEGIN:VEVENT\r\nUID:1\r\nORGANIZED;CN=:\r\nDTSTART:20160211T173000Z\r\nDTEND:20160211T173000Z\r\n"; |
261 | 261 | $expectedEnd = "\r\nSUMMARY:test\r\nLOCATION:test location\r\nDESCRIPTION:test description\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"; |
262 | 262 | |
263 | - $result = vCal::get_ical_event($meeting ,$user); |
|
263 | + $result = vCal::get_ical_event($meeting, $user); |
|
264 | 264 | |
265 | 265 | $this->assertStringStartsWith($expectedStart, $result); |
266 | 266 | $this->assertStringEndsWith($expectedEnd, $result); |
@@ -1,18 +1,18 @@ discard block |
||
1 | 1 | <?PHP |
2 | 2 | |
3 | -class SugarFeedTest extends PHPUnit_Framework_TestCase { |
|
3 | +class SugarFeedTest extends PHPUnit_Framework_TestCase { |
|
4 | 4 | |
5 | 5 | |
6 | - public function testSugarFeed(){ |
|
6 | + public function testSugarFeed() { |
|
7 | 7 | |
8 | 8 | error_reporting(E_ERROR | E_PARSE); |
9 | 9 | |
10 | 10 | //execute the contructor and check for the Object type and attributes |
11 | 11 | $sugarFeed = new SugarFeed(); |
12 | 12 | |
13 | - $this->assertInstanceOf('SugarFeed',$sugarFeed); |
|
14 | - $this->assertInstanceOf('Basic',$sugarFeed); |
|
15 | - $this->assertInstanceOf('SugarBean',$sugarFeed); |
|
13 | + $this->assertInstanceOf('SugarFeed', $sugarFeed); |
|
14 | + $this->assertInstanceOf('Basic', $sugarFeed); |
|
15 | + $this->assertInstanceOf('SugarBean', $sugarFeed); |
|
16 | 16 | |
17 | 17 | $this->assertAttributeEquals('sugarfeed', 'table_name', $sugarFeed); |
18 | 18 | $this->assertAttributeEquals('SugarFeed', 'module_dir', $sugarFeed); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | //test activateModuleFeed method |
31 | 31 | SugarFeed::activateModuleFeed('Accounts'); |
32 | 32 | $admin->retrieveSettings('sugarfeed'); |
33 | - $this->assertEquals(1,$admin->settings['sugarfeed_module_Accounts']); |
|
33 | + $this->assertEquals(1, $admin->settings['sugarfeed_module_Accounts']); |
|
34 | 34 | |
35 | 35 | |
36 | 36 | //test disableModuleFeed method |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | |
66 | 66 | //test with valid module |
67 | - $expected = array( "CaseFeed.php"=> "modules/Cases/SugarFeeds/CaseFeed.php"); |
|
67 | + $expected = array("CaseFeed.php"=> "modules/Cases/SugarFeeds/CaseFeed.php"); |
|
68 | 68 | $result = SugarFeed::getModuleFeedFiles('Cases'); |
69 | 69 | $this->assertEquals($expected, $result); |
70 | 70 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $result = SugarFeed::getActiveFeedModules(); |
76 | 76 | |
77 | - $expected = array ( |
|
77 | + $expected = array( |
|
78 | 78 | 'UserFeed' => 'UserFeed', |
79 | 79 | 'Cases' => 'Cases', |
80 | 80 | 'Contacts' => 'Contacts', |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | public function testgetAllFeedModules( ) { |
90 | 90 | |
91 | 91 | $result = SugarFeed::getAllFeedModules(); |
92 | - $expected = array ( |
|
92 | + $expected = array( |
|
93 | 93 | 'UserFeed' => 'UserFeed', |
94 | 94 | 'Cases' => 'Cases', |
95 | 95 | 'Contacts' => 'Contacts', |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $lead->id = 1; |
109 | 109 | $lead->assigned_user_id = 1; |
110 | 110 | |
111 | - SugarFeed::pushFeed2("some text 2", $lead,'Link', 'some url'); |
|
111 | + SugarFeed::pushFeed2("some text 2", $lead, 'Link', 'some url'); |
|
112 | 112 | |
113 | 113 | //retrieve newly created bean |
114 | 114 | $sugarFeed = new SugarFeed(); |
@@ -123,10 +123,10 @@ discard block |
||
123 | 123 | |
124 | 124 | } |
125 | 125 | |
126 | - public function testpushFeed(){ |
|
126 | + public function testpushFeed() { |
|
127 | 127 | |
128 | 128 | |
129 | - SugarFeed::pushFeed("some text", 'SugarFeed', 1, 1,'Link', 'some url'); |
|
129 | + SugarFeed::pushFeed("some text", 'SugarFeed', 1, 1, 'Link', 'some url'); |
|
130 | 130 | |
131 | 131 | |
132 | 132 | //retrieve newly created bean |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $sugarFeed = new SugarFeed(); |
154 | 154 | |
155 | 155 | $actual = $sugarFeed->fetchReplies(array('ID'=>'1')); |
156 | - $this->assertGreaterThan(0,strlen($actual)); |
|
156 | + $this->assertGreaterThan(0, strlen($actual)); |
|
157 | 157 | |
158 | 158 | } |
159 | 159 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | $result = SugarFeed::getLinkTypes(); |
163 | 163 | |
164 | - $expected = array ( |
|
164 | + $expected = array( |
|
165 | 165 | 'Image' => 'Image', |
166 | 166 | 'Link' => 'Link', |
167 | 167 | 'YouTube' => 'YouTube', |
@@ -178,19 +178,19 @@ discard block |
||
178 | 178 | |
179 | 179 | //test with LinkType Image |
180 | 180 | $result = SugarFeed::getLinkClass('Image'); |
181 | - $this->assertInstanceOf('FeedLinkHandlerImage',$result); |
|
181 | + $this->assertInstanceOf('FeedLinkHandlerImage', $result); |
|
182 | 182 | |
183 | 183 | //test with LinkType Link |
184 | 184 | $result = SugarFeed::getLinkClass('Link'); |
185 | - $this->assertInstanceOf('FeedLinkHandlerLink',$result); |
|
185 | + $this->assertInstanceOf('FeedLinkHandlerLink', $result); |
|
186 | 186 | |
187 | 187 | //test with LinkType YouTube |
188 | 188 | $result = SugarFeed::getLinkClass('YouTube'); |
189 | - $this->assertInstanceOf('FeedLinkHandlerYoutube',$result); |
|
189 | + $this->assertInstanceOf('FeedLinkHandlerYoutube', $result); |
|
190 | 190 | |
191 | 191 | } |
192 | 192 | |
193 | - public function testget_list_view_data(){ |
|
193 | + public function testget_list_view_data() { |
|
194 | 194 | |
195 | 195 | $sugarFeed = new SugarFeed(); |
196 | 196 | |
@@ -209,19 +209,19 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | |
212 | - public function testparseMessage(){ |
|
212 | + public function testparseMessage() { |
|
213 | 213 | |
214 | 214 | //test with a string with no links |
215 | 215 | $html = "some text with no urls"; |
216 | 216 | $result = SugarFeed::parseMessage($html); |
217 | - $this->assertEquals($html ,$result); |
|
217 | + $this->assertEquals($html, $result); |
|
218 | 218 | |
219 | 219 | |
220 | 220 | //test with a string with links |
221 | 221 | $html = "some text http://www.url.com with no urls"; |
222 | 222 | $expected = "some text <a href='http://www.url.com' target='_blank'>http://www.url.com</a> with no urls"; |
223 | 223 | $result = SugarFeed::parseMessage($html); |
224 | - $this->assertEquals($expected ,$result); |
|
224 | + $this->assertEquals($expected, $result); |
|
225 | 225 | |
226 | 226 | } |
227 | 227 |