Completed
Push — CI ( ee6bd7...0f01dd )
by Adam
22:32
created
tests/tests/modules/InboundEmail/InboundEmailTest.php 1 patch
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 		//execute the contructor and check for the Object type and  attributes
16 16
 		$inboundEmail = new InboundEmail();
17 17
 		
18
-		$this->assertInstanceOf('InboundEmail',$inboundEmail);
19
-		$this->assertInstanceOf('SugarBean',$inboundEmail);
18
+		$this->assertInstanceOf('InboundEmail', $inboundEmail);
19
+		$this->assertInstanceOf('SugarBean', $inboundEmail);
20 20
 			
21 21
 		$this->assertAttributeEquals('InboundEmail', 'module_dir', $inboundEmail);
22 22
 		$this->assertAttributeEquals('InboundEmail', 'object_name', $inboundEmail);
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
 		$inboundEmail = new InboundEmail();
133 133
 	
134 134
 		
135
-		$result = $inboundEmail->getSingularRelatedId("test","inbound_email");
135
+		$result = $inboundEmail->getSingularRelatedId("test", "inbound_email");
136 136
 		$this->assertEquals(false, $result);
137 137
 		
138 138
 		
139
-		$result = $inboundEmail->getSingularRelatedId("invalid test","inbound_email");
139
+		$result = $inboundEmail->getSingularRelatedId("invalid test", "inbound_email");
140 140
 		$this->assertEquals(null, $result);
141 141
 		
142 142
 		
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 		 
182 182
 		$this->assertTrue(is_array($result));
183 183
 		
184
-		foreach($result as $ie){		
185
-			$this->assertInstanceOf('InboundEmail',$ie);
184
+		foreach ($result as $ie) {		
185
+			$this->assertInstanceOf('InboundEmail', $ie);
186 186
 		}
187 187
 		
188 188
 	}
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
 			
197 197
 		$this->assertTrue(is_array($result));
198 198
 	
199
-		foreach($result as $ie){
200
-			$this->assertInstanceOf('InboundEmail',$ie);
199
+		foreach ($result as $ie) {
200
+			$this->assertInstanceOf('InboundEmail', $ie);
201 201
 		}
202 202
 	
203 203
 	}
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
 			
212 212
 		$this->assertTrue(is_array($result));
213 213
 		
214
-		foreach($result as $ie){
215
-			$this->assertInstanceOf('InboundEmail',$ie);
214
+		foreach ($result as $ie) {
215
+			$this->assertInstanceOf('InboundEmail', $ie);
216 216
 		}	
217 217
 		
218 218
 	}
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
 		$result = $inboundEmail->search($id);
245 245
 		
246 246
 		$this->assertTrue(is_array($result));
247
-		$this->assertEquals("Search Results" ,$result["mbox"]);
248
-		$this->assertEquals($id ,$result["ieId"]);
247
+		$this->assertEquals("Search Results", $result["mbox"]);
248
+		$this->assertEquals($id, $result["ieId"]);
249 249
 		 	
250 250
 	}	
251 251
 
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
 	
260 260
 		//execute he method and verify attributes
261 261
 		$inboundEmail->saveMailBoxFolders("INBOX,TRASH");
262
-		$this->assertEquals(array("INBOX","TRASH") , $inboundEmail->mailboxarray);
262
+		$this->assertEquals(array("INBOX", "TRASH"), $inboundEmail->mailboxarray);
263 263
 		
264 264
 		//retrieve it back and verify the updates
265 265
 		$inboundEmail->retrieve($id);
266
-		$this->assertEquals("INBOX,TRASH" , $inboundEmail->mailbox);
266
+		$this->assertEquals("INBOX,TRASH", $inboundEmail->mailbox);
267 267
 	
268 268
 	}
269 269
 	
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	
280 280
 		//retrieve it back and verify the updates
281 281
 		$inboundEmail->retrieve($id);
282
-		$this->assertEquals("TEST" , $inboundEmail->mailbox);
282
+		$this->assertEquals("TEST", $inboundEmail->mailbox);
283 283
 		
284 284
 	}
285 285
 	
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 		$inboundEmail->mark_deleted($id);
293 293
 		
294 294
 		$result = $inboundEmail->retrieve($id);
295
-		$this->assertEquals(null,$result);
295
+		$this->assertEquals(null, $result);
296 296
 		
297 297
 	}
298 298
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 		$inboundEmail->hardDelete($id);
305 305
 		
306 306
 		$result = $inboundEmail->retrieve($id);
307
-		$this->assertEquals(null,$result);
307
+		$this->assertEquals(null, $result);
308 308
 		
309 309
 	}
310 310
 	
@@ -346,12 +346,12 @@  discard block
 block discarded – undo
346 346
 	
347 347
 		//test with array having common element
348 348
 		$result = $inboundEmail->filterMailBoxFromRaw(array("mailbox1", "mailbox2", "mailbox3"), array("mailbox1"));
349
-		$this->assertSame(array("mailbox1"), $result );
349
+		$this->assertSame(array("mailbox1"), $result);
350 350
 	
351 351
 	
352 352
 		//test with array having nothing common
353
-		$result = $inboundEmail->filterMailBoxFromRaw( array("mailbox1", "mailbox2"), array("mailbox4"));
354
-		$this->assertSame(array(), $result );
353
+		$result = $inboundEmail->filterMailBoxFromRaw(array("mailbox1", "mailbox2"), array("mailbox4"));
354
+		$this->assertSame(array(), $result);
355 355
 	
356 356
 	}
357 357
 	
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 		$overview->subject = "subject";
414 414
 		$overview->from = "from";
415 415
 		$overview->fromaddr = "[email protected]";
416
-		$overview->to  = "to";
416
+		$overview->to = "to";
417 417
 		$overview->toaddr = "[email protected]";
418 418
 		$overview->size = 0;
419 419
 		$overview->message_id = 1;
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 	
440 440
 	
441 441
 		//test wih default protocol
442
-		$result = $inboundEmail->getCacheValueForUIDs("INBOX", array(1,2,3,4,5));
442
+		$result = $inboundEmail->getCacheValueForUIDs("INBOX", array(1, 2, 3, 4, 5));
443 443
 	
444 444
 		$this->assertTrue(is_array($result));
445 445
 		$this->assertTrue(is_array($result['uids']));
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 	
450 450
 		//test wih pop3 protocol
451 451
 		$inboundEmail->protocol = 'pop3';
452
-		$result = $inboundEmail->getCacheValueForUIDs("INBOX", array(1,2,3,4,5));
452
+		$result = $inboundEmail->getCacheValueForUIDs("INBOX", array(1, 2, 3, 4, 5));
453 453
 	
454 454
 		$this->assertTrue(is_array($result));
455 455
 		$this->assertTrue(is_array($result['uids']));
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 		$ret = $inboundEmail->getCacheValue("INBOX");
509 509
 
510 510
 		//use the cache values array as parameter and verify that it returns an array
511
-		$result = $inboundEmail->displayFetchedSortedListXML($ret,"INBOX");
511
+		$result = $inboundEmail->displayFetchedSortedListXML($ret, "INBOX");
512 512
 		$this->assertTrue(is_array($result));
513 513
 	
514 514
 		
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
     	$inboundEmail->id = 1;
581 581
     	
582 582
     	//execute the method to populate answered field
583
-    	$inboundEmail->mark_answered(1,'pop3');
583
+    	$inboundEmail->mark_answered(1, 'pop3');
584 584
     	
585 585
     	//retrieve back to verify the records updated
586 586
     	$result = $inboundEmail->getCacheValue("INBOX");
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
     	 
598 598
     	$inboundEmail->id = 1;
599 599
     	
600
-    	$result = $inboundEmail->pop3_shiftCache(array('1'=>'1'),array('1'));
600
+    	$result = $inboundEmail->pop3_shiftCache(array('1'=>'1'), array('1'));
601 601
     	
602 602
     	//retrieve back to verify the records updated
603 603
     	$result = $inboundEmail->getCacheValue("INBOX");
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
 		$inboundEmail->mailbox = "INBOX,OUTBOX";
916 916
 		
917 917
 		$result = $inboundEmail->checkEmailOneMailbox("INBOX");
918
-		$this->assertEquals(1,$result);
918
+		$this->assertEquals(1, $result);
919 919
 				
920 920
 	}
921 921
 
@@ -1144,11 +1144,11 @@  discard block
 block discarded – undo
1144 1144
 		//execute the method and test if it works and does not throws an exception.
1145 1145
 		try {
1146 1146
 			
1147
-			$inboundEmail->markEmails('1','unread');
1148
-			$inboundEmail->markEmails('1','read');
1149
-			$inboundEmail->markEmails('1','flagged');
1150
-			$inboundEmail->markEmails('1','unflagged');
1151
-			$inboundEmail->markEmails('1','answered');
1147
+			$inboundEmail->markEmails('1', 'unread');
1148
+			$inboundEmail->markEmails('1', 'read');
1149
+			$inboundEmail->markEmails('1', 'flagged');
1150
+			$inboundEmail->markEmails('1', 'unflagged');
1151
+			$inboundEmail->markEmails('1', 'answered');
1152 1152
 			
1153 1153
 			$this->assertTrue(true);
1154 1154
 		}
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
 
1176 1176
 		$inboundEmail = new InboundEmail();
1177 1177
 		
1178
-		$result = $inboundEmail->saveNewFolder("TEST","INBOX");
1178
+		$result = $inboundEmail->saveNewFolder("TEST", "INBOX");
1179 1179
 		
1180 1180
 		$this->assertEquals(false, $result);
1181 1181
 	}
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
 		
1240 1240
 		$_REQUEST['ie_name'] = "test";
1241 1241
 		$_REQUEST['ie_status'] = "Active";
1242
-		$_REQUEST['server_url'] ="";
1242
+		$_REQUEST['server_url'] = "";
1243 1243
 		$_REQUEST['email_user'] = "test";
1244 1244
 		$_REQUEST['email_password'] = "test_pass";
1245 1245
 		$_REQUEST['mailbox'] = "INBOX";
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
 	
1308 1308
 	
1309 1309
 		//test with valid user id
1310
-		$user->id= 1;
1310
+		$user->id = 1;
1311 1311
 		$result = $inboundEmail->getUserPersonalAccountCount($user);
1312 1312
 		$this->assertGreaterThan(0, $result);
1313 1313
 	
@@ -1329,8 +1329,8 @@  discard block
 block discarded – undo
1329 1329
 		$result = $inboundEmail->retrieveByGroupFolderId("");
1330 1330
 		
1331 1331
 		$this->assertTrue(is_array($result));	
1332
-		foreach($result as $ie){
1333
-			$this->assertInstanceOf('InboundEmail',$ie);
1332
+		foreach ($result as $ie) {
1333
+			$this->assertInstanceOf('InboundEmail', $ie);
1334 1334
 		}
1335 1335
 
1336 1336
 		
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
 		
1390 1390
 		$this->assertEquals(false, $inboundEmail->findOptimumSettings(true));
1391 1391
 		
1392
-		$this->assertEquals(false, $inboundEmail->findOptimumSettings(false,'test','test','','','INBOX'));
1392
+		$this->assertEquals(false, $inboundEmail->findOptimumSettings(false, 'test', 'test', '', '', 'INBOX'));
1393 1393
 		
1394 1394
 		
1395 1395
 		
@@ -1401,12 +1401,12 @@  discard block
 block discarded – undo
1401 1401
 		
1402 1402
 		//test without setting session key
1403 1403
 		$result = $inboundEmail->getSessionConnectionString("mail.google.com", "test", 22, "IMAP");
1404
-		$this->assertEquals("",$result);
1404
+		$this->assertEquals("", $result);
1405 1405
 				
1406 1406
 		//test with session key set
1407 1407
 		$_SESSION["mail.google.comtest22IMAP"] = "test connection string";
1408 1408
 		$result = $inboundEmail->getSessionConnectionString("mail.google.com", "test", 22, "IMAP");
1409
-		$this->assertEquals("test connection string",$result);
1409
+		$this->assertEquals("test connection string", $result);
1410 1410
 		
1411 1411
 	}
1412 1412
 
@@ -1425,13 +1425,13 @@  discard block
 block discarded – undo
1425 1425
 		
1426 1426
 		//test without setting session key
1427 1427
 		$result = $inboundEmail->getSessionInboundDelimiterString("mail.google.com", "test", 22, "IMAP");
1428
-		$this->assertEquals("",$result);
1428
+		$this->assertEquals("", $result);
1429 1429
 		
1430 1430
 		
1431 1431
 		//test with session key set
1432 1432
 		$_SESSION["mail.google.comtest22IMAPdelimiter"] = "delimit string";
1433 1433
 		$result = $inboundEmail->getSessionInboundDelimiterString("mail.google.com", "test", 22, "IMAP");
1434
-		$this->assertEquals("delimit string",$result);
1434
+		$this->assertEquals("delimit string", $result);
1435 1435
 				
1436 1436
 	}
1437 1437
 
@@ -1451,13 +1451,13 @@  discard block
 block discarded – undo
1451 1451
 		
1452 1452
 		//test without setting session key
1453 1453
 		$result = $inboundEmail->getSessionInboundFoldersString("mail.google.com", "test", 22, "IMAP");
1454
-		$this->assertEquals("",$result);
1454
+		$this->assertEquals("", $result);
1455 1455
 		
1456 1456
 		
1457 1457
 		//test with session key set
1458 1458
 		$_SESSION["mail.google.comtest22IMAPfoldersList"] = "foldersList string";
1459 1459
 		$result = $inboundEmail->getSessionInboundFoldersString("mail.google.com", "test", 22, "IMAP");
1460
-		$this->assertEquals("foldersList string",$result);
1460
+		$this->assertEquals("foldersList string", $result);
1461 1461
 		
1462 1462
 	}
1463 1463
 
@@ -1502,13 +1502,13 @@  discard block
 block discarded – undo
1502 1502
 		
1503 1503
 		$inboundEmail = new InboundEmail();
1504 1504
 		
1505
-		$inboundEmail->group_id =1;
1505
+		$inboundEmail->group_id = 1;
1506 1506
 		
1507 1507
 		$result = $inboundEmail->getGroupsWithSelectOptions();
1508 1508
 		$this->assertEquals("", $result);
1509 1509
 		
1510 1510
 		$expected = "\n<OPTION value='0'>1</OPTION>\n<OPTION selected value='1'>2</OPTION>\n<OPTION value='2'>3</OPTION>";
1511
-		$result = $inboundEmail->getGroupsWithSelectOptions(array(1,2,3));
1511
+		$result = $inboundEmail->getGroupsWithSelectOptions(array(1, 2, 3));
1512 1512
 		$this->assertEquals($expected, $result);
1513 1513
 		//var_dump($result);
1514 1514
 		
@@ -1533,7 +1533,7 @@  discard block
 block discarded – undo
1533 1533
 		
1534 1534
 		//execute the method and test if it works and does not throws an exception.
1535 1535
 		try {
1536
-			$result = $inboundEmail->handleAutoresponse($email,$contactAddr);
1536
+			$result = $inboundEmail->handleAutoresponse($email, $contactAddr);
1537 1537
 			$this->assertTrue(true);
1538 1538
 		}
1539 1539
 		catch (Exception $e) {
@@ -1603,8 +1603,8 @@  discard block
 block discarded – undo
1603 1603
 		$this->assertEquals(false, $result);
1604 1604
 		
1605 1605
 		//test with attributes set
1606
-		$inboundEmail->mailbox_type = 'createcase' ;
1607
-		$inboundEmail->groupfolder_id =1;
1606
+		$inboundEmail->mailbox_type = 'createcase';
1607
+		$inboundEmail->groupfolder_id = 1;
1608 1608
 		
1609 1609
 		$result = $inboundEmail->isMailBoxTypeCreateCase();
1610 1610
 		$this->assertEquals(true, $result);
@@ -1666,7 +1666,7 @@  discard block
 block discarded – undo
1666 1666
 		$inboundEmail = new InboundEmail();
1667 1667
 		
1668 1668
 		$parts = array(
1669
-					(Object) array('encoding'=>'utf-8','parts'=> array( (Object) array('encoding'=>'utf-8','parts'=>array((Object) array('encoding'=>'utf-8','parts'=>'dummy parts 2')))))			
1669
+					(Object)array('encoding'=>'utf-8', 'parts'=> array((Object)array('encoding'=>'utf-8', 'parts'=>array((Object)array('encoding'=>'utf-8', 'parts'=>'dummy parts 2')))))			
1670 1670
 				);
1671 1671
 		
1672 1672
 		//$result = $inboundEmail->getEncodingFromBreadCrumb("1.2.3", $parts);
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
 		$inboundEmail = new InboundEmail();
1684 1684
 		
1685 1685
 		$parts = array(
1686
-				(Object) array('ifparameters'=>1, 'attribute'=>'charset', 'value'=>'test','parts'=> array( (Object) array('ifparameters'=>1, 'attribute'=>'charset','value'=>'test' ,'parts'=>array((Object) array('ifparameters'=>1, 'attribute'=>'charset', 'value'=>'test','parts'=>'dummy parts 2')))))
1686
+				(Object)array('ifparameters'=>1, 'attribute'=>'charset', 'value'=>'test', 'parts'=> array((Object)array('ifparameters'=>1, 'attribute'=>'charset', 'value'=>'test', 'parts'=>array((Object)array('ifparameters'=>1, 'attribute'=>'charset', 'value'=>'test', 'parts'=>'dummy parts 2')))))
1687 1687
 		);
1688 1688
 		
1689 1689
 		$result = $inboundEmail->getCharsetFromBreadCrumb("1.2.3", $parts);
@@ -1705,7 +1705,7 @@  discard block
 block discarded – undo
1705 1705
 		
1706 1706
 		//execute the method and test if it works and does not throws an exception.
1707 1707
 		try {
1708
-			$result = $inboundEmail->getMessageTextFromSingleMimePart(1,1,$structure);
1708
+			$result = $inboundEmail->getMessageTextFromSingleMimePart(1, 1, $structure);
1709 1709
 			$this->assertTrue(true);
1710 1710
 		}
1711 1711
 		catch (Exception $e) {
@@ -1774,7 +1774,7 @@  discard block
 block discarded – undo
1774 1774
 		$inboundEmail = new InboundEmail();
1775 1775
 		
1776 1776
 		
1777
-		$expected = array (
1777
+		$expected = array(
1778 1778
 						  'From' => 'Media Temple user ([email protected])',
1779 1779
 						  'Subject' => 'article: How to Trace a Email',
1780 1780
 						  'Date' => 'January 25, 2011 3:30:58 PM PDT',
@@ -1801,12 +1801,12 @@  discard block
 block discarded – undo
1801 1801
 		$inboundEmail = new InboundEmail();
1802 1802
 		
1803 1803
 		//test with default
1804
-		$result = $inboundEmail->handleCharsetTranslation("sample text",'default');
1804
+		$result = $inboundEmail->handleCharsetTranslation("sample text", 'default');
1805 1805
 		$this->assertEquals("sample text", $result);
1806 1806
 		
1807 1807
 		
1808 1808
 		//test with ISO-8859-8
1809
-		$result = $inboundEmail->handleCharsetTranslation("sample text",'ISO-8859-8');
1809
+		$result = $inboundEmail->handleCharsetTranslation("sample text", 'ISO-8859-8');
1810 1810
 		$this->assertEquals("sample text", $result);
1811 1811
 			
1812 1812
 	}
@@ -1933,7 +1933,7 @@  discard block
 block discarded – undo
1933 1933
 		
1934 1934
 		$result = $inboundEmail->getNoteBeanForAttachment("1");
1935 1935
 		
1936
-		$this->assertInstanceOf('Note',$result);
1936
+		$this->assertInstanceOf('Note', $result);
1937 1937
 		$this->assertAttributeEquals('1', 'parent_id', $result);
1938 1938
 		$this->assertAttributeEquals('Emails', 'parent_type', $result);
1939 1939
 		
@@ -1946,8 +1946,8 @@  discard block
 block discarded – undo
1946 1946
 		$inboundEmail = new InboundEmail();
1947 1947
 
1948 1948
 		//test with filename attribute
1949
-		$part = (Object) array('dparameters'=> array((Object) array('attribute'=>'filename','value'=>'test1.txt'),(Object) array('attribute'=>'filename','value'=>'test2.txt')),
1950
-								'parameters'=> array((Object) array('attribute'=>'name','value'=>'test1'),(Object) array('attribute'=>'name','value'=>'test2'))
1949
+		$part = (Object)array('dparameters'=> array((Object)array('attribute'=>'filename', 'value'=>'test1.txt'), (Object)array('attribute'=>'filename', 'value'=>'test2.txt')),
1950
+								'parameters'=> array((Object)array('attribute'=>'name', 'value'=>'test1'), (Object)array('attribute'=>'name', 'value'=>'test2'))
1951 1951
 								);
1952 1952
 
1953 1953
 		$result = $inboundEmail->retrieveAttachmentNameFromStructure($part);
@@ -1956,8 +1956,8 @@  discard block
 block discarded – undo
1956 1956
 		
1957 1957
 		
1958 1958
 		//test with no filename attribute
1959
-		$part = (Object) array('dparameters'=> array((Object) array('attribute'=>'name','value'=>'test1.txt')),
1960
-								'parameters'=> array((Object) array('attribute'=>'name','value'=>'test1'),(Object) array('attribute'=>'name','value'=>'test2'))
1959
+		$part = (Object)array('dparameters'=> array((Object)array('attribute'=>'name', 'value'=>'test1.txt')),
1960
+								'parameters'=> array((Object)array('attribute'=>'name', 'value'=>'test1'), (Object)array('attribute'=>'name', 'value'=>'test2'))
1961 1961
 				
1962 1962
 								);
1963 1963
 
@@ -1977,7 +1977,7 @@  discard block
 block discarded – undo
1977 1977
 				
1978 1978
 		$inboundEmail = new InboundEmail();
1979 1979
 		
1980
-		$part = (Object) array("disposition" => "multipart", "subtype" => 10);
1980
+		$part = (Object)array("disposition" => "multipart", "subtype" => 10);
1981 1981
 		
1982 1982
 		//execute the method and test if it works and does not throws an exception.
1983 1983
 		try {
@@ -1996,8 +1996,8 @@  discard block
 block discarded – undo
1996 1996
 		$inboundEmail = new InboundEmail();
1997 1997
 		
1998 1998
 		$this->assertEquals("test", $inboundEmail->handleTranserEncoding("test"));
1999
-		$this->assertEquals("test", $inboundEmail->handleTranserEncoding("dGVzdA==",3));
2000
-		$this->assertEquals("test", $inboundEmail->handleTranserEncoding("test",4));
1999
+		$this->assertEquals("test", $inboundEmail->handleTranserEncoding("dGVzdA==", 3));
2000
+		$this->assertEquals("test", $inboundEmail->handleTranserEncoding("test", 4));
2001 2001
 
2002 2002
 	}
2003 2003
 
@@ -2024,7 +2024,7 @@  discard block
 block discarded – undo
2024 2024
 		$textHeader = "From: Media Temple user ([email protected])\r\nSubject: article: How to Trace a Email\r\nDate: January 25, 2011 3:30:58 PM PDT\r\nTo: [email protected]\r\nReturn-Path: <[email protected]>\r\nEnvelope-To: [email protected]\r\nDelivery-Date: Tue, 25 Jan 2011 15:31:01 -0700";
2025 2025
 	
2026 2026
 		$result = $inboundEmail->importDupeCheck("1", $textHeader, $textHeader);
2027
-		$this->assertEquals(true ,$result);
2027
+		$this->assertEquals(true, $result);
2028 2028
 		
2029 2029
 	}
2030 2030
 
@@ -2035,7 +2035,7 @@  discard block
 block discarded – undo
2035 2035
 		
2036 2036
 		$result = $inboundEmail->handleMimeHeaderDecode("Subject: article: How to Trace a Email");
2037 2037
 		
2038
-		$this->assertEquals("Subject: article: How to Trace a Email" ,$result);
2038
+		$this->assertEquals("Subject: article: How to Trace a Email", $result);
2039 2039
 		
2040 2040
 	}
2041 2041
 
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
 		
2047 2047
 		$result = $inboundEmail->handleMimeHeaderDecode("Date: January 25, 2011 3:30:58 PM PDT");
2048 2048
 				
2049
-		$this->assertEquals("Date: January 25, 2011 3:30:58 PM PDT" ,$result);
2049
+		$this->assertEquals("Date: January 25, 2011 3:30:58 PM PDT", $result);
2050 2050
 		
2051 2051
 	}
2052 2052
 
@@ -2084,7 +2084,7 @@  discard block
 block discarded – undo
2084 2084
 		//execute the method and test if it works and does not throws an exception.
2085 2085
 		try {
2086 2086
 			$result = $inboundEmail->importOneEmail("1", "1");
2087
-			$this->assertEquals(false,$result);
2087
+			$this->assertEquals(false, $result);
2088 2088
 		}
2089 2089
 		catch (Exception $e) {
2090 2090
 			$this->fail();
@@ -2112,7 +2112,7 @@  discard block
 block discarded – undo
2112 2112
 		
2113 2113
 		$result = $inboundEmail->handleUUEncodedEmailBody($raw, 1);
2114 2114
 		
2115
-		$this->assertEquals("\n" . $raw ,$result);
2115
+		$this->assertEquals("\n".$raw, $result);
2116 2116
 
2117 2117
 		
2118 2118
 	}
@@ -2150,7 +2150,7 @@  discard block
 block discarded – undo
2150 2150
 		
2151 2151
 		$email = new Email();
2152 2152
 		$email->reply_to_email = "[email protected]";
2153
-		$email->from_addr  = "[email protected]";
2153
+		$email->from_addr = "[email protected]";
2154 2154
 		
2155 2155
 		$result = $inboundEmail->checkFilterDomain($email);
2156 2156
 		$this->assertEquals(true, $result);
@@ -2167,8 +2167,8 @@  discard block
 block discarded – undo
2167 2167
 		
2168 2168
 		$inboundEmail = new InboundEmail();
2169 2169
 		
2170
-		$this->assertEquals(false, $inboundEmail->checkOutOfOffice("currently Out of Office, will reply later") );
2171
-		$this->assertEquals(true, $inboundEmail->checkOutOfOffice("test subject") );
2170
+		$this->assertEquals(false, $inboundEmail->checkOutOfOffice("currently Out of Office, will reply later"));
2171
+		$this->assertEquals(true, $inboundEmail->checkOutOfOffice("test subject"));
2172 2172
 	
2173 2173
 	}
2174 2174
 
@@ -2184,7 +2184,7 @@  discard block
 block discarded – undo
2184 2184
 		
2185 2185
 		$inboundEmail = new InboundEmail();
2186 2186
 		
2187
-		$inboundEmail->id =1;
2187
+		$inboundEmail->id = 1;
2188 2188
 
2189 2189
 		
2190 2190
 		//execute the setAutoreplyStatus method to set an auto reply status for email
@@ -2193,7 +2193,7 @@  discard block
 block discarded – undo
2193 2193
 
2194 2194
 		//test with and invalid email. it will return true as well because it's stil under max limit.
2195 2195
 		$result = $inboundEmail->getAutoreplyStatus("[email protected]");
2196
-		$this->assertEquals(true ,$result);
2196
+		$this->assertEquals(true, $result);
2197 2197
 		
2198 2198
 	}
2199 2199
 
@@ -2227,7 +2227,7 @@  discard block
 block discarded – undo
2227 2227
 		$expected = "			<form action=\"index.php\" method=\"post\" name=\"Macro\" id=\"form\">\n						<input type=\"hidden\" name=\"module\" value=\"InboundEmail\">\n						<input type=\"hidden\" name=\"action\" value=\"ListView\">\n						<input type=\"hidden\" name=\"save\" value=\"true\">\n\n			<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n				<tr>\n					<td>\n						<input 	title=\"Save\"\n								accessKey=\"a\"\n								class=\"button\"\n								onclick=\"this.form.return_module.value='InboundEmail'; this.form.return_action.value='ListView';\"\n								type=\"submit\" name=\"Edit\" value=\"  Save  \">\n					</td>\n				</tr>\n			</table>\n\n			<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"detail view\">\n				<tr>\n					<td valign=\"top\" width='10%' NOWRAP scope=\"row\">\n						<slot>\n							<b>:</b>\n						</slot>\n					</td>\n					<td valign=\"top\" width='20%'>\n						<slot>\n							<input name=\"inbound_email_case_macro\" type=\"text\" value=\"[CASE:%1]\">\n						</slot>\n					</td>\n					<td valign=\"top\" width='70%'>\n						<slot>\n							\n							<br />\n							<i></i>\n						</slot>\n					</td>\n				</tr>\n			</table>\n			</form>";
2228 2228
 		$result = $inboundEmail->getSystemSettingsForm();
2229 2229
 		
2230
-		$this->assertSame($expected,$result);		
2230
+		$this->assertSame($expected, $result);		
2231 2231
 				
2232 2232
 	}
2233 2233
 
@@ -2245,11 +2245,11 @@  discard block
 block discarded – undo
2245 2245
 		
2246 2246
 		$inboundEmail = new InboundEmail();
2247 2247
 		
2248
-		$result = $inboundEmail->get_stored_options("test","");
2248
+		$result = $inboundEmail->get_stored_options("test", "");
2249 2249
 		$this->assertEquals("", $result);
2250 2250
 
2251 2251
 		
2252
-		$result = $inboundEmail->get_stored_options("test","default_option");
2252
+		$result = $inboundEmail->get_stored_options("test", "default_option");
2253 2253
 		$this->assertEquals("default_option", $result);
2254 2254
 		
2255 2255
 	}
@@ -2294,8 +2294,8 @@  discard block
 block discarded – undo
2294 2294
 		$inboundEmail = new InboundEmail();
2295 2295
 		
2296 2296
 		$this->assertEquals("{:/service=}", $inboundEmail->getConnectString()); //test with default options
2297
-		$this->assertEquals("{:/service=mail.google.com}INBOX", $inboundEmail->getConnectString("mail.google.com","INBOX"));//test with includeMbox true
2298
-		$this->assertEquals("{:/service=mail.google.com}", $inboundEmail->getConnectString("mail.google.com","INBOX",false));//test with includeMbox false
2297
+		$this->assertEquals("{:/service=mail.google.com}INBOX", $inboundEmail->getConnectString("mail.google.com", "INBOX")); //test with includeMbox true
2298
+		$this->assertEquals("{:/service=mail.google.com}", $inboundEmail->getConnectString("mail.google.com", "INBOX", false)); //test with includeMbox false
2299 2299
 		
2300 2300
 	}
2301 2301
 
@@ -2351,11 +2351,11 @@  discard block
 block discarded – undo
2351 2351
 		$inboundEmail = new InboundEmail();
2352 2352
 		
2353 2353
 		//test without setting name
2354
-		$this->assertEquals(Null,$inboundEmail->get_summary_text());
2354
+		$this->assertEquals(Null, $inboundEmail->get_summary_text());
2355 2355
 		 
2356 2356
 		//test with name set
2357 2357
 		$inboundEmail->name = "test";
2358
-		$this->assertEquals('test',$inboundEmail->get_summary_text());
2358
+		$this->assertEquals('test', $inboundEmail->get_summary_text());
2359 2359
 		
2360 2360
 	}
2361 2361
 
@@ -2366,18 +2366,18 @@  discard block
 block discarded – undo
2366 2366
 		
2367 2367
 		//test with empty string params
2368 2368
 		$expected = " SELECT  inbound_email.*  , jt0.user_name created_by_name , jt0.created_by created_by_name_owner  , 'Users' created_by_name_mod FROM inbound_email   LEFT JOIN  users jt0 ON jt0.id=inbound_email.created_by AND jt0.deleted=0\n AND jt0.deleted=0 where inbound_email.deleted=0";
2369
-		$actual = $inboundEmail->create_export_query('','');
2370
-		$this->assertSame($expected,$actual);
2369
+		$actual = $inboundEmail->create_export_query('', '');
2370
+		$this->assertSame($expected, $actual);
2371 2371
 
2372 2372
 		
2373 2373
 		//test with valid string params
2374 2374
 		$expected = " SELECT  inbound_email.*  , jt0.user_name created_by_name , jt0.created_by created_by_name_owner  , 'Users' created_by_name_mod FROM inbound_email   LEFT JOIN  users jt0 ON jt0.id=inbound_email.created_by AND jt0.deleted=0\n AND jt0.deleted=0 where (jt0.user_name=\"\") AND inbound_email.deleted=0 ORDER BY inbound_email.id";
2375
-		$actual = $inboundEmail->create_export_query('id','jt0.user_name=""');
2376
-		$this->assertSame($expected,$actual);
2375
+		$actual = $inboundEmail->create_export_query('id', 'jt0.user_name=""');
2376
+		$this->assertSame($expected, $actual);
2377 2377
 		
2378 2378
 	}
2379 2379
 
2380
-	public function testget_list_view_data(){
2380
+	public function testget_list_view_data() {
2381 2381
 
2382 2382
 		$inboundEmail = new InboundEmail();
2383 2383
 
@@ -2574,7 +2574,7 @@  discard block
 block discarded – undo
2574 2574
 		$user->retrieve(1);
2575 2575
 		
2576 2576
 		//set a Outbound Server Id
2577
-		$inboundEmail->setUsersDefaultOutboundServerId($user,"123");
2577
+		$inboundEmail->setUsersDefaultOutboundServerId($user, "123");
2578 2578
 
2579 2579
 		
2580 2580
 		//retrieve Outbound Server Id back and verify
@@ -2599,7 +2599,7 @@  discard block
 block discarded – undo
2599 2599
 		
2600 2600
 		
2601 2601
 		//test with pop3 protocol and all parameters true
2602
-		$result = $inboundEmail->setEmailForDisplay("1",true,true,true);
2602
+		$result = $inboundEmail->setEmailForDisplay("1", true, true, true);
2603 2603
 		$this->assertEquals("error", $result);
2604 2604
 		
2605 2605
 		
@@ -2615,12 +2615,12 @@  discard block
 block discarded – undo
2615 2615
 		
2616 2616
 		$inboundEmail->email->name = "test";
2617 2617
 		$inboundEmail->email->from_addr_name = "from";
2618
-		$inboundEmail->email->to_addrs_names ="to";
2618
+		$inboundEmail->email->to_addrs_names = "to";
2619 2619
 		$inboundEmail->email->cc_addrs_names = "cc";
2620 2620
 		$inboundEmail->email->reply_to_addr = "reply";
2621 2621
 		
2622
-		$expected = array (
2623
-						  'meta' => array ( 'type' => 'archived', 'uid' => 1, 'ieId' => 1, 'email' => array ( 'name' => 'test','from_name' => '', 'from_addr' => 'from','date_start' => ' ', 'time_start' => '', 'message_id' => '', 'cc_addrs' => 'cc', 'attachments' => '', 'toaddrs' => 'to', 'description' => '', 'reply_to_addr' => 'reply',  ), 'mbox' => "INBOX", 'cc' => '', 'is_sugarEmail' => false, )
2622
+		$expected = array(
2623
+						  'meta' => array('type' => 'archived', 'uid' => 1, 'ieId' => 1, 'email' => array('name' => 'test', 'from_name' => '', 'from_addr' => 'from', 'date_start' => ' ', 'time_start' => '', 'message_id' => '', 'cc_addrs' => 'cc', 'attachments' => '', 'toaddrs' => 'to', 'description' => '', 'reply_to_addr' => 'reply',), 'mbox' => "INBOX", 'cc' => '', 'is_sugarEmail' => false,)
2624 2624
 						);
2625 2625
 		$result = $inboundEmail->displayOneEmail(1, "INBOX");
2626 2626
 		
@@ -2672,12 +2672,12 @@  discard block
 block discarded – undo
2672 2672
 
2673 2673
 		
2674 2674
 		//execute the method to sort the objects array descending and verify the order 
2675
-		$result = $inboundEmail->sortFetchedOverview($arr, 3,'DESC');
2675
+		$result = $inboundEmail->sortFetchedOverview($arr, 3, 'DESC');
2676 2676
 		$this->assertEquals('subject 2', $result['retArr'][0]->subject);
2677 2677
 		
2678 2678
 		
2679 2679
 		//execute the method to sort the objects array ascending and verify the order
2680
-		$result = $inboundEmail->sortFetchedOverview($arr, 3,'ASC');
2680
+		$result = $inboundEmail->sortFetchedOverview($arr, 3, 'ASC');
2681 2681
 		$this->assertEquals('subject 1', $result['retArr'][0]->subject);
2682 2682
 		
2683 2683
 	}
@@ -2687,7 +2687,7 @@  discard block
 block discarded – undo
2687 2687
 
2688 2688
 		$inboundEmail = new InboundEmail();
2689 2689
 		
2690
-		$expected = array ( 'mbox' => 'INBOX', 'ieId' => 1, 'name' => 'test', 'fromCache' => 0, 'out' => array () );
2690
+		$expected = array('mbox' => 'INBOX', 'ieId' => 1, 'name' => 'test', 'fromCache' => 0, 'out' => array());
2691 2691
 		$inboundEmail->id = 1;
2692 2692
 		$inboundEmail->name = "test";
2693 2693
 		
@@ -2738,8 +2738,8 @@  discard block
 block discarded – undo
2738 2738
 
2739 2739
 		$inboundEmail = new InboundEmail();
2740 2740
 		
2741
-		$inboundEmail->mailboxarray = array("INBOX.TRASH","OUTBOX.TRASH");
2742
-		$expected = array ( 'INBOX' => array ( 'TRASH' => 'TRASH' ), 'OUTBOX' => array ( 'TRASH' => 'TRASH') );
2741
+		$inboundEmail->mailboxarray = array("INBOX.TRASH", "OUTBOX.TRASH");
2742
+		$expected = array('INBOX' => array('TRASH' => 'TRASH'), 'OUTBOX' => array('TRASH' => 'TRASH'));
2743 2743
 		
2744 2744
 		
2745 2745
 		//test with justRaw default/false 
@@ -2759,7 +2759,7 @@  discard block
 block discarded – undo
2759 2759
 		
2760 2760
 		$inboundEmail->mailbox = 1;
2761 2761
 		$inboundEmail->mailbox = "INBOX.TRASH,OUTBOX.TRASH";
2762
-		$expected = array (	'INBOX' => 	array ( 'TRASH' => 'TRASH' ),'OUTBOX' => array ( 'TRASH' => 'TRASH'));
2762
+		$expected = array('INBOX' => 	array('TRASH' => 'TRASH'), 'OUTBOX' => array('TRASH' => 'TRASH'));
2763 2763
 		
2764 2764
 		$result = $inboundEmail->getMailBoxesForGroupAccount();
2765 2765
 		
@@ -2776,7 +2776,7 @@  discard block
 block discarded – undo
2776 2776
 		
2777 2777
 		$inboundEmail->retrieveMailBoxFolders();
2778 2778
 		
2779
-		$this->assertEquals(array("INBOX","OUTBOX","TRASH"), $inboundEmail->mailboxarray);
2779
+		$this->assertEquals(array("INBOX", "OUTBOX", "TRASH"), $inboundEmail->mailboxarray);
2780 2780
 		
2781 2781
 	} 
2782 2782
 
@@ -2789,7 +2789,7 @@  discard block
 block discarded – undo
2789 2789
 		
2790 2790
 		//execute the method and test if it works and does not throws an exception.
2791 2791
 		try {
2792
-			$inboundEmail->insertMailBoxFolders(array("INBOX","OUTBOX"));
2792
+			$inboundEmail->insertMailBoxFolders(array("INBOX", "OUTBOX"));
2793 2793
 			$this->assertTrue(true);
2794 2794
 		}
2795 2795
 		catch (Exception $e) {
@@ -2813,9 +2813,9 @@  discard block
 block discarded – undo
2813 2813
 
2814 2814
 		$inboundEmail = new InboundEmail();
2815 2815
 		
2816
-		$arraymbox = array ( 'INBOX' => 	array ( 'TRASH' => 'TRASH' ), 'OUTBOX' => array ( 'TRASH' => 'TRASH') );
2816
+		$arraymbox = array('INBOX' => 	array('TRASH' => 'TRASH'), 'OUTBOX' => array('TRASH' => 'TRASH'));
2817 2817
 		
2818
-		$expected = array('INBOX','INBOX.TRASH','OUTBOX', 'OUTBOX.TRASH');
2818
+		$expected = array('INBOX', 'INBOX.TRASH', 'OUTBOX', 'OUTBOX.TRASH');
2819 2819
 		
2820 2820
 		$result = $inboundEmail->generateFlatArrayFromMultiDimArray($arraymbox, ".");
2821 2821
 		
@@ -2827,9 +2827,9 @@  discard block
 block discarded – undo
2827 2827
 
2828 2828
 		$inboundEmail = new InboundEmail();
2829 2829
 		
2830
-		$expected = array (	'INBOX' => 	array ( 'TRASH' => 'TRASH' ),'OUTBOX' => array ( 'TRASH' => 'TRASH'));
2830
+		$expected = array('INBOX' => 	array('TRASH' => 'TRASH'), 'OUTBOX' => array('TRASH' => 'TRASH'));
2831 2831
 		
2832
-		$result = $inboundEmail->generateMultiDimArrayFromFlatArray(array("INBOX.TRASH","OUTBOX.TRASH"), ".");
2832
+		$result = $inboundEmail->generateMultiDimArrayFromFlatArray(array("INBOX.TRASH", "OUTBOX.TRASH"), ".");
2833 2833
 
2834 2834
 		$this->assertEquals($expected, $result);
2835 2835
 	
@@ -2840,8 +2840,8 @@  discard block
 block discarded – undo
2840 2840
 		$inboundEmail = new InboundEmail();
2841 2841
 		
2842 2842
 		$result = array(); 
2843
-		$arraymbox = array ( 'INBOX' => array ('TRASH' => 'TRASH'));
2844
-		$expected = array( 'MAIN', 'MAIN.INBOX','MAIN.INBOX.TRASH' );
2843
+		$arraymbox = array('INBOX' => array('TRASH' => 'TRASH'));
2844
+		$expected = array('MAIN', 'MAIN.INBOX', 'MAIN.INBOX.TRASH');
2845 2845
 		
2846 2846
 		$inboundEmail->generateArrayData("MAIN", $arraymbox, $result, ".");
2847 2847
 		
@@ -2855,9 +2855,9 @@  discard block
 block discarded – undo
2855 2855
 
2856 2856
 		$inboundEmail = new InboundEmail();
2857 2857
 		
2858
-		$result= $inboundEmail->sortMailboxes("INBOX.TRASH",array());
2858
+		$result = $inboundEmail->sortMailboxes("INBOX.TRASH", array());
2859 2859
 		
2860
-		$expected = array ( 'INBOX' => array ('TRASH' => 'TRASH'));
2860
+		$expected = array('INBOX' => array('TRASH' => 'TRASH'));
2861 2861
 		
2862 2862
 		$this->assertEquals($expected, $result);
2863 2863
 		
@@ -2918,7 +2918,7 @@  discard block
 block discarded – undo
2918 2918
 		//execute the contructor and check for the Object type and  attributes
2919 2919
 		$overview = new Overview();
2920 2920
 		
2921
-		$this->assertInstanceOf('Overview',$overview);
2921
+		$this->assertInstanceOf('Overview', $overview);
2922 2922
 			
2923 2923
 		$this->assertTrue(is_array($overview->fieldDefs));
2924 2924
 		$this->assertTrue(is_array($overview->indices));
Please login to merge, or discard this patch.
tests/tests/modules/AOR_Reports/AOR_ReportTest.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -3,15 +3,15 @@  discard block
 block discarded – undo
3 3
 
4 4
 class AOR_ReportTest extends PHPUnit_Framework_TestCase {
5 5
 
6
-	public function testAOR_Report(){
6
+	public function testAOR_Report() {
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
 		$aor_Report = new AOR_Report();
12
-		$this->assertInstanceOf('AOR_Report',$aor_Report);
13
-		$this->assertInstanceOf('Basic',$aor_Report);
14
-		$this->assertInstanceOf('SugarBean',$aor_Report);
12
+		$this->assertInstanceOf('AOR_Report', $aor_Report);
13
+		$this->assertInstanceOf('Basic', $aor_Report);
14
+		$this->assertInstanceOf('SugarBean', $aor_Report);
15 15
 			
16 16
 		$this->assertAttributeEquals('AOR_Reports', 'module_dir', $aor_Report);
17 17
 		$this->assertAttributeEquals('AOR_Report', 'object_name', $aor_Report);
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		
23 23
 	}
24 24
 
25
-	public function testbean_implements(){
25
+	public function testbean_implements() {
26 26
 
27 27
 		$aor_Report = new AOR_Report();
28 28
 		 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		
33 33
 	}
34 34
 
35
-    public function testsave(){
35
+    public function testsave() {
36 36
 
37 37
     	$aor_Report = new AOR_Report();
38 38
     	
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     }
76 76
     
77 77
 
78
-    public function testload_report_beans(){
78
+    public function testload_report_beans() {
79 79
 
80 80
     	$aor_Report = new AOR_Report();
81 81
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     }
92 92
 
93 93
 
94
-    public function testgetReportFields(){
94
+    public function testgetReportFields() {
95 95
     	
96 96
     	//execute the method and verify that it returns an array
97 97
     	$aor_Report = new AOR_Report();
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     }
102 102
 
103 103
 
104
-    public function testbuild_report_chart(){
104
+    public function testbuild_report_chart() {
105 105
 
106 106
     	$aor_Report = new AOR_Report();
107 107
     	$aor_Report->report_module = "Accounts";
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     }
115 115
 
116 116
 
117
-    public function testbuild_group_report(){
117
+    public function testbuild_group_report() {
118 118
 
119 119
     	
120 120
     	$aor_Report = new AOR_Report();
@@ -123,26 +123,26 @@  discard block
 block discarded – undo
123 123
 
124 124
     	//execute the method without any parameters and verify it returns html string
125 125
     	$html1 = $aor_Report->build_group_report();
126
-    	$this->assertGreaterThan(0,strlen($html1));
126
+    	$this->assertGreaterThan(0, strlen($html1));
127 127
     	
128 128
     	//execute the method wit offset parameter and verify it returns html string
129 129
     	$html2 = $aor_Report->build_group_report(1);
130
-    	$this->assertGreaterThan(0,strlen($html2));
130
+    	$this->assertGreaterThan(0, strlen($html2));
131 131
     	
132 132
     	//execute the method with both parameters and verify it returns html string
133
-    	$html3 = $aor_Report->build_group_report(0,false);
134
-    	$this->assertGreaterThan(0,strlen($html3));
133
+    	$html3 = $aor_Report->build_group_report(0, false);
134
+    	$this->assertGreaterThan(0, strlen($html3));
135 135
     	
136 136
     	//verify that all three html strings are different.
137
-    	$this->assertNotEquals($html1,$html2);
138
-    	$this->assertNotEquals($html1,$html3);
139
-    	$this->assertNotEquals($html2,$html3); 
137
+    	$this->assertNotEquals($html1, $html2);
138
+    	$this->assertNotEquals($html1, $html3);
139
+    	$this->assertNotEquals($html2, $html3); 
140 140
     	
141 141
     	
142 142
     }
143 143
 
144 144
 
145
-    public function testbuild_report_html(){
145
+    public function testbuild_report_html() {
146 146
 
147 147
     	$aor_Report = new AOR_Report();
148 148
     	$aor_Report->report_module = "Accounts";
@@ -150,56 +150,56 @@  discard block
 block discarded – undo
150 150
     	
151 151
     	//execute the method without any parameters and verify it returns html string
152 152
     	$html1 = $aor_Report->build_report_html();
153
-    	$this->assertGreaterThan(0,strlen($html1));
153
+    	$this->assertGreaterThan(0, strlen($html1));
154 154
 		
155 155
     	
156 156
     	//execute the method with both parameters and verify it returns html string
157
-    	$html2 = $aor_Report->build_report_html(0,false);
158
-    	$this->assertGreaterThan(0,strlen($html2));
157
+    	$html2 = $aor_Report->build_report_html(0, false);
158
+    	$this->assertGreaterThan(0, strlen($html2));
159 159
     	
160 160
     	
161 161
     	//execute the method with group and identifier parameters and verify it returns html string
162
-    	$html3 = $aor_Report->build_report_html(1,false,'grouptest','testidentifier');
163
-    	$this->assertGreaterThan(0,strlen($html3));
162
+    	$html3 = $aor_Report->build_report_html(1, false, 'grouptest', 'testidentifier');
163
+    	$this->assertGreaterThan(0, strlen($html3));
164 164
     	
165 165
     	
166 166
     	//verify that group and identifier exist in the strings
167
-    	$this->assertNotFalse(strpos($html3,'grouptest'));
168
-    	$this->assertNotFalse(strpos($html3,'testidentifier'));
167
+    	$this->assertNotFalse(strpos($html3, 'grouptest'));
168
+    	$this->assertNotFalse(strpos($html3, 'testidentifier'));
169 169
     	
170 170
     }
171 171
 
172
-    public function testgetTotalHTML(){
172
+    public function testgetTotalHTML() {
173 173
 
174 174
     	
175 175
     	//execute the method with required data preset and verify it returns expected result
176
-    	$fields =Array('label'=>Array('display'=>1 , 'total'=> 'SUM','label'=>'total'));
177
-    	$totals = Array('label'=> array(10,20,30));
176
+    	$fields = Array('label'=>Array('display'=>1, 'total'=> 'SUM', 'label'=>'total'));
177
+    	$totals = Array('label'=> array(10, 20, 30));
178 178
     	$expected = "<tbody><tr><th>total Sum</th></tr><tr><td>60</td></tr></tbody>";
179 179
     	
180 180
     	$aor_Report = new AOR_Report();
181
-    	$actual = $aor_Report->getTotalHTML($fields,$totals);
181
+    	$actual = $aor_Report->getTotalHTML($fields, $totals);
182 182
 
183 183
     	$this->assertSame($expected, $actual);
184 184
     	
185 185
     }
186 186
 
187
-    public function testcalculateTotal(){
187
+    public function testcalculateTotal() {
188 188
 
189 189
     	//execute the method with data preset and verify it returns expected result
190
-    	$totals = Array(10,20,30);
190
+    	$totals = Array(10, 20, 30);
191 191
     	
192 192
     	$aor_Report = new AOR_Report();
193 193
 
194 194
     	$this->assertEquals('', $aor_Report->calculateTotal('', $totals));
195 195
     	$this->assertEquals(60, $aor_Report->calculateTotal('SUM', $totals));
196 196
     	$this->assertEquals(3, $aor_Report->calculateTotal('COUNT', $totals));
197
-    	$this->assertEquals(20 , $aor_Report->calculateTotal('AVG', $totals)); 	
197
+    	$this->assertEquals(20, $aor_Report->calculateTotal('AVG', $totals)); 	
198 198
     	    	
199 199
     }
200 200
 
201 201
 
202
-    public function testbuild_report_csv(){
202
+    public function testbuild_report_csv() {
203 203
 
204 204
     	//this method uses exit so it cannot be tested
205 205
     	
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
 
216 216
 
217
-    public function testbuild_report_query(){
217
+    public function testbuild_report_query() {
218 218
 
219 219
     	$aor_Report = new AOR_Report();
220 220
     	$aor_Report->report_module = "Accounts";
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     	
230 230
     }
231 231
 
232
-    public function testbuild_report_query_select(){
232
+    public function testbuild_report_query_select() {
233 233
 
234 234
     	$aor_Report = new AOR_Report();
235 235
     	$aor_Report->report_module = "Accounts";    	
@@ -242,50 +242,50 @@  discard block
 block discarded – undo
242 242
     }
243 243
 
244 244
 
245
-    public function testbuild_report_query_join( ){
245
+    public function testbuild_report_query_join( ) {
246 246
 
247 247
     	$aor_Report = new AOR_Report();
248 248
     	$aor_Report->report_module = "Accounts";
249 249
 
250 250
     	
251 251
 		//test with type custom and verify that it retunrs expected results
252
-    	$expected = array ('join' => array ('accounts_contacts' => 'LEFT JOIN `accounts_cstm` `contacts` ON `accounts`.id = `contacts`.id_c '));     	
253
-    	$actual = $aor_Report->build_report_query_join('contacts', 'accounts_contacts', 'accounts', new Account() , 'custom', array() );
254
-		$this->assertSame($expected ,$actual);
252
+    	$expected = array('join' => array('accounts_contacts' => 'LEFT JOIN `accounts_cstm` `contacts` ON `accounts`.id = `contacts`.id_c '));     	
253
+    	$actual = $aor_Report->build_report_query_join('contacts', 'accounts_contacts', 'accounts', new Account(), 'custom', array());
254
+		$this->assertSame($expected, $actual);
255 255
     	
256 256
 		
257 257
 		//test with type relationship and verify that it retunrs expected results
258
-		$expected = array ('join' =>array ('accounts_contacts' => "LEFT JOIN accounts_contacts `accounts|accounts_contacts` ON `accounts`.id=`accounts|accounts_contacts`.account_id AND `accounts|accounts_contacts`.deleted=0\n\nLEFT JOIN contacts `accounts_contacts` ON `accounts_contacts`.id=`accounts|accounts_contacts`.contact_id AND `accounts_contacts`.deleted=0\n"),
259
-						   'select' =>array ('`accounts_contacts`.id AS \'accounts_contacts_id\''));
260
-		$actual = $aor_Report->build_report_query_join('contacts', 'accounts_contacts', 'accounts', new Account() , 'relationship', array() );
261
-		$this->assertSame($expected , $actual);
258
+		$expected = array('join' =>array('accounts_contacts' => "LEFT JOIN accounts_contacts `accounts|accounts_contacts` ON `accounts`.id=`accounts|accounts_contacts`.account_id AND `accounts|accounts_contacts`.deleted=0\n\nLEFT JOIN contacts `accounts_contacts` ON `accounts_contacts`.id=`accounts|accounts_contacts`.contact_id AND `accounts_contacts`.deleted=0\n"),
259
+						   'select' =>array('`accounts_contacts`.id AS \'accounts_contacts_id\''));
260
+		$actual = $aor_Report->build_report_query_join('contacts', 'accounts_contacts', 'accounts', new Account(), 'relationship', array());
261
+		$this->assertSame($expected, $actual);
262 262
     			
263 263
     }
264 264
 
265
-    public function testbuild_report_access_query(){
265
+    public function testbuild_report_access_query() {
266 266
 
267 267
     	$aor_Report = new AOR_Report();
268 268
     	
269 269
     	//test without alias and verify that it retunrs expected results
270 270
     	$result = $aor_Report->build_report_access_query(new AOR_Report(), '');
271
-    	$this->assertEquals("",$result);
271
+    	$this->assertEquals("", $result);
272 272
     	
273 273
     	//test with alias and verify that it retunrs expected results
274 274
     	$result = $aor_Report->build_report_access_query(new AOR_Report(), 'rep');
275
-    	$this->assertEquals("",$result);
275
+    	$this->assertEquals("", $result);
276 276
     	
277 277
     }
278 278
 
279 279
 
280
-    public function testbuild_report_query_where(){
280
+    public function testbuild_report_query_where() {
281 281
 
282 282
     	$aor_Report = new AOR_Report();
283 283
     	$aor_Report->report_module = "Accounts";
284 284
 
285 285
     	//execute the method and verify that it retunrs expected results
286
-    	$expected = Array ('where' => array ('accounts.deleted = 0 ')); 
286
+    	$expected = Array('where' => array('accounts.deleted = 0 ')); 
287 287
     	$actual = $aor_Report->build_report_query_where();
288
-    	$this->assertSame($expected , $actual);
288
+    	$this->assertSame($expected, $actual);
289 289
     	    	
290 290
     }
291 291
 
Please login to merge, or discard this patch.
tests/tests/modules/Notes/NoteTest.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-class NoteTest extends PHPUnit_Framework_TestCase  {
3
+class NoteTest extends PHPUnit_Framework_TestCase {
4 4
 
5 5
 
6 6
 	public function testNote() {
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 		//execute the contructor and check for the Object type and  attributes
9 9
 		$note = new Note();
10 10
 		
11
-		$this->assertInstanceOf('Note',$note);
12
-		$this->assertInstanceOf('SugarBean',$note);
11
+		$this->assertInstanceOf('Note', $note);
12
+		$this->assertInstanceOf('SugarBean', $note);
13 13
 		 
14 14
 		$this->assertAttributeEquals('Notes', 'module_dir', $note);
15 15
 		$this->assertAttributeEquals('Note', 'object_name', $note);
@@ -29,14 +29,14 @@  discard block
 block discarded – undo
29 29
 		//test with valid file name
30 30
 		$note->filename = "test.txt";
31 31
 		$note->safeAttachmentName();
32
-		$this->assertEquals("test.txt" ,$note->filename);
32
+		$this->assertEquals("test.txt", $note->filename);
33 33
 		
34 34
 		
35 35
 		//test with invalid file name
36 36
 		$note->filename = "test.php";
37 37
 		$note->safeAttachmentName();
38
-		$this->assertEquals(".txt" ,$note->name);
39
-		$this->assertEquals("test.php.txt" ,$note->filename);
38
+		$this->assertEquals(".txt", $note->name);
39
+		$this->assertEquals("test.php.txt", $note->filename);
40 40
 		
41 41
 	}
42 42
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		
57 57
 	}
58 58
 
59
-	public function testdeleteAttachment(){
59
+	public function testdeleteAttachment() {
60 60
 
61 61
 		$note = new Note();
62 62
 		
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
 		$note = new Note();
73 73
 		
74 74
 		//test without setting name
75
-		$this->assertEquals('',$note->get_summary_text());
75
+		$this->assertEquals('', $note->get_summary_text());
76 76
 		
77 77
 		//test with name set
78 78
 		$note->name = "test";
79
-		$this->assertEquals('test',$note->get_summary_text());
79
+		$this->assertEquals('test', $note->get_summary_text());
80 80
 		
81 81
 	}
82 82
 
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
     	
88 88
     	//test with empty string params
89 89
     	$expected = "SELECT notes.*, contacts.first_name, contacts.last_name, users.user_name as assigned_user_name  FROM notes 	LEFT JOIN contacts ON notes.contact_id=contacts.id   LEFT JOIN users ON notes.assigned_user_id=users.id where  notes.deleted=0 AND (contacts.deleted IS NULL OR contacts.deleted=0) ORDER BY notes.name";
90
-    	$actual = $note->create_export_query('','');
91
-    	$this->assertSame($expected,$actual);
90
+    	$actual = $note->create_export_query('', '');
91
+    	$this->assertSame($expected, $actual);
92 92
 
93 93
     	
94 94
     	//test with valid string params
95 95
     	$expected = "SELECT notes.*, contacts.first_name, contacts.last_name, users.user_name as assigned_user_name  FROM notes 	LEFT JOIN contacts ON notes.contact_id=contacts.id   LEFT JOIN users ON notes.assigned_user_id=users.id where users.user_name=\"\" AND  notes.deleted=0 AND (contacts.deleted IS NULL OR contacts.deleted=0) ORDER BY notes.name";
96
-    	$actual = $note->create_export_query('notes.id','users.user_name=""');
97
-    	$this->assertSame($expected,$actual);
96
+    	$actual = $note->create_export_query('notes.id', 'users.user_name=""');
97
+    	$this->assertSame($expected, $actual);
98 98
     	
99 99
 	}
100 100
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		$note->filename = "test.txt";
139 139
 		$note->contact_name = "test contact";
140 140
 
141
-		$expected = array (
141
+		$expected = array(
142 142
                       'ID' => $id,
143 143
 					  'FILENAME' => 'test.txt',
144 144
 					  'PARENT_TYPE' => 'Account',
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
 
160 160
 		$note = new Note();
161 161
 		
162
-		$expected = array("MAIN"=>"a", "PARENT"=>"a", "CONTACT"=>"a" );
162
+		$expected = array("MAIN"=>"a", "PARENT"=>"a", "CONTACT"=>"a");
163 163
 		$actual = $note->listviewACLHelper();
164
-		$this->assertSame($expected,$actual);
164
+		$this->assertSame($expected, $actual);
165 165
 	
166 166
 	}
167 167
 
Please login to merge, or discard this patch.
tests/tests/modules/Leads/LeadTest.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 		//execute the contructor and check for the Object type and  attributes
10 10
 		$lead = new Lead();
11 11
 		 
12
-		$this->assertInstanceOf('Lead',$lead);
13
-		$this->assertInstanceOf('Person',$lead);
14
-		$this->assertInstanceOf('SugarBean',$lead);
12
+		$this->assertInstanceOf('Lead', $lead);
13
+		$this->assertInstanceOf('Person', $lead);
14
+		$this->assertInstanceOf('SugarBean', $lead);
15 15
 		
16 16
 		$this->assertAttributeEquals('Leads', 'module_dir', $lead);
17 17
 		$this->assertAttributeEquals('Lead', 'object_name', $lead);
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
 		
32 32
 		//test without pre settting attributes
33 33
 		$result = $lead->get_account();
34
-		$this->assertEquals(null,$result);
34
+		$this->assertEquals(null, $result);
35 35
 		
36 36
 		
37 37
 		//test with required attributes preset
38
-		$lead->account_id =1;
38
+		$lead->account_id = 1;
39 39
 		$result = $lead->get_account();
40
-		$this->assertEquals(null,$result);
40
+		$this->assertEquals(null, $result);
41 41
 		
42 42
 		
43 43
 	}
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 		
50 50
 		//test without pre settting attributes
51 51
 		$result = $lead->get_opportunity();
52
-		$this->assertEquals(null,$result);
52
+		$this->assertEquals(null, $result);
53 53
 		
54 54
 		
55 55
 		//test with required attributes preset
56
-		$lead->opportunity_id =1;
56
+		$lead->opportunity_id = 1;
57 57
 		$result = $lead->get_opportunity();
58
-		$this->assertEquals(null,$result);
58
+		$this->assertEquals(null, $result);
59 59
 		
60 60
 	}
61 61
 	
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 		
67 67
 		//test without pre settting attributes
68 68
 		$result = $lead->get_contact();
69
-		$this->assertEquals(null,$result);
69
+		$this->assertEquals(null, $result);
70 70
 		
71 71
 		
72 72
 		//test with required attributes preset
73
-		$lead->contact_id =1;
73
+		$lead->contact_id = 1;
74 74
 		$result = $lead->get_contact();
75
-		$this->assertEquals(null,$result);
75
+		$this->assertEquals(null, $result);
76 76
 		
77 77
 		
78 78
 	}
@@ -83,14 +83,14 @@  discard block
 block discarded – undo
83 83
 		
84 84
 		//test with empty string params
85 85
 		$expected = "SELECT leads.*, users.user_name assigned_user_name FROM leads 			LEFT JOIN users\n                                ON leads.assigned_user_id=users.id LEFT JOIN email_addr_bean_rel eabl  ON eabl.bean_id = leads.id AND eabl.bean_module = 'Leads' and eabl.primary_address = 1 and eabl.deleted=0 LEFT JOIN email_addresses ea ON (ea.id = eabl.email_address_id) where  leads.deleted=0 ";
86
-		$actual = $lead->create_list_query('','');
87
-		$this->assertSame($expected,$actual);
86
+		$actual = $lead->create_list_query('', '');
87
+		$this->assertSame($expected, $actual);
88 88
 		
89 89
 		 
90 90
 		//test with valid string params
91 91
 		$expected = "SELECT leads.*, users.user_name assigned_user_name FROM leads 			LEFT JOIN users\n                                ON leads.assigned_user_id=users.id LEFT JOIN email_addr_bean_rel eabl  ON eabl.bean_id = leads.id AND eabl.bean_module = 'Leads' and eabl.primary_address = 1 and eabl.deleted=0 LEFT JOIN email_addresses ea ON (ea.id = eabl.email_address_id) where (users.user_name=\"\") AND  leads.deleted=0  ORDER BY leads.id";
92
-		$actual = $lead->create_list_query('leads.id','users.user_name=""');
93
-		$this->assertSame($expected,$actual);
92
+		$actual = $lead->create_list_query('leads.id', 'users.user_name=""');
93
+		$this->assertSame($expected, $actual);
94 94
 				
95 95
 	}
96 96
 
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
 		
102 102
 		//test with empty string params
103 103
 		$expected = " SELECT  leads.* , '                                                                                                                                                                                                                                                              ' c_accept_status_fields , '                                    '  call_id , '                                                                                                                                                                                                                                                              ' e_invite_status_fields , '                                    '  fp_events_leads_1fp_events_ida , '                                                                                                                                                                                                                                                              ' e_accept_status_fields , LTRIM(RTRIM(CONCAT(IFNULL(leads.first_name,''),' ',IFNULL(leads.last_name,'')))) as name , jt3.user_name modified_by_name , jt3.created_by modified_by_name_owner  , 'Users' modified_by_name_mod , jt4.user_name created_by_name , jt4.created_by created_by_name_owner  , 'Users' created_by_name_mod , jt5.user_name assigned_user_name , jt5.created_by assigned_user_name_owner  , 'Users' assigned_user_name_mod, LTRIM(RTRIM(CONCAT(IFNULL(leads.first_name,''),' ',IFNULL(leads.last_name,'')))) as full_name , jt6.name campaign_name , jt6.assigned_user_id campaign_name_owner  , 'Campaigns' campaign_name_mod, '                                                                                                                                                                                                                                                              ' m_accept_status_fields , '                                    '  meeting_id  FROM leads   LEFT JOIN  users jt3 ON leads.modified_user_id=jt3.id AND jt3.deleted=0\n\n AND jt3.deleted=0  LEFT JOIN  users jt4 ON leads.created_by=jt4.id AND jt4.deleted=0\n\n AND jt4.deleted=0  LEFT JOIN  users jt5 ON leads.assigned_user_id=jt5.id AND jt5.deleted=0\n\n AND jt5.deleted=0  LEFT JOIN  campaigns jt6 ON leads.campaign_id=jt6.id AND jt6.deleted=0\n\n AND jt6.deleted=0 where leads.deleted=0";
104
-		$actual = $lead->create_new_list_query('','');
105
-		$this->assertSame($expected,$actual);
104
+		$actual = $lead->create_new_list_query('', '');
105
+		$this->assertSame($expected, $actual);
106 106
 
107 107
 			
108 108
 		//test with valid string params
109 109
 		$expected = " SELECT  leads.* , '                                                                                                                                                                                                                                                              ' c_accept_status_fields , '                                    '  call_id , '                                                                                                                                                                                                                                                              ' e_invite_status_fields , '                                    '  fp_events_leads_1fp_events_ida , '                                                                                                                                                                                                                                                              ' e_accept_status_fields , LTRIM(RTRIM(CONCAT(IFNULL(leads.first_name,''),' ',IFNULL(leads.last_name,'')))) as name , jt3.user_name modified_by_name , jt3.created_by modified_by_name_owner  , 'Users' modified_by_name_mod , jt4.user_name created_by_name , jt4.created_by created_by_name_owner  , 'Users' created_by_name_mod , jt5.user_name assigned_user_name , jt5.created_by assigned_user_name_owner  , 'Users' assigned_user_name_mod, LTRIM(RTRIM(CONCAT(IFNULL(leads.first_name,''),' ',IFNULL(leads.last_name,'')))) as full_name , jt6.name campaign_name , jt6.assigned_user_id campaign_name_owner  , 'Campaigns' campaign_name_mod, '                                                                                                                                                                                                                                                              ' m_accept_status_fields , '                                    '  meeting_id  FROM leads   LEFT JOIN  users jt3 ON leads.modified_user_id=jt3.id AND jt3.deleted=0\n\n AND jt3.deleted=0  LEFT JOIN  users jt4 ON leads.created_by=jt4.id AND jt4.deleted=0\n\n AND jt4.deleted=0  LEFT JOIN  users jt5 ON leads.assigned_user_id=jt5.id AND jt5.deleted=0\n\n AND jt5.deleted=0  LEFT JOIN  campaigns jt6 ON leads.campaign_id=jt6.id AND jt6.deleted=0\n\n AND jt6.deleted=0 where (users.user_name=\"\") AND leads.deleted=0";
110
-		$actual = $lead->create_new_list_query('leads.id','users.user_name=""');
111
-		$this->assertSame($expected,$actual);
110
+		$actual = $lead->create_new_list_query('leads.id', 'users.user_name=""');
111
+		$this->assertSame($expected, $actual);
112 112
 		
113 113
 	}
114 114
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     	$lead = new Lead();
118 118
 
119 119
     	$lead->first_name = "firstn";
120
-    	$lead->last_name ="lastnn";
120
+    	$lead->last_name = "lastnn";
121 121
     	$lead->lead_source = "test";
122 122
     	    	
123 123
     	$result = $lead->save();
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     	//mark the record as deleted and verify that this record cannot be retrieved anymore.
147 147
     	$lead->mark_deleted($lead->id);
148 148
     	$result = $lead->retrieve($lead->id);
149
-    	$this->assertEquals(null,$result);
149
+    	$this->assertEquals(null, $result);
150 150
     	
151 151
     }
152 152
 
@@ -157,11 +157,11 @@  discard block
 block discarded – undo
157 157
 		$lead = new Lead();
158 158
 		
159 159
 		$lead->first_name = "firstn";
160
-		$lead->last_name ="lastn";
160
+		$lead->last_name = "lastn";
161 161
 		
162 162
 		$lead->fill_in_additional_list_fields();
163 163
 		
164
-		$this->assertEquals("firstn lastn", $lead->name );
164
+		$this->assertEquals("firstn lastn", $lead->name);
165 165
 		
166 166
 	}
167 167
 
@@ -172,21 +172,21 @@  discard block
 block discarded – undo
172 172
 		$lead = new Lead();
173 173
 		
174 174
 		$lead->first_name = "firstn";
175
-		$lead->last_name ="lastn";
175
+		$lead->last_name = "lastn";
176 176
 		
177 177
 		$lead->fill_in_additional_detail_fields();
178 178
 		
179
-		$this->assertEquals("firstn lastn", $lead->name );
179
+		$this->assertEquals("firstn lastn", $lead->name);
180 180
 		
181 181
 		
182 182
 		
183 183
 	}
184 184
 
185
-	public function testget_list_view_data(){
185
+	public function testget_list_view_data() {
186 186
 
187 187
 		$lead = new Lead();
188 188
 		
189
-		$expected = array (
189
+		$expected = array(
190 190
 					  'NAME' => ' ',
191 191
 					  'DELETED' => 0,
192 192
 					  'FULL_NAME' => ' ',
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     {
215 215
     	$lead = new Lead();
216 216
 
217
-    	$expected = array (
217
+    	$expected = array(
218 218
 					  'created_by_link',
219 219
 					  'modified_user_link',
220 220
 					  'assigned_user_link',
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
         sort($expected);
243 243
         $actualKeys = array_keys($actual);
244 244
         sort($actualKeys);
245
-    	$this->assertSame($expected ,$actualKeys);
245
+    	$this->assertSame($expected, $actualKeys);
246 246
     	
247 247
     }
248 248
 
249
-	public function testbuild_generic_where_clause () 
249
+	public function testbuild_generic_where_clause() 
250 250
 	{
251 251
 		
252 252
 		$lead = new Lead();
@@ -254,13 +254,13 @@  discard block
 block discarded – undo
254 254
 		//test with empty string params
255 255
 		$expected = "leads.last_name like '%' or leads.account_name like '%' or leads.first_name like '%' or ea.email_address like '%'";
256 256
 		$actual = $lead->build_generic_where_clause("");
257
-		$this->assertSame($expected,$actual);
257
+		$this->assertSame($expected, $actual);
258 258
 
259 259
 		
260 260
 		//test with valid string params
261 261
 		$expected = "leads.last_name like '%' or leads.account_name like '%' or leads.first_name like '%' or ea.email_address like '%'";
262 262
 		$actual = $lead->build_generic_where_clause("123");
263
-		$this->assertSame($expected,$actual);
263
+		$this->assertSame($expected, $actual);
264 264
 		
265 265
 	}
266 266
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 		//test with attributes preset and verify template variables are set accordingly
273 273
 		
274 274
 		$lead->first_name = "firstn";
275
-		$lead->last_name ="lastn";
275
+		$lead->last_name = "lastn";
276 276
 		$lead->salutation = "Mr";
277 277
 		$lead->lead_source = "Email";
278 278
 		$lead->status = "New";
@@ -280,10 +280,10 @@  discard block
 block discarded – undo
280 280
 		
281 281
 		$result = $lead->set_notification_body(new Sugar_Smarty(), $lead);
282 282
 		
283
-		$this->assertEquals("Mr firstn lastn" ,$result->_tpl_vars['LEAD_NAME']);
284
-		$this->assertEquals($lead->lead_source ,$result->_tpl_vars['LEAD_SOURCE']);
285
-		$this->assertEquals($lead->status ,$result->_tpl_vars['LEAD_STATUS']);
286
-		$this->assertEquals($lead->description ,$result->_tpl_vars['LEAD_DESCRIPTION']);
283
+		$this->assertEquals("Mr firstn lastn", $result->_tpl_vars['LEAD_NAME']);
284
+		$this->assertEquals($lead->lead_source, $result->_tpl_vars['LEAD_SOURCE']);
285
+		$this->assertEquals($lead->status, $result->_tpl_vars['LEAD_STATUS']);
286
+		$this->assertEquals($lead->description, $result->_tpl_vars['LEAD_DESCRIPTION']);
287 287
 
288 288
 	}
289 289
 
@@ -301,9 +301,9 @@  discard block
 block discarded – undo
301 301
 	{
302 302
 		$lead = new Lead();
303 303
 
304
-		$expected = array("MAIN"=>"a", "ACCOUNT"=>"a", "OPPORTUNITY"=>"a", "CONTACT"=>"a" );
304
+		$expected = array("MAIN"=>"a", "ACCOUNT"=>"a", "OPPORTUNITY"=>"a", "CONTACT"=>"a");
305 305
 		$actual = $lead->listviewACLHelper();
306
-		$this->assertSame($expected,$actual);
306
+		$this->assertSame($expected, $actual);
307 307
 	
308 308
 	}
309 309
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 				
319 319
 		$result = $lead->convertCustomFieldsForm($form, $tempBean, $prefix);
320 320
 		
321
-		$this->assertEquals(true,$result);
321
+		$this->assertEquals(true, $result);
322 322
 		$this->assertgreaterThanOrEqual("", $form); //no filed with source = custom_fields 
323 323
 		
324 324
 	}
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 
331 331
 		$expected = "SELECT emails.id FROM emails  JOIN (select DISTINCT email_id from emails_email_addr_rel eear\n\n	join email_addr_bean_rel eabr on eabr.bean_id ='' and eabr.bean_module = 'Leads' and\n	eabr.email_address_id = eear.email_address_id and eabr.deleted=0\n	where eear.deleted=0 and eear.email_id not in\n	(select eb.email_id from emails_beans eb where eb.bean_module ='Leads' and eb.bean_id = '')\n	) derivedemails on derivedemails.email_id = emails.id";
332 332
 		$actual = $lead->get_unlinked_email_query();
333
-		$this->assertSame($expected,$actual);
333
+		$this->assertSame($expected, $actual);
334 334
 
335 335
 	}
336 336
     
@@ -339,16 +339,16 @@  discard block
 block discarded – undo
339 339
     {
340 340
     	$lead = new Lead();
341 341
     	
342
-    	$expected = array (
342
+    	$expected = array(
343 343
 					  "select" => "SELECT calls.id ",
344 344
 					  "from" => "FROM calls ",
345 345
 					  "where" => " WHERE calls.parent_id = '' \n            AND calls.parent_type = 'Leads' AND calls.id NOT IN ( SELECT call_id FROM calls_leads ) ",
346 346
 					  "join" => "",
347
-					  "join_tables" =>  array (""),
347
+					  "join_tables" =>  array(""),
348 348
 					);
349 349
     	
350 350
     	$actual = $lead->get_old_related_calls();
351
-    	$this->assertSame($expected,$actual);
351
+    	$this->assertSame($expected, $actual);
352 352
     	
353 353
     }
354 354
 
@@ -357,9 +357,9 @@  discard block
 block discarded – undo
357 357
 	{
358 358
 		$lead = new Lead();
359 359
 		
360
-		$expected = array( "copy"=>"Copy", "move"=>"Move", "donothing"=>"Do Nothing");
360
+		$expected = array("copy"=>"Copy", "move"=>"Move", "donothing"=>"Do Nothing");
361 361
 		$actual = $lead->getActivitiesOptions();
362
-		$this->assertSame($expected,$actual);
362
+		$this->assertSame($expected, $actual);
363 363
 		
364 364
     }
365 365
 
@@ -368,16 +368,16 @@  discard block
 block discarded – undo
368 368
     {
369 369
     	$lead = new Lead();
370 370
 
371
-    	$expected = array (
371
+    	$expected = array(
372 372
 					  "select" => "SELECT meetings.id ",
373 373
 					  "from" => "FROM meetings ",
374 374
 					  "where" => " WHERE meetings.parent_id = '' \n            AND meetings.parent_type = 'Leads' AND meetings.id NOT IN ( SELECT meeting_id FROM meetings_leads ) ",
375 375
 					  "join" => "",
376
-					  "join_tables" => array (""),
376
+					  "join_tables" => array(""),
377 377
 					);
378 378
     	 
379 379
     	$actual = $lead->get_old_related_meetings();
380
-    	 $this->assertSame($expected,$actual);
380
+    	 $this->assertSame($expected, $actual);
381 381
     	
382 382
     }
383 383
 
Please login to merge, or discard this patch.
tests/tests/modules/OAuthKeys/OAuthKeyTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-class OAuthKeyTest extends PHPUnit_Framework_TestCase{
4
+class OAuthKeyTest extends PHPUnit_Framework_TestCase {
5 5
 
6 6
 
7 7
 	public function testOAuthKey()
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
 		//execute the contructor and check for the Object type and  attributes
11 11
 		$oauthKey = new OAuthKey();
12 12
 		
13
-		$this->assertInstanceOf('OAuthKey',$oauthKey);
14
-		$this->assertInstanceOf('Basic',$oauthKey);
15
-		$this->assertInstanceOf('SugarBean',$oauthKey);
13
+		$this->assertInstanceOf('OAuthKey', $oauthKey);
14
+		$this->assertInstanceOf('Basic', $oauthKey);
15
+		$this->assertInstanceOf('SugarBean', $oauthKey);
16 16
 			
17 17
 		$this->assertAttributeEquals('OAuthKeys', 'module_dir', $oauthKey);
18 18
 		$this->assertAttributeEquals('OAuthKey', 'object_name', $oauthKey);
Please login to merge, or discard this patch.
tests/tests/modules/AOS_Products/AOS_ProductsTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@  discard block
 block discarded – undo
2 2
 
3 3
 class AOS_ProductsTest extends PHPUnit_Framework_TestCase {
4 4
 	
5
-	public function testAOS_Products(){	
5
+	public function testAOS_Products() {	
6 6
 
7 7
 		//execute the contructor and check for the Object type and  attributes
8 8
 		$aosProducts = new AOS_Products();
9
-		$this->assertInstanceOf('AOS_Products',$aosProducts);
10
-		$this->assertInstanceOf('Basic',$aosProducts);
11
-		$this->assertInstanceOf('SugarBean',$aosProducts);
9
+		$this->assertInstanceOf('AOS_Products', $aosProducts);
10
+		$this->assertInstanceOf('Basic', $aosProducts);
11
+		$this->assertInstanceOf('SugarBean', $aosProducts);
12 12
 			
13 13
 		$this->assertAttributeEquals('AOS_Products', 'module_dir', $aosProducts);
14 14
 		$this->assertAttributeEquals('AOS_Products', 'object_name', $aosProducts);
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		
20 20
 	}
21 21
 	
22
-	public function testsave(){
22
+	public function testsave() {
23 23
 
24 24
 		error_reporting(E_ERROR | E_PARSE);
25 25
 		
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		
28 28
 		$aosProducts->name = "test";
29 29
 		$aosProducts->category = 1;
30
-		$aosProducts->product_image='test img';
30
+		$aosProducts->product_image = 'test img';
31 31
 		$_POST['deleteAttachment'] = '1';
32 32
 		
33 33
 		$aosProducts->save();
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		//mark the record as deleted and verify that this record cannot be retrieved anymore.
42 42
 		$aosProducts->mark_deleted($aosProducts->id);
43 43
 		$result = $aosProducts->retrieve($aosProducts->id);
44
-		$this->assertEquals(null,$result);
44
+		$this->assertEquals(null, $result);
45 45
 		
46 46
     }
47 47
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		//execute the method and verify that it retunrs expected results
54 54
 		$expected = "\n 			SELECT * FROM (\n 				SELECT\n					aos_quotes.*,\n					accounts.id AS account_id,\n					accounts.name AS billing_account,\n					\n					opportunity_id AS opportunity,\n					billing_contact_id AS billing_contact,\n					'' AS created_by_name,\n					'' AS modified_by_name,\n					'' AS assigned_user_name\n				FROM\n					aos_products\n\n				JOIN aos_products_quotes ON aos_products_quotes.product_id = aos_products.id AND aos_products.id = '1' AND aos_products_quotes.deleted = 0 AND aos_products.deleted = 0\n				JOIN aos_quotes ON aos_quotes.id = aos_products_quotes.parent_id AND aos_quotes.stage = 'Closed Accepted' AND aos_quotes.deleted = 0\n				JOIN accounts ON accounts.id = aos_quotes.billing_account_id -- AND accounts.deleted = 0\n\n				GROUP BY accounts.id\n			) AS aos_quotes\n\n		";
55 55
 		$actual = $aosProducts->getCustomersPurchasedProductsQuery();		
56
-		$this->assertSame($expected,$actual);
56
+		$this->assertSame($expected, $actual);
57 57
 		
58 58
 	}	
59 59
 	
Please login to merge, or discard this patch.
tests/tests/modules/Tasks/TaskTest.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 		//execute the contructor and check for the Object type and  attributes
9 9
 		$task = new Task();
10 10
 		
11
-		$this->assertInstanceOf('Task',$task);
12
-		$this->assertInstanceOf('SugarBean',$task);
11
+		$this->assertInstanceOf('Task', $task);
12
+		$this->assertInstanceOf('SugarBean', $task);
13 13
 			
14 14
 		$this->assertAttributeEquals('tasks', 'table_name', $task);
15 15
 		$this->assertAttributeEquals('Tasks', 'module_dir', $task);
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     	
28 28
     	$task = new Task();
29 29
     	
30
-		$task->name  = "test";
30
+		$task->name = "test";
31 31
 		$task->priority = "Medium";
32 32
 		$task->parent_type = "Accounts";
33 33
 		$task->status = "In Progress";
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     	//mark the record as deleted and verify that this record cannot be retrieved anymore.
43 43
     	$task->mark_deleted($task->id);
44 44
     	$result = $task->retrieve($task->id);
45
-    	$this->assertEquals(null,$result);
45
+    	$this->assertEquals(null, $result);
46 46
     	
47 47
     }
48 48
 
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
 		$task = new Task();
53 53
 		
54 54
 		//test without setting name
55
-		$this->assertEquals(Null,$task->get_summary_text());
55
+		$this->assertEquals(Null, $task->get_summary_text());
56 56
 		
57 57
 		//test with name set
58 58
 		$task->name = "test";
59
-		$this->assertEquals('test',$task->get_summary_text());
59
+		$this->assertEquals('test', $task->get_summary_text());
60 60
 
61 61
 	}
62 62
 
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
     	
68 68
     	//test with empty string params
69 69
     	$expected = "SELECT tasks.*, users.user_name as assigned_user_name  FROM tasks   LEFT JOIN users ON tasks.assigned_user_id=users.id where tasks.deleted=0 ORDER BY tasks.name";
70
-    	$actual = $task->create_export_query('','');
71
-    	$this->assertSame($expected,$actual);
70
+    	$actual = $task->create_export_query('', '');
71
+    	$this->assertSame($expected, $actual);
72 72
     	
73 73
     		
74 74
     	//test with valid string params
75 75
     	$expected = "SELECT tasks.*, users.user_name as assigned_user_name  FROM tasks   LEFT JOIN users ON tasks.assigned_user_id=users.id where users.user_name = \"\" AND tasks.deleted=0 ORDER BY tasks.name";
76
-    	$actual = $task->create_export_query('tasks.id','users.user_name = ""');
77
-    	$this->assertSame($expected,$actual);
76
+    	$actual = $task->create_export_query('tasks.id', 'users.user_name = ""');
77
+    	$this->assertSame($expected, $actual);
78 78
     	
79 79
     }
80 80
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	{
132 132
 		$task = new Task();
133 133
 		
134
-		$task->name  = "test";
134
+		$task->name = "test";
135 135
 		$task->priority = "Medium";
136 136
 		$task->parent_type = "Accounts";
137 137
 		$task->status = "In Progress";
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		$task->contact_phone = "1234567";
140 140
 		$task->parent_name = "test";
141 141
 		
142
-		$expected = array (
142
+		$expected = array(
143 143
 				'NAME' => 'test',
144 144
 				'DELETED' => 0,
145 145
 				'STATUS' => 'In Progress',
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
 		);
160 160
 		
161 161
 		$actual = $task->get_list_view_data();
162
-        foreach($expected as $expectedKey => $expectedVal){
163
-            if($expectedKey == 'SET_COMPLETE'){
164
-                $this->assertRegExp($expected[$expectedKey],$actual[$expectedKey]);
165
-            }else {
162
+        foreach ($expected as $expectedKey => $expectedVal) {
163
+            if ($expectedKey == 'SET_COMPLETE') {
164
+                $this->assertRegExp($expected[$expectedKey], $actual[$expectedKey]);
165
+            } else {
166 166
                 $this->assertSame($expected[$expectedKey], $actual[$expectedKey]);
167 167
             }
168 168
         }
@@ -179,17 +179,17 @@  discard block
 block discarded – undo
179 179
 		$task->priority = "Medium";
180 180
 		$task->date_due = "2016-02-11 17:30:00";
181 181
 		$task->status = "In Progress";		
182
-		$task->description = "test description" ;
182
+		$task->description = "test description";
183 183
 		
184 184
 		$task->current_notify_user = new User(1);
185 185
 		
186 186
 		$result = $task->set_notification_body(new Sugar_Smarty(), $task);
187 187
 		
188
-		$this->assertEquals($task->name ,$result->_tpl_vars['TASK_SUBJECT']);
189
-		$this->assertEquals($task->status ,$result->_tpl_vars['TASK_STATUS']);
190
-		$this->assertEquals($task->priority ,$result->_tpl_vars['TASK_PRIORITY']);
191
-		$this->assertEquals("02/11/2016 17:30 UTC(+00:00)" ,$result->_tpl_vars['TASK_DUEDATE']);
192
-		$this->assertEquals($task->description ,$result->_tpl_vars['TASK_DESCRIPTION']);
188
+		$this->assertEquals($task->name, $result->_tpl_vars['TASK_SUBJECT']);
189
+		$this->assertEquals($task->status, $result->_tpl_vars['TASK_STATUS']);
190
+		$this->assertEquals($task->priority, $result->_tpl_vars['TASK_PRIORITY']);
191
+		$this->assertEquals("02/11/2016 17:30 UTC(+00:00)", $result->_tpl_vars['TASK_DUEDATE']);
192
+		$this->assertEquals($task->description, $result->_tpl_vars['TASK_DESCRIPTION']);
193 193
 		
194 194
 	}
195 195
 
@@ -207,9 +207,9 @@  discard block
 block discarded – undo
207 207
 	{
208 208
 		$task = new Task();
209 209
 		
210
-		$expected = array("MAIN"=>"a", "PARENT"=>"a", "CONTACT"=>"a" );
210
+		$expected = array("MAIN"=>"a", "PARENT"=>"a", "CONTACT"=>"a");
211 211
 		$actual = $task->listviewACLHelper();
212
-		$this->assertSame($expected,$actual);
212
+		$this->assertSame($expected, $actual);
213 213
 			
214 214
 	}
215 215
 
Please login to merge, or discard this patch.
tests/tests/modules/OAuthTokens/OAuthTokenTest.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 		//execute the contructor and check for the Object type and  attributes
11 11
 		$oauthToken = new OAuthToken();
12 12
 		
13
-		$this->assertInstanceOf('OAuthToken',$oauthToken);
14
-		$this->assertInstanceOf('SugarBean',$oauthToken);
13
+		$this->assertInstanceOf('OAuthToken', $oauthToken);
14
+		$this->assertInstanceOf('SugarBean', $oauthToken);
15 15
 			
16 16
 		$this->assertAttributeEquals('OAuthTokens', 'module_dir', $oauthToken);
17 17
 		$this->assertAttributeEquals('OAuthToken', 'object_name', $oauthToken);
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 		$oauthToken = new OAuthToken();
30 30
 		$oauthToken->setState();
31 31
 		
32
-		$this->assertEquals( $oauthToken->REQUEST ,$oauthToken->tstate);
32
+		$this->assertEquals($oauthToken->REQUEST, $oauthToken->tstate);
33 33
 		
34 34
 	}
35 35
 
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 		
44 44
 		$oauthToken->setConsumer($oauthKey);
45 45
 		
46
-		$this->assertEquals( $oauthKey->id ,$oauthToken->consumer); 
47
-		$this->assertEquals( $oauthKey ,$oauthToken->consumer_obj); 
46
+		$this->assertEquals($oauthKey->id, $oauthToken->consumer); 
47
+		$this->assertEquals($oauthKey, $oauthToken->consumer_obj); 
48 48
 		
49 49
 	}
50 50
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     	$url = "test url";
57 57
     	$oauthToken->setCallbackURL($url);
58 58
     	
59
-    	$this->assertEquals( $url ,$oauthToken->callback_url );
59
+    	$this->assertEquals($url, $oauthToken->callback_url);
60 60
     	
61 61
     }
62 62
 
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
     	
67 67
     	$result = OAuthToken::generate();
68 68
     	
69
-    	$this->assertInstanceOf('OAuthToken',$result);
70
-    	$this->assertGreaterThan(0,strlen($result->token));
71
-    	$this->assertGreaterThan(0,strlen($result->secret));
69
+    	$this->assertInstanceOf('OAuthToken', $result);
70
+    	$this->assertGreaterThan(0, strlen($result->token));
71
+    	$this->assertGreaterThan(0, strlen($result->secret));
72 72
     	
73 73
     }
74 74
     
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     {
107 107
     	$token = OAuthToken::load($id);
108 108
     	
109
-    	$this->assertInstanceOf('OAuthToken',$token);
109
+    	$this->assertInstanceOf('OAuthToken', $token);
110 110
     	$this->assertTrue(isset($token->id));
111 111
     	
112 112
     }
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
 		
117 117
 		$token->invalidate();
118 118
 		
119
-		$this->assertEquals( $token::INVALID ,$token->tstate);
120
-		$this->assertEquals( false ,$token->verify);
119
+		$this->assertEquals($token::INVALID, $token->tstate);
120
+		$this->assertEquals(false, $token->verify);
121 121
 		
122 122
 	}
123 123
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		$result = $token->authorize("test");
129 129
 		$this->assertEquals(false, $result);
130 130
 
131
-		$token->tstate = $token::REQUEST ;
131
+		$token->tstate = $token::REQUEST;
132 132
 		$result = $token->authorize("test");
133 133
 		
134 134
 		$this->assertEquals("test", $token->authdata);
@@ -164,10 +164,10 @@  discard block
 block discarded – undo
164 164
 		
165 165
 		$oauthToken = OAuthToken::createAuthorized($oauthKey, $user);
166 166
 		
167
-		$this->assertEquals( $oauthKey->id ,$oauthToken->consumer);
168
-		$this->assertEquals( $oauthKey ,$oauthToken->consumer_obj);
169
-		$this->assertEquals( $oauthToken::ACCESS ,$oauthToken->tstate);
170
-		$this->assertEquals( $user->id ,$oauthToken->assigned_user_id);
167
+		$this->assertEquals($oauthKey->id, $oauthToken->consumer);
168
+		$this->assertEquals($oauthKey, $oauthToken->consumer_obj);
169
+		$this->assertEquals($oauthToken::ACCESS, $oauthToken->tstate);
170
+		$this->assertEquals($user->id, $oauthToken->assigned_user_id);
171 171
 		
172 172
 		
173 173
 		//execute copyAuthData method
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
 		$oauthToken = new OAuthToken();
186 186
 		
187 187
 		$oauthToken->copyAuthData($token);
188
-		$this->assertEquals( $token->authdata , $oauthToken->authdata);
189
-		$this->assertEquals( $token->assigned_user_id , $oauthToken->assigned_user_id);
188
+		$this->assertEquals($token->authdata, $oauthToken->authdata);
189
+		$this->assertEquals($token->assigned_user_id, $oauthToken->assigned_user_id);
190 190
 		
191 191
 	}
192 192
 
@@ -196,14 +196,14 @@  discard block
 block discarded – undo
196 196
 		$oauthToken = new OAuthToken();
197 197
 		
198 198
 		$result = $oauthToken->queryString();
199
-		$this->assertEquals("oauth_token=&oauth_token_secret=", $result );
199
+		$this->assertEquals("oauth_token=&oauth_token_secret=", $result);
200 200
 		
201 201
 
202 202
 		//test with attributes set
203 203
 		$oauthToken->token = "toekn";
204 204
 		$oauthToken->secret = "secret";
205 205
 		$result = $oauthToken->queryString();
206
-		$this->assertEquals("oauth_token=toekn&oauth_token_secret=secret", $result );
206
+		$this->assertEquals("oauth_token=toekn&oauth_token_secret=secret", $result);
207 207
 		
208 208
 	}
209 209
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	public function testcheckNonce()
225 225
 	{
226 226
 		$result = OAuthToken::checkNonce("test", "test", 123);
227
-		$this->assertEquals(0, $result );		
227
+		$this->assertEquals(0, $result);		
228 228
 	}
229 229
 
230 230
 
Please login to merge, or discard this patch.
tests/tests/modules/Calls_Reschedule/Calls_RescheduleTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?PHP
2 2
 
3
-class Calls_RescheduleTest extends PHPUnit_Framework_TestCase  {
3
+class Calls_RescheduleTest extends PHPUnit_Framework_TestCase {
4 4
 	
5
-	public function testCalls_Reschedule(){	
5
+	public function testCalls_Reschedule() {	
6 6
 
7 7
 		//execute the contructor and check for the Object type and  attributes
8 8
 		$callsReschedule = new Calls_Reschedule();
9
-		$this->assertInstanceOf('Calls_Reschedule',$callsReschedule);
10
-		$this->assertInstanceOf('Basic',$callsReschedule);
11
-		$this->assertInstanceOf('SugarBean',$callsReschedule);
9
+		$this->assertInstanceOf('Calls_Reschedule', $callsReschedule);
10
+		$this->assertInstanceOf('Basic', $callsReschedule);
11
+		$this->assertInstanceOf('SugarBean', $callsReschedule);
12 12
 			
13 13
 		$this->assertAttributeEquals('Calls_Reschedule', 'module_dir', $callsReschedule);
14 14
 		$this->assertAttributeEquals('Calls_Reschedule', 'object_name', $callsReschedule);
Please login to merge, or discard this patch.