Completed
Push — CI ( ee6bd7...0f01dd )
by Adam
22:32
created
tests/tests/modules/EAPM/EAPMTest.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?PHP
2 2
 
3
-class EAPMTest extends PHPUnit_Framework_TestCase{
3
+class EAPMTest extends PHPUnit_Framework_TestCase {
4 4
 
5 5
 	
6 6
 	public function testEAPM() {
7 7
 	
8 8
 		//execute the contructor and check for the Object type and  attributes
9 9
 		$eapm = new EAPM();
10
-		$this->assertInstanceOf('EAPM',$eapm);
11
-		$this->assertInstanceOf('Basic',$eapm);
12
-		$this->assertInstanceOf('SugarBean',$eapm);
10
+		$this->assertInstanceOf('EAPM', $eapm);
11
+		$this->assertInstanceOf('Basic', $eapm);
12
+		$this->assertInstanceOf('SugarBean', $eapm);
13 13
 			
14 14
 		$this->assertAttributeEquals('EAPM', 'module_dir', $eapm);
15 15
 		$this->assertAttributeEquals('EAPM', 'object_name', $eapm);
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 		
39 39
 		//test with default value/false
40 40
 		$result = $eapm->getLoginInfo('');
41
-		$this->assertEquals(null,$result);
41
+		$this->assertEquals(null, $result);
42 42
 		
43 43
 		
44 44
 		//test with true
45
-		$result = $eapm->getLoginInfo('',true);
46
-		$this->assertEquals(null,$result);
45
+		$result = $eapm->getLoginInfo('', true);
46
+		$this->assertEquals(null, $result);
47 47
 		
48 48
 	}
49 49
 
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 		
54 54
 		//test with empty string params
55 55
 		$expected = " SELECT  eapm.*  , jt0.user_name modified_by_name , jt0.created_by modified_by_name_owner  , 'Users' modified_by_name_mod , jt1.user_name created_by_name , jt1.created_by created_by_name_owner  , 'Users' created_by_name_mod , jt2.user_name assigned_user_name , jt2.created_by assigned_user_name_owner  , 'Users' assigned_user_name_mod FROM eapm   LEFT JOIN  users jt0 ON eapm.modified_user_id=jt0.id AND jt0.deleted=0\n\n AND jt0.deleted=0  LEFT JOIN  users jt1 ON eapm.created_by=jt1.id AND jt1.deleted=0\n\n AND jt1.deleted=0  LEFT JOIN  users jt2 ON eapm.assigned_user_id=jt2.id AND jt2.deleted=0\n\n AND jt2.deleted=0 where ( eapm.assigned_user_id ='' ) AND eapm.deleted=0";
56
-		$actual = $eapm->create_new_list_query('','');
57
-		$this->assertSame($expected,$actual);
56
+		$actual = $eapm->create_new_list_query('', '');
57
+		$this->assertSame($expected, $actual);
58 58
 		
59 59
 		
60 60
 		//test with valid string params
61 61
 		$expected = " SELECT  eapm.*  , jt0.user_name modified_by_name , jt0.created_by modified_by_name_owner  , 'Users' modified_by_name_mod , jt1.user_name created_by_name , jt1.created_by created_by_name_owner  , 'Users' created_by_name_mod , jt2.user_name assigned_user_name , jt2.created_by assigned_user_name_owner  , 'Users' assigned_user_name_mod FROM eapm   LEFT JOIN  users jt0 ON eapm.modified_user_id=jt0.id AND jt0.deleted=0\n\n AND jt0.deleted=0  LEFT JOIN  users jt1 ON eapm.created_by=jt1.id AND jt1.deleted=0\n\n AND jt1.deleted=0  LEFT JOIN  users jt2 ON eapm.assigned_user_id=jt2.id AND jt2.deleted=0\n\n AND jt2.deleted=0 where (eapm.name=\"\" AND  eapm.assigned_user_id ='' ) AND eapm.deleted=0";
62
-		$actual = $eapm->create_new_list_query('eapm.id','eapm.name=""');
63
-		$this->assertSame($expected,$actual);
62
+		$actual = $eapm->create_new_list_query('eapm.id', 'eapm.name=""');
63
+		$this->assertSame($expected, $actual);
64 64
 		
65 65
 	}
66 66
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		$eapm = new EAPM();
70 70
 		
71 71
 		$eapm->name = "test";
72
-		$eapm->url ="test_url";
72
+		$eapm->url = "test_url";
73 73
 		$eapm->application = "webex";
74 74
 
75 75
 		//test validated method initially
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		//mark the record as deleted and verify that this record cannot be retrieved anymore.
97 97
 		$eapm->mark_deleted($eapm->id);
98 98
 		$result = $eapm->retrieve($eapm->id);
99
-		$this->assertEquals(null,$result);
99
+		$this->assertEquals(null, $result);
100 100
 		
101 101
 	}
102 102
 
@@ -138,14 +138,14 @@  discard block
 block discarded – undo
138 138
 		//execute the method and verify attributes are set accordingly
139 139
 		$eapm->save_cleanup();
140 140
 		
141
-		$this->assertEquals("", $eapm->oauth_token );
142
-		$this->assertEquals("", $eapm->oauth_secret );
143
-		$this->assertEquals("", $eapm->api_data );
141
+		$this->assertEquals("", $eapm->oauth_token);
142
+		$this->assertEquals("", $eapm->oauth_secret);
143
+		$this->assertEquals("", $eapm->api_data);
144 144
 
145 145
 	}
146 146
 
147 147
 
148
-	public function testdelete_user_accounts(){
148
+	public function testdelete_user_accounts() {
149 149
 		
150 150
 		$eapm = new EAPM();
151 151
 		
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	public function testgetEAPMExternalApiDropDown() {
165 165
 	
166 166
 		$result = getEAPMExternalApiDropDown();
167
-		$this->assertEquals(array(""=>""),$result);
167
+		$this->assertEquals(array(""=>""), $result);
168 168
 		
169 169
 	}
170 170
 	
Please login to merge, or discard this patch.
tests/tests/modules/Accounts/AccountTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@  discard block
 block discarded – undo
8 8
 		
9 9
 		//execute the contructor and check for the Object type and type attribute
10 10
 		$Account = new Account();
11
-		$this->assertInstanceOf('Account',$Account);
12
-		$this->assertInstanceOf('Company',$Account);
13
-		$this->assertInstanceOf('SugarBean',$Account);
11
+		$this->assertInstanceOf('Account', $Account);
12
+		$this->assertInstanceOf('Company', $Account);
13
+		$this->assertInstanceOf('SugarBean', $Account);
14 14
 		$this->assertTrue(is_array($Account->field_name_map));
15 15
 		$this->assertTrue(is_array($Account->field_defs));
16 16
 		
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
 		//test without name setting attribute
25 25
 		$Account = new Account();
26 26
 		$name = $Account->get_summary_text();
27
-		$this->assertEquals(Null,$name);
27
+		$this->assertEquals(Null, $name);
28 28
 
29 29
 		//test with  name attribute set
30 30
 		$Account->name = "test account";
31 31
 		$name = $Account->get_summary_text();
32
-		$this->assertEquals('test account',$name);
32
+		$this->assertEquals('test account', $name);
33 33
 		
34 34
 	}
35 35
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	public function testget_list_view_data()
110 110
 	{
111 111
 		
112
-		$expected = array (
112
+		$expected = array(
113 113
 			'DELETED' => 0,
114 114
 			'EMAIL1' => '',
115 115
 			'EMAIL1_LINK' => '<a href=\'javascript:void(0);\' onclick=\'SUGAR.quickCompose.init({"fullComposeUrl":"contact_id=\\u0026parent_type=Accounts\\u0026parent_id=\\u0026parent_name=\\u0026to_addrs_ids=\\u0026to_addrs_names=\\u0026to_addrs_emails=\\u0026to_email_addrs=%26nbsp%3B%26lt%3B%26gt%3B\\u0026return_module=Accounts\\u0026return_action=ListView\\u0026return_id=","composePackage":{"contact_id":"","parent_type":"Accounts","parent_id":"","parent_name":"","to_addrs_ids":"","to_addrs_names":"","to_addrs_emails":"","to_email_addrs":" \\u003C\\u003E","return_module":"Accounts","return_action":"ListView","return_id":""}});\' class=\'\'>',
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	}
129 129
 
130 130
 	
131
-	public function testbuild_generic_where_clause () 
131
+	public function testbuild_generic_where_clause() 
132 132
 	{
133 133
 		$Account = new Account();
134 134
 		
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     	
159 159
     	//execute the method with valid parameter values and verify that it retunrs expected results
160 160
     	$expected = "SELECT\n                                accounts.*,\n                                email_addresses.email_address email_address,\n                                '' email_addresses_non_primary, accounts.name as account_name,\n                                users.user_name as assigned_user_name  FROM accounts LEFT JOIN users\n	                                ON accounts.assigned_user_id=users.id  LEFT JOIN  email_addr_bean_rel on accounts.id = email_addr_bean_rel.bean_id and email_addr_bean_rel.bean_module='Accounts' and email_addr_bean_rel.deleted=0 and email_addr_bean_rel.primary_address=1  LEFT JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id where (name not null) AND ( accounts.deleted IS NULL OR accounts.deleted=0 ) ORDER BY accounts.name";
161
-    	$actual = $Account->create_export_query('name','name not null');
161
+    	$actual = $Account->create_export_query('name', 'name not null');
162 162
     	$this->assertSame($expected, $actual);
163 163
     	
164 164
     }
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 		$Account = new Account();
170 170
 
171 171
 		//execute the method and test if populates provided sugar_smarty
172
-		$result = $Account->set_notification_body(new Sugar_Smarty(),new Account());
173
-		$this->assertInstanceOf('Sugar_Smarty',$result);
172
+		$result = $Account->set_notification_body(new Sugar_Smarty(), new Account());
173
+		$this->assertInstanceOf('Sugar_Smarty', $result);
174 174
 		$this->assertNotEquals(new Sugar_Smarty(), $result);	
175 175
 		
176 176
 	}
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		
183 183
 		$this->assertTrue($Account->bean_implements('ACL')); //test with valid value
184 184
 		$this->assertFalse($Account->bean_implements('')); //test with empty value
185
-		$this->assertFalse($Account->bean_implements('Basic'));//test with invalid value
185
+		$this->assertFalse($Account->bean_implements('Basic')); //test with invalid value
186 186
 	
187 187
 	}
188 188
 
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 		
201 201
 		
202 202
 		//with type parameter set
203
-		$expected = array ('select' => 'SELECT emails.id ',
203
+		$expected = array('select' => 'SELECT emails.id ',
204 204
 						   'from' => 'FROM emails ',
205 205
 						   'where' => '',
206 206
 						   'join' => " 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 = 'Accounts' 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 ='Accounts' and eb.bean_id = '')\n	) derivedemails on derivedemails.email_id = emails.id",
207
-						  'join_tables' => array (''),
207
+						  'join_tables' => array(''),
208 208
 					);
209 209
 		
210 210
 		$actual = $Account->get_unlinked_email_query(array('return_as_array'=>'true'));	
Please login to merge, or discard this patch.
tests/tests/modules/AOS_Invoices/AOS_InvoicesTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@  discard block
 block discarded – undo
3 3
 class AOS_InvoicesTest extends PHPUnit_Framework_TestCase {
4 4
 	
5 5
 	
6
-	public function testAOS_Invoices(){	
6
+	public function testAOS_Invoices() {	
7 7
 
8 8
 		//execute the contructor and check for the Object type and  attributes
9 9
 		$aosInvoices = new AOS_Invoices();
10
-		$this->assertInstanceOf('AOS_Invoices',$aosInvoices);
11
-		$this->assertInstanceOf('Basic',$aosInvoices);
12
-		$this->assertInstanceOf('SugarBean',$aosInvoices);
10
+		$this->assertInstanceOf('AOS_Invoices', $aosInvoices);
11
+		$this->assertInstanceOf('Basic', $aosInvoices);
12
+		$this->assertInstanceOf('SugarBean', $aosInvoices);
13 13
 			
14 14
 		$this->assertAttributeEquals('AOS_Invoices', 'module_dir', $aosInvoices);
15 15
 		$this->assertAttributeEquals('AOS_Invoices', 'object_name', $aosInvoices);
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 				
21 21
 	}
22 22
 
23
-    public function testSaveAndMark_deleted(){
23
+    public function testSaveAndMark_deleted() {
24 24
 
25 25
     	error_reporting(E_ERROR | E_PARSE);
26 26
     	
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     	//mark the record as deleted and verify that this record cannot be retrieved anymore.
39 39
     	$aosInvoices->mark_deleted($aosInvoices->id);
40 40
     	$result = $aosInvoices->retrieve($aosInvoices->id);
41
-    	$this->assertEquals(null,$result);
41
+    	$this->assertEquals(null, $result);
42 42
     	
43 43
     	
44 44
     }
Please login to merge, or discard this patch.
tests/tests/modules/Users/UserTest.php 1 patch
Spacing   +55 added lines, -55 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
 		$user = new User();
11 11
 		
12
-		$this->assertInstanceOf('User',$user);
13
-		$this->assertInstanceOf('Person',$user);
14
-		$this->assertInstanceOf('SugarBean',$user);
12
+		$this->assertInstanceOf('User', $user);
13
+		$this->assertInstanceOf('Person', $user);
14
+		$this->assertInstanceOf('SugarBean', $user);
15 15
 			
16 16
 		$this->assertAttributeEquals('Users', 'module_dir', $user);
17 17
 		$this->assertAttributeEquals('User', 'object_name', $user);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     	
37 37
     	$result = $user->getSystemUser();
38 38
     	
39
-    	$this->assertInstanceOf('User',$result);
39
+    	$this->assertInstanceOf('User', $result);
40 40
     	$this->assertEquals(1, $result->id);
41 41
     	
42 42
     }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		$user->retrieve(1);
67 67
 		
68 68
 		$result = $user->getSignature(1);
69
-		$this->assertEquals(false,$result);
69
+		$this->assertEquals(false, $result);
70 70
 		
71 71
 	}
72 72
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		
117 117
 		//test with defaultDisplay true
118 118
 		$expected = "<input class='button' onclick='javascript:open_email_signature_form(\"\", \"1\");' value='' type='button'>&nbsp;<span name=\"edit_sig\" id=\"edit_sig\" style=\"visibility:inherit;\"><input class=\"button\" onclick=\"javascript:open_email_signature_form(document.getElementById('signature_id', '').value)\" value=\"\" type=\"button\" tabindex=\"392\">&nbsp;\n					</span>";
119
-		$actual = $user->getSignatureButtons('',true);
119
+		$actual = $user->getSignatureButtons('', true);
120 120
 		$this->assertSame($expected, $actual);
121 121
 
122 122
 	}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		$user->retrieve(2);
131 131
 		
132 132
 		$result = $user->hasPersonalEmail(); 
133
-		$this->assertEquals(false,$result);
133
+		$this->assertEquals(false, $result);
134 134
 		
135 135
 	}
136 136
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	}
286 286
 
287 287
 
288
-    public function testGetETagSeedAndIncrementETag(){
288
+    public function testGetETagSeedAndIncrementETag() {
289 289
     	
290 290
     	//unset and reconnect Db to resolve mysqli fetch exeception
291 291
     	global $db;
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     	
299 299
     	//execute getETagSeed method, get Etag value
300 300
     	$ETagInitial = $user->getETagSeed('test');
301
-    	$this->assertGreaterThanOrEqual(0,$ETagInitial);
301
+    	$this->assertGreaterThanOrEqual(0, $ETagInitial);
302 302
     	
303 303
     	
304 304
     	//execute incrementETag to increment
@@ -326,11 +326,11 @@  discard block
 block discarded – undo
326 326
     	$user = new User();
327 327
     	
328 328
     	//test without setting name
329
-    	$this->assertEquals(Null,$user->get_summary_text());
329
+    	$this->assertEquals(Null, $user->get_summary_text());
330 330
     	
331 331
     	//test with name set
332 332
     	$user->name = "test";
333
-    	$this->assertEquals('test',$user->get_summary_text());
333
+    	$this->assertEquals('test', $user->get_summary_text());
334 334
     	
335 335
 	}
336 336
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 		
378 378
 		$user->user_name  = "test";
379 379
 		
380
-		$user->first_name  = "firstn";
380
+		$user->first_name = "firstn";
381 381
 		$user->last_name  = "lastn";
382 382
 		
383 383
 		$user->email1 = "[email protected]";
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 		
428 428
 		
429 429
 		//change username and delete the user to avoid picking it up by password in future  
430
-		$user->user_name  = "test_deleted";
430
+		$user->user_name = "test_deleted";
431 431
 		$user->save();
432 432
 		$user->mark_deleted($user->id);
433 433
 		
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 		//set user password and then retrieve user by created password 
475 475
 		$user->setNewPassword("test");
476 476
 	
477
-		$result = User::findUserPassword("test",md5("test"));
477
+		$result = User::findUserPassword("test", md5("test"));
478 478
 		
479 479
 		$this->assertTrue(isset($result['id']));
480 480
 		$this->assertEquals($id, $result['id']);
@@ -490,11 +490,11 @@  discard block
 block discarded – undo
490 490
 		
491 491
 		//test with invalid password
492 492
 		$result = $user->authenticate_user(md5("pass"));
493
-		$this->assertEquals(false ,$result);
493
+		$this->assertEquals(false, $result);
494 494
 		
495 495
 		//test with invalid password
496 496
 		$result = $user->authenticate_user(md5("test"));
497
-		$this->assertEquals(true ,$result);
497
+		$this->assertEquals(true, $result);
498 498
 		
499 499
 	}
500 500
 
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 		
524 524
 		
525 525
 		//find the user by new password
526
-		$result = User::findUserPassword("test",md5("testpass"));
526
+		$result = User::findUserPassword("test", md5("testpass"));
527 527
 		
528 528
 		$this->assertTrue(isset($result['id']));
529 529
 		$this->assertEquals($id, $result['id']);
@@ -536,11 +536,11 @@  discard block
 block discarded – undo
536 536
 		
537 537
 		$user->retrieve($id);
538 538
 		
539
-		$expected = array("name"=>"firstn lastn", "email"=>"[email protected]" );
539
+		$expected = array("name"=>"firstn lastn", "email"=>"[email protected]");
540 540
 		
541 541
 		$actual = $user->getPreferredEmail();
542 542
 		
543
-		$this->assertSame($actual,$expected);
543
+		$this->assertSame($actual, $expected);
544 544
 		
545 545
 	}
546 546
 	
@@ -550,11 +550,11 @@  discard block
 block discarded – undo
550 550
 		
551 551
 		$user->retrieve($id);
552 552
 		
553
-		$expected = array("name"=>"firstn lastn", "email"=>"[email protected]" );
553
+		$expected = array("name"=>"firstn lastn", "email"=>"[email protected]");
554 554
 		
555 555
 		$actual = $user->getUsersNameAndEmail();
556 556
 		
557
-		$this->assertEquals($actual,$expected);
557
+		$this->assertEquals($actual, $expected);
558 558
 	}
559 559
 
560 560
 	
@@ -562,11 +562,11 @@  discard block
 block discarded – undo
562 562
 	{
563 563
 		$user = new User();
564 564
 				
565
-		$expected = array("name"=>"firstn lastn", "email"=>"[email protected]" );
565
+		$expected = array("name"=>"firstn lastn", "email"=>"[email protected]");
566 566
 		
567 567
 		$actual = $user->getEmailInfo($id);
568 568
 		
569
-		$this->assertEquals($actual,$expected);
569
+		$this->assertEquals($actual, $expected);
570 570
 	}
571 571
 
572 572
 	
@@ -576,17 +576,17 @@  discard block
 block discarded – undo
576 576
 		
577 577
 		$result = $user->encrypt_password("test");
578 578
 		$this->assertTrue(isset($result));
579
-		$this->assertGreaterThan(0,strlen($result));
579
+		$this->assertGreaterThan(0, strlen($result));
580 580
 		
581 581
 	}
582 582
 
583 583
 	public function testgetPasswordHash()
584 584
 	{
585 585
 
586
-		$result= User::getPasswordHash("test");
586
+		$result = User::getPasswordHash("test");
587 587
 		
588 588
 		$this->assertTrue(isset($result));
589
-		$this->assertGreaterThan(0,strlen($result));
589
+		$this->assertGreaterThan(0, strlen($result));
590 590
 		
591 591
 		$this->markTestIncomplete('Error: crypt(): No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash.');
592 592
 		
@@ -598,22 +598,22 @@  discard block
 block discarded – undo
598 598
 		
599 599
 		//test with empty password and empty hash
600 600
 		$result = User::checkPassword("", '');
601
-		$this->assertEquals(false,$result);
601
+		$this->assertEquals(false, $result);
602 602
 		
603 603
 		
604 604
 		//test with valid hash and empty password
605 605
 		$result = User::checkPassword("", '$1$Gt0.XI4.$tVVSXgE36sfsVMBNo/9la1');
606
-		$this->assertEquals(false,$result);
606
+		$this->assertEquals(false, $result);
607 607
 		
608 608
 		
609 609
 		//test with valid password and invalid hash
610 610
 		$result = User::checkPassword("test", '$1$Gt0.XI4.$tVVSXgE36sfsVMBNo/9la2');
611
-		$this->assertEquals(false,$result);
611
+		$this->assertEquals(false, $result);
612 612
 		
613 613
 		
614 614
 		//test with valid password and valid hash
615 615
 		$result = User::checkPassword("test", '$1$Gt0.XI4.$tVVSXgE36sfsVMBNo/9la1');
616
-		$this->assertEquals(true,$result);
616
+		$this->assertEquals(true, $result);
617 617
 		
618 618
 	}
619 619
 
@@ -623,22 +623,22 @@  discard block
 block discarded – undo
623 623
 
624 624
 		//test with empty password and empty hash
625 625
 		$result = User::checkPasswordMD5(md5(""), '');
626
-		$this->assertEquals(false,$result);
626
+		$this->assertEquals(false, $result);
627 627
 
628 628
 		
629 629
 		//test with valid hash and empty password
630 630
 		$result = User::checkPasswordMD5(md5(""), '$1$Gt0.XI4.$tVVSXgE36sfsVMBNo/9la1');
631
-		$this->assertEquals(false,$result);		
631
+		$this->assertEquals(false, $result);		
632 632
 		
633 633
 		
634 634
 		//test with valid password and invalid hash
635 635
 		$result = User::checkPasswordMD5(md5("test"), '$1$Gt0.XI4.$tVVSXgE36sfsVMBNo/9la2');
636
-		$this->assertEquals(false,$result);
636
+		$this->assertEquals(false, $result);
637 637
 		
638 638
 		
639 639
 		//test with valid password and valid hash
640 640
 		$result = User::checkPasswordMD5(md5("test"), '$1$Gt0.XI4.$tVVSXgE36sfsVMBNo/9la1');
641
-		$this->assertEquals(true,$result);
641
+		$this->assertEquals(true, $result);
642 642
 		
643 643
 	}
644 644
 
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 		 
654 654
 		//test with name set
655 655
 		$user->authenticated = true;
656
-		$this->assertEquals(true,$user->is_authenticated());
656
+		$this->assertEquals(true, $user->is_authenticated());
657 657
 		
658 658
 	}
659 659
 
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
 		
667 667
 		$user->fill_in_additional_list_fields();
668 668
 		
669
-		$this->assertEquals("Administrator",$user->full_name);
669
+		$this->assertEquals("Administrator", $user->full_name);
670 670
 		
671 671
 	}
672 672
 
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 		
680 680
 		$user->fill_in_additional_detail_fields();
681 681
 		
682
-		$this->assertEquals("Administrator",$user->full_name);
682
+		$this->assertEquals("Administrator", $user->full_name);
683 683
 			
684 684
 	}
685 685
 
@@ -758,14 +758,14 @@  discard block
 block discarded – undo
758 758
 		
759 759
     	//test with empty string params
760 760
     	$expected = "SELECT id, user_name, first_name, last_name, description, date_entered, date_modified, modified_user_id, created_by, title, department, is_admin, phone_home, phone_mobile, phone_work, phone_other, phone_fax, address_street, address_city, address_state, address_postalcode, address_country, reports_to_id, portal_only, status, receive_notifications, employee_status, messenger_id, messenger_type, is_group FROM users  WHERE  users.deleted = 0 AND users.is_admin=0 ORDER BY users.user_name";
761
-    	$actual = $user->create_export_query('','');
762
-    	$this->assertSame($expected,$actual);
761
+    	$actual = $user->create_export_query('', '');
762
+    	$this->assertSame($expected, $actual);
763 763
     	
764 764
     		
765 765
     	//test with valid string params
766 766
     	$expected = "SELECT id, user_name, first_name, last_name, description, date_entered, date_modified, modified_user_id, created_by, title, department, is_admin, phone_home, phone_mobile, phone_work, phone_other, phone_fax, address_street, address_city, address_state, address_postalcode, address_country, reports_to_id, portal_only, status, receive_notifications, employee_status, messenger_id, messenger_type, is_group FROM users  WHERE user_name=\"\" AND  users.deleted = 0 AND users.is_admin=0 ORDER BY id";
767
-    	$actual = $user->create_export_query('id','user_name=""');
768
-    	$this->assertSame($expected,$actual);
767
+    	$actual = $user->create_export_query('id', 'user_name=""');
768
+    	$this->assertSame($expected, $actual);
769 769
 	
770 770
 	}
771 771
 
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 		$renderedContent = ob_get_contents();
812 812
 		ob_end_clean();
813 813
 		
814
-		$this->assertSame($expected,$renderedContent);
814
+		$this->assertSame($expected, $renderedContent);
815 815
 		
816 816
 	}
817 817
 
@@ -821,9 +821,9 @@  discard block
 block discarded – undo
821 821
 				
822 822
 		$user = new User();
823 823
 		
824
-		$expected = array( 'email' => '[email protected]', 'name' => 'SuiteCRM');
824
+		$expected = array('email' => '[email protected]', 'name' => 'SuiteCRM');
825 825
 		$actual = $user->getSystemDefaultNameAndEmail();		
826
-		$this->assertSame($expected,$actual);
826
+		$this->assertSame($expected, $actual);
827 827
 		
828 828
 	} 
829 829
 
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 		
855 855
 		$expected = "<a href='javascript:void(0);' onclick='SUGAR.quickCompose.init({\"fullComposeUrl\":\"contact_id=\u0026parent_type=Accounts\u0026parent_id=\u0026parent_name=test\u0026to_addrs_ids=\u0026to_addrs_names=\u0026to_addrs_emails=\u0026to_email_addrs=test%26nbsp%3B%26lt%3Babc%40email.com%26gt%3B\u0026return_module=Accounts\u0026return_action=DetailView\u0026return_id=\",\"composePackage\":{\"contact_id\":\"\",\"parent_type\":\"Accounts\",\"parent_id\":\"\",\"parent_name\":\"test\",\"to_addrs_ids\":\"\",\"to_addrs_names\":\"\",\"to_addrs_emails\":\"\",\"to_email_addrs\":\"test \[email protected]\u003E\",\"return_module\":\"Accounts\",\"return_action\":\"DetailView\",\"return_id\":\"\"}});' class=''>";
856 856
 		$actual = $user->getEmailLink2("[email protected]", $account);
857
-		$this->assertSame($expected,$actual);
857
+		$this->assertSame($expected, $actual);
858 858
 		
859 859
 
860 860
 		//test with contacts module
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 		
864 864
 		$expected = "<a href='javascript:void(0);' onclick='SUGAR.quickCompose.init({\"fullComposeUrl\":\"contact_id=\u0026parent_type=Contacts\u0026parent_id=\u0026parent_name=+\u0026to_addrs_ids=\u0026to_addrs_names=+\u0026to_addrs_emails=\u0026to_email_addrs=+%26nbsp%3B%26lt%3Babc%40email.com%26gt%3B\u0026return_module=Contacts\u0026return_action=DetailView\u0026return_id=\",\"composePackage\":{\"contact_id\":\"\",\"parent_type\":\"Contacts\",\"parent_id\":\"\",\"parent_name\":\" \",\"to_addrs_ids\":\"\",\"to_addrs_names\":\" \",\"to_addrs_emails\":\"\",\"to_email_addrs\":\"  \[email protected]\u003E\",\"return_module\":\"Contacts\",\"return_action\":\"DetailView\",\"return_id\":\"\"}});' class=''>";
865 865
 		$actual = $user->getEmailLink2("[email protected]", $contact);
866
-		$this->assertSame($expected,$actual);
866
+		$this->assertSame($expected, $actual);
867 867
 		
868 868
 	}
869 869
 
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
 		
883 883
 		$expected = "<a href='javascript:void(0);' onclick='SUGAR.quickCompose.init({\"fullComposeUrl\":\"contact_id=\u0026parent_type=Accounts\u0026parent_id=\u0026parent_name=test\u0026to_addrs_ids=\u0026to_addrs_names=\u0026to_addrs_emails=\u0026to_email_addrs=test%26nbsp%3B%26lt%3Btest%26gt%3B\u0026return_module=Accounts\u0026return_action=DetailView\u0026return_id=\",\"composePackage\":{\"contact_id\":\"\",\"parent_type\":\"Accounts\",\"parent_id\":\"\",\"parent_name\":\"test\",\"to_addrs_ids\":\"\",\"to_addrs_names\":\"\",\"to_addrs_emails\":\"\",\"to_email_addrs\":\"test \u003Ctest\u003E\",\"return_module\":\"Accounts\",\"return_action\":\"DetailView\",\"return_id\":\"\"}});' class=''>";
884 884
 		$actual = $user->getEmailLink("name", $account);
885
-		$this->assertSame($expected,$actual);
885
+		$this->assertSame($expected, $actual);
886 886
 		
887 887
 			
888 888
 		//test with contacts module
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
 		
892 892
 		$expected = "<a href='javascript:void(0);' onclick='SUGAR.quickCompose.init({\"fullComposeUrl\":\"contact_id=\u0026parent_type=Contacts\u0026parent_id=\u0026parent_name=+\u0026to_addrs_ids=\u0026to_addrs_names=+\u0026to_addrs_emails=\u0026to_email_addrs=+%26nbsp%3B%26lt%3Btest%26gt%3B\u0026return_module=Contacts\u0026return_action=DetailView\u0026return_id=\",\"composePackage\":{\"contact_id\":\"\",\"parent_type\":\"Contacts\",\"parent_id\":\"\",\"parent_name\":\" \",\"to_addrs_ids\":\"\",\"to_addrs_names\":\" \",\"to_addrs_emails\":\"\",\"to_email_addrs\":\"  \u003Ctest\u003E\",\"return_module\":\"Contacts\",\"return_action\":\"DetailView\",\"return_id\":\"\"}});' class=''>";
893 893
 		$actual = $user->getEmailLink("name", $contact);
894
-		$this->assertSame($expected,$actual);
894
+		$this->assertSame($expected, $actual);
895 895
 			
896 896
 	}
897 897
 
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 		
902 902
 		$result = $user->getLocaleFormatDesc();
903 903
 		$this->assertTrue(isset($result));
904
-		$this->assertGreaterThan(0,strlen($result));
904
+		$this->assertGreaterThan(0, strlen($result));
905 905
 		
906 906
 	}
907 907
 
@@ -1035,14 +1035,14 @@  discard block
 block discarded – undo
1035 1035
 	   	
1036 1036
 	   	//test with empty string params
1037 1037
 	   	$expected = " SELECT  users.* , '                                                                                                                                                                                                                                                              ' c_accept_status_fields , '                                    '  call_id , '                                                                                                                                                                                                                                                              ' securitygroup_noninher_fields , '                                    '  securitygroup_id , LTRIM(RTRIM(CONCAT(IFNULL(users.first_name,''),' ',IFNULL(users.last_name,'')))) as full_name, LTRIM(RTRIM(CONCAT(IFNULL(users.first_name,''),' ',IFNULL(users.last_name,'')))) as name , jt2.last_name reports_to_name , jt2.created_by reports_to_name_owner  , 'Users' reports_to_name_mod, '                                                                                                                                                                                                                                                              ' m_accept_status_fields , '                                    '  meeting_id  FROM users   LEFT JOIN  users jt2 ON users.reports_to_id=jt2.id AND jt2.deleted=0\n\n AND jt2.deleted=0 where users.deleted=0";
1038
-	   	$actual = $user->create_new_list_query('','');
1039
-	   	$this->assertSame($expected,$actual);
1038
+	   	$actual = $user->create_new_list_query('', '');
1039
+	   	$this->assertSame($expected, $actual);
1040 1040
 
1041 1041
 	   	
1042 1042
 	   	//test with valid string params
1043 1043
 	   	$expected = " SELECT  users.* , '                                                                                                                                                                                                                                                              ' c_accept_status_fields , '                                    '  call_id , '                                                                                                                                                                                                                                                              ' securitygroup_noninher_fields , '                                    '  securitygroup_id , LTRIM(RTRIM(CONCAT(IFNULL(users.first_name,''),' ',IFNULL(users.last_name,'')))) as full_name, LTRIM(RTRIM(CONCAT(IFNULL(users.first_name,''),' ',IFNULL(users.last_name,'')))) as name , jt2.last_name reports_to_name , jt2.created_by reports_to_name_owner  , 'Users' reports_to_name_mod, '                                                                                                                                                                                                                                                              ' m_accept_status_fields , '                                    '  meeting_id  FROM users   LEFT JOIN  users jt2 ON users.reports_to_id=jt2.id AND jt2.deleted=0\n\n AND jt2.deleted=0 where (user_name=\"\") AND users.deleted=0 ORDER BY users.id";
1044
-	   	$actual = $user->create_new_list_query('id','user_name=""');
1045
-	   	$this->assertSame($expected,$actual);
1044
+	   	$actual = $user->create_new_list_query('id', 'user_name=""');
1045
+	   	$this->assertSame($expected, $actual);
1046 1046
    	
1047 1047
    }
1048 1048
 
@@ -1062,10 +1062,10 @@  discard block
 block discarded – undo
1062 1062
     	//generate apsswords and verify they are not same
1063 1063
     	
1064 1064
     	$password1 = User::generatePassword();
1065
-    	$this->assertGreaterThan(0,strlen($password1));
1065
+    	$this->assertGreaterThan(0, strlen($password1));
1066 1066
     	
1067 1067
     	$password2 = User::generatePassword();
1068
-    	$this->assertGreaterThan(0,strlen($password2));
1068
+    	$this->assertGreaterThan(0, strlen($password2));
1069 1069
     	
1070 1070
     	$this->assertNotEquals($password1, $password2);
1071 1071
     	
Please login to merge, or discard this patch.
tests/tests/modules/Versions/VersionTest.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 		//execute the contructor and check for the Object type and  attributes
12 12
 		$version = new Version();
13 13
 			
14
-		$this->assertInstanceOf('Version',$version);
15
-		$this->assertInstanceOf('SugarBean',$version);
14
+		$this->assertInstanceOf('Version', $version);
15
+		$this->assertInstanceOf('SugarBean', $version);
16 16
 		
17 17
 		$this->assertAttributeEquals('versions', 'table_name', $version);
18 18
 		$this->assertAttributeEquals('Versions', 'module_dir', $version);
@@ -29,42 +29,42 @@  discard block
 block discarded – undo
29 29
 		//test with empty string params
30 30
 		$expected = "name like '%'";
31 31
 		$actual = $version->build_generic_where_clause('');
32
-		$this->assertSame($expected,$actual);
32
+		$this->assertSame($expected, $actual);
33 33
 		
34 34
 			
35 35
 		//test with valid string params
36 36
 		$expected = "name like 'test%'";
37 37
 		$actual = $version->build_generic_where_clause('test');
38
-		$this->assertSame($expected,$actual);
38
+		$this->assertSame($expected, $actual);
39 39
 		
40 40
 		
41 41
 	}
42 42
 	
43
-	public function testis_expected_version(){
43
+	public function testis_expected_version() {
44 44
 	
45 45
 		$version = new Version();
46 46
 		
47 47
 		//test without setting attributes
48
-		$actual = $version->is_expected_version(array("file_version"=>"1","db_version"=>"2"));
49
-		$this->assertEquals(false,$actual);
48
+		$actual = $version->is_expected_version(array("file_version"=>"1", "db_version"=>"2"));
49
+		$this->assertEquals(false, $actual);
50 50
 		
51 51
 		
52 52
 		//test with attributes set to on matching values
53 53
 		$version->file_version = "2";
54 54
 		$version->db_version = "2";
55
-		$actual = $version->is_expected_version(array("file_version"=>"1","db_version"=>"2"));
56
-		$this->assertEquals(false,$actual);
55
+		$actual = $version->is_expected_version(array("file_version"=>"1", "db_version"=>"2"));
56
+		$this->assertEquals(false, $actual);
57 57
 		
58 58
 			
59 59
 		//test with valid param
60 60
 		$version->file_version = "1";
61 61
 		$version->db_version = "2";
62
-		$actual = $version->is_expected_version(array("file_version"=>"1","db_version"=>"2"));
63
-		$this->assertEquals(true,$actual);
62
+		$actual = $version->is_expected_version(array("file_version"=>"1", "db_version"=>"2"));
63
+		$this->assertEquals(true, $actual);
64 64
 	
65 65
 	}
66 66
 	
67
-	public function testmark_upgraded(){
67
+	public function testmark_upgraded() {
68 68
 	
69 69
 		$version = new Version();
70 70
 		
@@ -80,18 +80,18 @@  discard block
 block discarded – undo
80 80
 		//mark the record as deleted and verify that this record cannot be retrieved anymore.
81 81
 		$version->mark_deleted($version->id);
82 82
 		$result = $version->retrieve($version->id);
83
-		$this->assertEquals(null,$result);
83
+		$this->assertEquals(null, $result);
84 84
 		
85 85
 	}
86 86
 	
87
-	public function testget_profile(){
87
+	public function testget_profile() {
88 88
 	
89 89
 		$version = new Version();
90 90
 
91 91
 		//test without setting attributes
92 92
 		$expected = array('name'=> null, 'file_version'=> null, 'db_version'=>null);
93 93
 		$actual = $version->get_profile();
94
-		$this->assertSame($expected,$actual);
94
+		$this->assertSame($expected, $actual);
95 95
 		
96 96
 		
97 97
 		//test with attributes set
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		
102 102
 		$expected = array('name'=> 'test', 'file_version'=> 1, 'db_version'=>1);
103 103
 		$actual = $version->get_profile();
104
-		$this->assertSame($expected,$actual);
104
+		$this->assertSame($expected, $actual);
105 105
 		
106 106
 	}
107 107
 
Please login to merge, or discard this patch.
tests/tests/modules/Bugs/BugTest.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 	{
9 9
 		//execute the contructor and check for the Object type and  attributes
10 10
 		$bug = new Bug();
11
-		$this->assertInstanceOf('Bug',$bug);
12
-		$this->assertInstanceOf('SugarBean',$bug);
11
+		$this->assertInstanceOf('Bug', $bug);
12
+		$this->assertInstanceOf('SugarBean', $bug);
13 13
 			
14 14
 		$this->assertAttributeEquals('Bugs', 'module_dir', $bug);
15 15
 		$this->assertAttributeEquals('Bug', 'object_name', $bug);
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 		$bug = new Bug();
30 30
 		
31 31
 		//test without setting name
32
-		$this->assertEquals(Null,$bug->get_summary_text());
32
+		$this->assertEquals(Null, $bug->get_summary_text());
33 33
 		
34 34
 		//test with name set//test with name set
35 35
 		$bug->name = "test";
36
-		$this->assertEquals('test',$bug->get_summary_text());
36
+		$this->assertEquals('test', $bug->get_summary_text());
37 37
 		
38 38
 	}
39 39
 
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
 		
44 44
 		//test with empty string params
45 45
 		$expected = "SELECT \n                               bugs.*\n\n                                ,users.user_name as assigned_user_name, releases.id release_id, releases.name release_name FROM bugs 				LEFT JOIN releases ON bugs.found_in_release=releases.id\n								LEFT JOIN users\n                                ON bugs.assigned_user_id=users.id  where  bugs.deleted=0  ORDER BY bugs.name";
46
-		$actual = $bug->create_list_query('','');
47
-		$this->assertSame($expected,$actual);
46
+		$actual = $bug->create_list_query('', '');
47
+		$this->assertSame($expected, $actual);
48 48
 	
49 49
 	
50 50
 		//test with valid string params
51 51
 		$expected = "SELECT \n                               bugs.*\n\n                                ,users.user_name as assigned_user_name, releases.id release_id, releases.name release_name FROM bugs 				LEFT JOIN releases ON bugs.found_in_release=releases.id\n								LEFT JOIN users\n                                ON bugs.assigned_user_id=users.id  where bugs.name=\"\" AND  bugs.deleted=0  ORDER BY releases.id";
52
-		$actual = $bug->create_list_query('releases.id','bugs.name=""');
53
-		$this->assertSame($expected,$actual);
52
+		$actual = $bug->create_list_query('releases.id', 'bugs.name=""');
53
+		$this->assertSame($expected, $actual);
54 54
 		
55 55
 	}
56 56
 
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 		
61 61
 		//test with empty string params
62 62
 		$expected = "SELECT\n                                bugs.*,\n                                r1.name found_in_release_name,\n                                r2.name fixed_in_release_name,\n                                users.user_name assigned_user_name FROM bugs 				LEFT JOIN releases r1 ON bugs.found_in_release = r1.id\n								LEFT JOIN releases r2 ON bugs.fixed_in_release = r2.id\n								LEFT JOIN users\n                                ON bugs.assigned_user_id=users.id where   bugs.deleted=0\n                 ORDER BY bugs.bug_number";		
63
-		$actual = $bug->create_export_query('','');
64
-		$this->assertSame($expected,$actual);
63
+		$actual = $bug->create_export_query('', '');
64
+		$this->assertSame($expected, $actual);
65 65
 
66 66
 		
67 67
 		//test with valid string params
68 68
 		$expected = "SELECT\n                                bugs.*,\n                                r1.name found_in_release_name,\n                                r2.name fixed_in_release_name,\n                                users.user_name assigned_user_name FROM bugs 				LEFT JOIN releases r1 ON bugs.found_in_release = r1.id\n								LEFT JOIN releases r2 ON bugs.fixed_in_release = r2.id\n								LEFT JOIN users\n                                ON bugs.assigned_user_id=users.id where bugs.name=\"\" AND   bugs.deleted=0\n                 ORDER BY releases.id";
69
-		$actual = $bug->create_export_query('releases.id','bugs.name=""');
70
-		$this->assertSame($expected,$actual);
69
+		$actual = $bug->create_export_query('releases.id', 'bugs.name=""');
70
+		$this->assertSame($expected, $actual);
71 71
 		
72 72
 		
73 73
 		
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 		
116 116
 		$bug->set_release();
117 117
 		
118
-		$this->assertEquals("",$bug->release_name);		
118
+		$this->assertEquals("", $bug->release_name);		
119 119
 		
120 120
 	}
121 121
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		
129 129
 		$bug->set_release();
130 130
 		
131
-		$this->assertEquals("",$bug->fixed_in_release_name);	
131
+		$this->assertEquals("", $bug->fixed_in_release_name);	
132 132
 	}
133 133
 	
134 134
 	
@@ -149,25 +149,25 @@  discard block
 block discarded – undo
149 149
 		);
150 150
 		
151 151
 		$actual = $bug->get_list_view_data();
152
-		$this->assertSame($expected,$actual);
152
+		$this->assertSame($expected, $actual);
153 153
 				
154 154
 	}
155 155
 
156 156
 
157
-	public function testbuild_generic_where_clause () 
157
+	public function testbuild_generic_where_clause() 
158 158
 	{
159 159
 		$bug = new Bug();
160 160
 		
161 161
 		//execute with blank parameters
162 162
 		$expected = "bugs.name like '%'";
163
-		$actual = $bug->build_generic_where_clause ("");
164
-		$this->assertSame($expected,$actual);
163
+		$actual = $bug->build_generic_where_clause("");
164
+		$this->assertSame($expected, $actual);
165 165
 		
166 166
 		
167 167
 		//execute with numeric parameter
168 168
 		$expected = "bugs.name like '1%' or bugs.bug_number like '1%'";
169 169
 		$actual = $bug->build_generic_where_clause(1);
170
-		$this->assertSame($expected,$actual);
170
+		$this->assertSame($expected, $actual);
171 171
 				
172 172
 	}
173 173
 
@@ -181,17 +181,17 @@  discard block
 block discarded – undo
181 181
 		$bug->priority = "Urgent";
182 182
 		$bug->status = "New";
183 183
 		$bug->resolution = "Accepted";
184
-		$bug->bug_number ="1";
184
+		$bug->bug_number = "1";
185 185
 
186 186
 		//test with attributes preset and verify template variables are set accordingly
187 187
 		$result = $bug->set_notification_body(new Sugar_Smarty(), $bug);
188 188
 		
189
-		$this->assertEquals($bug->name ,$result->_tpl_vars['BUG_SUBJECT']);
190
-		$this->assertEquals($bug->type ,$result->_tpl_vars['BUG_TYPE']);
191
-		$this->assertEquals($bug->priority ,$result->_tpl_vars['BUG_PRIORITY']);
192
-		$this->assertEquals($bug->status ,$result->_tpl_vars['BUG_STATUS']);
193
-		$this->assertEquals($bug->resolution ,$result->_tpl_vars['BUG_RESOLUTION']);
194
-		$this->assertEquals($bug->bug_number ,$result->_tpl_vars['BUG_BUG_NUMBER']);
189
+		$this->assertEquals($bug->name, $result->_tpl_vars['BUG_SUBJECT']);
190
+		$this->assertEquals($bug->type, $result->_tpl_vars['BUG_TYPE']);
191
+		$this->assertEquals($bug->priority, $result->_tpl_vars['BUG_PRIORITY']);
192
+		$this->assertEquals($bug->status, $result->_tpl_vars['BUG_STATUS']);
193
+		$this->assertEquals($bug->resolution, $result->_tpl_vars['BUG_RESOLUTION']);
194
+		$this->assertEquals($bug->bug_number, $result->_tpl_vars['BUG_BUG_NUMBER']);
195 195
 		
196 196
 	}
197 197
 	
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 		$bug = new Bug();
209 209
 		
210 210
 		$bug->name = "test";
211
-		$bug->bug_number ="1";
211
+		$bug->bug_number = "1";
212 212
 		$bug->type = "Defect";
213 213
 		$bug->priority = "Urgent";
214 214
 		$bug->status = "New";
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 		//mark the record as deleted and verify that this record cannot be retrieved anymore.
226 226
 		$bug->mark_deleted($bug->id);
227 227
 		$result = $bug->retrieve($bug->id);
228
-		$this->assertEquals(null,$result);
228
+		$this->assertEquals(null, $result);
229 229
 		
230 230
 	}
231 231
 
Please login to merge, or discard this patch.
tests/tests/modules/ProspectLists/ProspectListTest.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
 		//execute the contructor and check for the Object type and  attributes
10 10
 		$prospectList = new ProspectList();
11 11
 		
12
-		$this->assertInstanceOf('ProspectList',$prospectList);
13
-		$this->assertInstanceOf('SugarBean',$prospectList);
12
+		$this->assertInstanceOf('ProspectList', $prospectList);
13
+		$this->assertInstanceOf('SugarBean', $prospectList);
14 14
 			
15 15
 		$this->assertAttributeEquals('prospect_lists', 'table_name', $prospectList);
16 16
 		$this->assertAttributeEquals('ProspectLists', 'module_dir', $prospectList);
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 		$prospectList = new ProspectList();
28 28
 		
29 29
 		//test without setting name
30
-		$this->assertEquals(Null,$prospectList->get_summary_text());
30
+		$this->assertEquals(Null, $prospectList->get_summary_text());
31 31
 		
32 32
 		//test with name set
33 33
 		$prospectList->name = "test";
34
-		$this->assertEquals('test',$prospectList->get_summary_text());
34
+		$this->assertEquals('test', $prospectList->get_summary_text());
35 35
 	}
36 36
 
37 37
 	public function testcreate_list_query()
@@ -41,14 +41,14 @@  discard block
 block discarded – undo
41 41
 		
42 42
 		//test with empty string params
43 43
 		$expected = "SELECT users.user_name as assigned_user_name, prospect_lists.* FROM prospect_lists LEFT JOIN users\n					ON prospect_lists.assigned_user_id=users.id where prospect_lists.deleted=0 ORDER BY prospect_lists.name";
44
-		$actual = $prospectList->create_list_query('','');
45
-		$this->assertSame($expected,$actual);
44
+		$actual = $prospectList->create_list_query('', '');
45
+		$this->assertSame($expected, $actual);
46 46
 		 
47 47
 		
48 48
 		//test with valid string params
49 49
 		$expected = "SELECT users.user_name as assigned_user_name, prospect_lists.* FROM prospect_lists LEFT JOIN users\n					ON prospect_lists.assigned_user_id=users.id where users.user_name = \"\" AND prospect_lists.deleted=0 ORDER BY prospect_lists.id";
50
-		$actual = $prospectList->create_list_query('prospect_lists.id','users.user_name = ""');
51
-		$this->assertSame($expected,$actual);
50
+		$actual = $prospectList->create_list_query('prospect_lists.id', 'users.user_name = ""');
51
+		$this->assertSame($expected, $actual);
52 52
 		
53 53
 	}
54 54
 
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 		
61 61
 		//test with empty string params
62 62
 		$expected = "SELECT\n                                prospect_lists.*,\n                                users.user_name as assigned_user_name FROM prospect_lists LEFT JOIN users\n                                ON prospect_lists.assigned_user_id=users.id  WHERE  prospect_lists.deleted=0 ORDER BY prospect_lists.name";
63
-		$actual = $prospectList->create_export_query('','');
64
-		$this->assertSame($expected,$actual);
63
+		$actual = $prospectList->create_export_query('', '');
64
+		$this->assertSame($expected, $actual);
65 65
 			
66 66
 		
67 67
 		//test with valid string params
68 68
 		$expected = "SELECT\n                                prospect_lists.*,\n                                users.user_name as assigned_user_name FROM prospect_lists LEFT JOIN users\n                                ON prospect_lists.assigned_user_id=users.id  WHERE users.user_name = \"\" AND  prospect_lists.deleted=0 ORDER BY prospect_lists.id";
69
-		$actual = $prospectList->create_export_query('prospect_lists.id','users.user_name = ""');
70
-		$this->assertSame($expected,$actual);
69
+		$actual = $prospectList->create_export_query('prospect_lists.id', 'users.user_name = ""');
70
+		$this->assertSame($expected, $actual);
71 71
 		
72 72
     }
73 73
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     	//test with random string params
79 79
     	$expected = "SELECT l.id AS id, 'Leads' AS related_type, '' AS \"name\", l.first_name AS first_name, l.last_name AS last_name, l.title AS title, l.salutation AS salutation, \n				l.primary_address_street AS primary_address_street,l.primary_address_city AS primary_address_city, l.primary_address_state AS primary_address_state, l.primary_address_postalcode AS primary_address_postalcode, l.primary_address_country AS primary_address_country,\n				l.account_name AS account_name,\n				ea.email_address AS primary_email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,\n				l.do_not_call AS do_not_call, l.phone_fax AS phone_fax, l.phone_other AS phone_other, l.phone_home AS phone_home, l.phone_mobile AS phone_mobile, l.phone_work AS phone_work\n				, leads_cstm.jjwg_maps_address_c AS jjwg_maps_address_c, leads_cstm.jjwg_maps_geocode_status_c AS jjwg_maps_geocode_status_c, leads_cstm.jjwg_maps_lat_c AS jjwg_maps_lat_c, leads_cstm.jjwg_maps_lng_c AS jjwg_maps_lng_c\n				FROM prospect_lists_prospects plp\n				INNER JOIN leads l ON plp.related_id=l.id\n				LEFT join leads_cstm ON l.id = leads_cstm.id_c\n				LEFT JOIN email_addr_bean_rel ear ON  ear.bean_id=l.id AND ear.deleted=0\n				LEFT JOIN email_addresses ea ON ear.email_address_id=ea.id\n				WHERE plp.prospect_list_id = 1 AND plp.deleted=0 \n				AND l.deleted=0\n				AND (ear.deleted=0 OR ear.deleted IS NULL) UNION ALL SELECT u.id AS id, 'Users' AS related_type, '' AS \"name\", u.first_name AS first_name, u.last_name AS last_name,u.title AS title, '' AS salutation, \n				u.address_street AS primary_address_street,u.address_city AS primary_address_city, u.address_state AS primary_address_state,  u.address_postalcode AS primary_address_postalcode, u.address_country AS primary_address_country,\n				'' AS account_name,\n				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,\n				0 AS do_not_call, u.phone_fax AS phone_fax, u.phone_other AS phone_other, u.phone_home AS phone_home, u.phone_mobile AS phone_mobile, u.phone_work AS phone_work\n				, '' AS jjwg_maps_address_c, '' AS jjwg_maps_geocode_status_c, '' AS jjwg_maps_lat_c, '' AS jjwg_maps_lng_c\n				FROM prospect_lists_prospects plp\n				INNER JOIN users u ON plp.related_id=u.id\n				\n				LEFT JOIN email_addr_bean_rel ear ON  ear.bean_id=u.id AND ear.deleted=0\n				LEFT JOIN email_addresses ea ON ear.email_address_id=ea.id\n				WHERE plp.prospect_list_id = 1 AND plp.deleted=0 \n				AND u.deleted=0\n				AND (ear.deleted=0 OR ear.deleted IS NULL) UNION ALL SELECT c.id AS id, 'Contacts' AS related_type, '' AS \"name\", c.first_name AS first_name, c.last_name AS last_name,c.title AS title, c.salutation AS salutation, \n				c.primary_address_street AS primary_address_street,c.primary_address_city AS primary_address_city, c.primary_address_state AS primary_address_state,  c.primary_address_postalcode AS primary_address_postalcode, c.primary_address_country AS primary_address_country,\n				a.name AS account_name,\n				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,\n				c.do_not_call AS do_not_call, c.phone_fax AS phone_fax, c.phone_other AS phone_other, c.phone_home AS phone_home, c.phone_mobile AS phone_mobile, c.phone_work AS phone_work\n				, contacts_cstm.jjwg_maps_address_c AS jjwg_maps_address_c, contacts_cstm.jjwg_maps_geocode_status_c AS jjwg_maps_geocode_status_c, contacts_cstm.jjwg_maps_lat_c AS jjwg_maps_lat_c, contacts_cstm.jjwg_maps_lng_c AS jjwg_maps_lng_c\nFROM prospect_lists_prospects plp\n				INNER JOIN contacts c ON plp.related_id=c.id LEFT JOIN accounts_contacts ac ON ac.contact_id=c.id LEFT JOIN accounts a ON ac.account_id=a.id\n				LEFT join contacts_cstm ON c.id = contacts_cstm.id_c\n				LEFT JOIN email_addr_bean_rel ear ON ear.bean_id=c.id AND ear.deleted=0\n				LEFT JOIN email_addresses ea ON ear.email_address_id=ea.id\n				WHERE plp.prospect_list_id = 1 AND plp.deleted=0 \n				AND c.deleted=0\n				AND ac.deleted=0\n                AND (ear.deleted=0 OR ear.deleted IS NULL) UNION ALL SELECT p.id AS id, 'Prospects' AS related_type, '' AS \"name\", p.first_name AS first_name, p.last_name AS last_name,p.title AS title, p.salutation AS salutation, \n				p.primary_address_street AS primary_address_street,p.primary_address_city AS primary_address_city, p.primary_address_state AS primary_address_state,  p.primary_address_postalcode AS primary_address_postalcode, p.primary_address_country AS primary_address_country,\n				p.account_name AS account_name,\n				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,\n				p.do_not_call AS do_not_call, p.phone_fax AS phone_fax, p.phone_other AS phone_other, p.phone_home AS phone_home, p.phone_mobile AS phone_mobile, p.phone_work AS phone_work\n				, prospects_cstm.jjwg_maps_address_c AS jjwg_maps_address_c, prospects_cstm.jjwg_maps_geocode_status_c AS jjwg_maps_geocode_status_c, prospects_cstm.jjwg_maps_lat_c AS jjwg_maps_lat_c, prospects_cstm.jjwg_maps_lng_c AS jjwg_maps_lng_c\n				FROM prospect_lists_prospects plp\n				INNER JOIN prospects p ON plp.related_id=p.id\n				LEFT join prospects_cstm ON p.id = prospects_cstm.id_c\n				LEFT JOIN email_addr_bean_rel ear ON  ear.bean_id=p.id AND ear.deleted=0\n				LEFT JOIN email_addresses ea ON ear.email_address_id=ea.id\n				WHERE plp.prospect_list_id = 1  AND plp.deleted=0 \n				AND p.deleted=0\n				AND (ear.deleted=0 OR ear.deleted IS NULL) UNION ALL SELECT a.id AS id, 'Accounts' AS related_type, a.name AS \"name\", '' AS first_name, '' AS last_name,'' AS title, '' AS salutation, \n				a.billing_address_street AS primary_address_street,a.billing_address_city AS primary_address_city, a.billing_address_state AS primary_address_state, a.billing_address_postalcode AS primary_address_postalcode, a.billing_address_country AS primary_address_country,\n				'' AS account_name,\n				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,\n				0 AS do_not_call, a.phone_fax as phone_fax, a.phone_alternate AS phone_other, '' AS phone_home, '' AS phone_mobile, a.phone_office AS phone_office\n				, accounts_cstm.jjwg_maps_address_c AS jjwg_maps_address_c, accounts_cstm.jjwg_maps_geocode_status_c AS jjwg_maps_geocode_status_c, accounts_cstm.jjwg_maps_lat_c AS jjwg_maps_lat_c, accounts_cstm.jjwg_maps_lng_c AS jjwg_maps_lng_c\n				FROM prospect_lists_prospects plp\n				INNER JOIN accounts a ON plp.related_id=a.id\n				LEFT join accounts_cstm ON a.id = accounts_cstm.id_c\n				LEFT JOIN email_addr_bean_rel ear ON  ear.bean_id=a.id AND ear.deleted=0\n				LEFT JOIN email_addresses ea ON ear.email_address_id=ea.id\n				WHERE plp.prospect_list_id = 1  AND plp.deleted=0 \n				AND a.deleted=0\n				AND (ear.deleted=0 OR ear.deleted IS NULL) ORDER BY related_type, id, primary_address DESC";
80 80
     	$actual = $prospectList->create_export_members_query('1');
81
-    	$this->assertSame($expected,$actual);
81
+    	$this->assertSame($expected, $actual);
82 82
 		
83 83
 	}
84 84
 	
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		$prospectList = new ProspectList();
88 88
 	
89 89
 		$prospectList->name = "test";
90
-		$prospectList->description ="test description";
90
+		$prospectList->description = "test description";
91 91
 	
92 92
 		$result = $prospectList->save();
93 93
 			
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		//mark the record as deleted and verify that this record cannot be retrieved anymore.
108 108
 		$prospectList->mark_deleted($prospectList->id);
109 109
 		$result = $prospectList->retrieve($prospectList->id);
110
-		$this->assertEquals(null,$result);
110
+		$this->assertEquals(null, $result);
111 111
 	
112 112
 	}	
113 113
 	
@@ -122,14 +122,14 @@  discard block
 block discarded – undo
122 122
 		$prospectList = new ProspectList();
123 123
 
124 124
 		//preset the required attributes, retrive the bean by id and verify the count of records
125
-		$link_ids = array('1','2');
125
+		$link_ids = array('1', '2');
126 126
 	
127 127
 		$prospectList->retrieve($id);
128
-		$prospectList->set_prospect_relationship($id, $link_ids ,'related');
128
+		$prospectList->set_prospect_relationship($id, $link_ids, 'related');
129 129
 		
130 130
 		$expected_count = $prospectList->get_entry_count();
131 131
 		
132
-		$this->assertEquals(2,$expected_count);
132
+		$this->assertEquals(2, $expected_count);
133 133
 	
134 134
 		
135 135
 		//test clear_prospect_relationship method with expected counts
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
 		$prospectList = new ProspectList();
144 144
 		 
145 145
 		$prospectList->retrieve($id);
146
-		$prospectList->set_prospect_relationship_single($id, '3' ,'related');
146
+		$prospectList->set_prospect_relationship_single($id, '3', 'related');
147 147
 		
148 148
 		$expected_count = $prospectList->get_entry_count();
149 149
 		
150
-		$this->assertEquals(1,$expected_count);
150
+		$this->assertEquals(1, $expected_count);
151 151
 		
152 152
 		$this->clear_prospect_relationship($id, '3');
153 153
 		
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		$prospectList->clear_prospect_relationship($id, $related_id, 'related');		
168 168
 
169 169
 		$expected_count = (int)$prospectList->get_entry_count();
170
-		$this->assertEquals($initial_count - 1 , $expected_count);
170
+		$this->assertEquals($initial_count - 1, $expected_count);
171 171
 	}
172 172
 	
173 173
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		$prospectList = new ProspectList();
211 211
 		
212 212
 		$prospectList->fill_in_additional_detail_fields();
213
-		$this->assertEquals(0,$prospectList->entry_count);
213
+		$this->assertEquals(0, $prospectList->entry_count);
214 214
 		
215 215
 	}
216 216
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 		
223 223
 		//execute the method and test if it works and does not throws an exception.
224 224
 		try {
225
-			$prospectList->update_currency_id('','');
225
+			$prospectList->update_currency_id('', '');
226 226
 			$this->assertTrue(true);
227 227
 		}
228 228
 		catch (Exception $e) {
@@ -244,11 +244,11 @@  discard block
 block discarded – undo
244 244
 	}
245 245
 		
246 246
 		
247
-	public function testget_list_view_data(){
247
+	public function testget_list_view_data() {
248 248
 
249 249
 		$prospectList = new ProspectList();
250 250
 		
251
-		$expected = array( "DELETED"=> 0, "ENTRY_COUNT"=> '0' );
251
+		$expected = array("DELETED"=> 0, "ENTRY_COUNT"=> '0');
252 252
 		$actual = $prospectList->get_list_view_data();
253 253
 		$this->assertSame($expected, $actual);
254 254
 		
@@ -262,18 +262,18 @@  discard block
 block discarded – undo
262 262
 		//test with empty string params
263 263
 		$expected = "prospect_lists.name like '%'";
264 264
 		$actual = $prospectList->build_generic_where_clause('');
265
-		$this->assertSame($expected,$actual);
265
+		$this->assertSame($expected, $actual);
266 266
 			
267 267
 		
268 268
 		//test with valid string params
269 269
 		$expected = "prospect_lists.name like '%'";
270 270
 		$actual = $prospectList->build_generic_where_clause('1');
271
-		$this->assertSame($expected,$actual);
271
+		$this->assertSame($expected, $actual);
272 272
 		
273 273
 	}
274 274
 
275 275
 	
276
-	public function testbean_implements(){
276
+	public function testbean_implements() {
277 277
 
278 278
 		$prospectList = new ProspectList();
279 279
 		
Please login to merge, or discard this patch.
tests/tests/modules/Schedulers/SchedulerTest.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 require_once 'install/install_utils.php';
5 5
 
6 6
 
7
-class SchedulerTest extends PHPUnit_Framework_TestCase  {
7
+class SchedulerTest extends PHPUnit_Framework_TestCase {
8 8
 
9 9
 
10 10
 	public function test__construct()
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
 		//execute the contructor and check for the Object type and  attributes
14 14
 		$scheduler = new Scheduler();
15 15
 		
16
-		$this->assertInstanceOf('Scheduler',$scheduler);
17
-		$this->assertInstanceOf('SugarBean',$scheduler);
16
+		$this->assertInstanceOf('Scheduler', $scheduler);
17
+		$this->assertInstanceOf('SugarBean', $scheduler);
18 18
 			
19 19
 		$this->assertAttributeEquals('schedulers', 'table_name', $scheduler);
20 20
 		$this->assertAttributeEquals('Schedulers', 'module_dir', $scheduler);
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	public function testinitUser()
32 32
 	{
33 33
 		$user = Scheduler::initUser();
34
-		$this->assertInstanceOf('User',$user);
34
+		$this->assertInstanceOf('User', $user);
35 35
 	}
36 36
 
37 37
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		$scheduler = new Scheduler();
64 64
 		$result = $scheduler->createJob();
65 65
 		
66
-		$this->assertInstanceOf('SchedulersJob',$result);
66
+		$this->assertInstanceOf('SchedulersJob', $result);
67 67
 		
68 68
 	}
69 69
 
@@ -96,17 +96,17 @@  discard block
 block discarded – undo
96 96
 		
97 97
 		$scheduler->job_interval = "0::3::3::*::*";
98 98
 		$result = $scheduler->deriveDBDateTimes();
99
-		$this->assertEquals(false,$result);
99
+		$this->assertEquals(false, $result);
100 100
 		
101 101
 		
102 102
 		$scheduler->job_interval = "*::*::*::*::*";
103 103
 		$result = $scheduler->deriveDBDateTimes();
104
-		$this->assertEquals(false,$result);		
104
+		$this->assertEquals(false, $result);		
105 105
 		
106 106
 		
107 107
 		$scheduler->job_interval = "0::*::3::*::*";
108 108
 		$result = $scheduler->deriveDBDateTimes();
109
-		$this->assertEquals(false,$result);
109
+		$this->assertEquals(false, $result);
110 110
 		
111 111
 	}
112 112
 
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
 		
118 118
 		//execute the method with different job intervals
119 119
 		
120
-		$this->assertEquals("", $scheduler->handleIntervalType('0','0','2','2'));
121
-		$this->assertEquals('00:02', $scheduler->handleIntervalType('1','0','2','2'));
122
-		$this->assertEquals('30th', $scheduler->handleIntervalType('2','0','2','2'));
123
-		$this->assertEquals('December', $scheduler->handleIntervalType('3','0','2','2'));
124
-		$this->assertEquals("", $scheduler->handleIntervalType('4','0','2','2'));
120
+		$this->assertEquals("", $scheduler->handleIntervalType('0', '0', '2', '2'));
121
+		$this->assertEquals('00:02', $scheduler->handleIntervalType('1', '0', '2', '2'));
122
+		$this->assertEquals('30th', $scheduler->handleIntervalType('2', '0', '2', '2'));
123
+		$this->assertEquals('December', $scheduler->handleIntervalType('3', '0', '2', '2'));
124
+		$this->assertEquals("", $scheduler->handleIntervalType('4', '0', '2', '2'));
125 125
 		
126 126
 	}
127 127
 
@@ -134,13 +134,13 @@  discard block
 block discarded – undo
134 134
 		$scheduler->job_interval = "0::3::3::*::*";
135 135
 		$scheduler->parseInterval();
136 136
 		$scheduler->setIntervalHumanReadable();
137
-		$this->assertEquals('03:00; 3rd', $scheduler->intervalHumanReadable );
137
+		$this->assertEquals('03:00; 3rd', $scheduler->intervalHumanReadable);
138 138
 
139 139
 		
140 140
 		$scheduler->job_interval = "0::3::3::3::3";
141 141
 		$scheduler->parseInterval();
142 142
 		$scheduler->setIntervalHumanReadable();
143
-		$this->assertEquals('03:00; 3rd; March', $scheduler->intervalHumanReadable );
143
+		$this->assertEquals('03:00; 3rd; March', $scheduler->intervalHumanReadable);
144 144
 		
145 145
 	}
146 146
 	
@@ -155,11 +155,11 @@  discard block
 block discarded – undo
155 155
 		
156 156
 		$scheduler->setStandardArraysAttributes();
157 157
 				
158
-		$this->assertEquals(array('*', 1, 2, 3, 4, 5, 6, 0), $scheduler->dayInt );
159
-		$this->assertEquals(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), $scheduler->monthsInt );
160
-		$this->assertEquals(array('', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'), $scheduler->monthsLabel );
161
-		$this->assertEquals(array('*', '/', '-', ','), $scheduler->metricsVar );
162
-		$this->assertEquals(array(' every ', '', ' thru ', ' and '), $scheduler->metricsVal );
158
+		$this->assertEquals(array('*', 1, 2, 3, 4, 5, 6, 0), $scheduler->dayInt);
159
+		$this->assertEquals(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), $scheduler->monthsInt);
160
+		$this->assertEquals(array('', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'), $scheduler->monthsLabel);
161
+		$this->assertEquals(array('*', '/', '-', ','), $scheduler->metricsVar);
162
+		$this->assertEquals(array(' every ', '', ' thru ', ' and '), $scheduler->metricsVal);
163 163
 	
164 164
 	}
165 165
 
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 		
171 171
 		$scheduler->job_interval = "0::3::3::*::*";
172 172
 
173
-		$expected = array (
174
-					  'raw' => array ('0', '3', '3', '*', '*' ),
173
+		$expected = array(
174
+					  'raw' => array('0', '3', '3', '*', '*'),
175 175
 					  'hours' => '3:::0',
176 176
 					  'months' => '*:::3',
177 177
 					);
@@ -242,14 +242,14 @@  discard block
 block discarded – undo
242 242
 		
243 243
 		//test with empty string params
244 244
 		$expected = " SELECT  schedulers.*  , jt0.user_name created_by_name , jt0.created_by created_by_name_owner  , 'Users' created_by_name_mod , jt1.user_name modified_by_name , jt1.created_by modified_by_name_owner  , 'Users' modified_by_name_mod FROM schedulers   LEFT JOIN  users jt0 ON jt0.id=schedulers.created_by AND jt0.deleted=0\n AND jt0.deleted=0  LEFT JOIN  users jt1 ON schedulers.modified_user_id=jt1.id AND jt1.deleted=0\n\n AND jt1.deleted=0 where schedulers.deleted=0";
245
-		$actual = $scheduler->create_export_query('','');
246
-		$this->assertSame($expected,$actual);
245
+		$actual = $scheduler->create_export_query('', '');
246
+		$this->assertSame($expected, $actual);
247 247
 			
248 248
 		
249 249
 		//test with valid string params
250 250
 		$expected = " SELECT  schedulers.*  , jt0.user_name created_by_name , jt0.created_by created_by_name_owner  , 'Users' created_by_name_mod , jt1.user_name modified_by_name , jt1.created_by modified_by_name_owner  , 'Users' modified_by_name_mod FROM schedulers   LEFT JOIN  users jt0 ON jt0.id=schedulers.created_by AND jt0.deleted=0\n AND jt0.deleted=0  LEFT JOIN  users jt1 ON schedulers.modified_user_id=jt1.id AND jt1.deleted=0\n\n AND jt1.deleted=0 where (schedulers.name = \"\") AND schedulers.deleted=0";
251
-		$actual = $scheduler->create_export_query('schedulers.id','schedulers.name = ""');
252
-		$this->assertSame($expected,$actual);
251
+		$actual = $scheduler->create_export_query('schedulers.id', 'schedulers.name = ""');
252
+		$this->assertSame($expected, $actual);
253 253
 		
254 254
 	}
255 255
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 		$scheduler->created_by = 1;
299 299
 		$scheduler->modified_user_id = 1;
300 300
 		
301
-		$expected = array (
301
+		$expected = array(
302 302
 				'DELETED' => '0',
303 303
 				'CREATED_BY' => 1,
304 304
 				'MODIFIED_USER_ID' => 1,
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 		);
312 312
 		
313 313
 		$actual = $scheduler->get_list_view_data();
314
-		$this->assertSame($expected ,$actual);
314
+		$this->assertSame($expected, $actual);
315 315
 		
316 316
 	}
317 317
 	
@@ -323,11 +323,11 @@  discard block
 block discarded – undo
323 323
 		$scheduler = new Scheduler();
324 324
 		
325 325
 		//test without setting name
326
-		$this->assertEquals(Null,$scheduler->get_summary_text());
326
+		$this->assertEquals(Null, $scheduler->get_summary_text());
327 327
 		
328 328
 		//test with name set
329 329
 		$scheduler->name = "test";
330
-		$this->assertEquals('test',$scheduler->get_summary_text());
330
+		$this->assertEquals('test', $scheduler->get_summary_text());
331 331
 	
332 332
 	}
333 333
 
Please login to merge, or discard this patch.
tests/tests/modules/Campaigns/CampaignTest.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-class CampaignTest extends PHPUnit_Framework_TestCase  {
4
+class CampaignTest extends PHPUnit_Framework_TestCase {
5 5
 
6 6
 
7 7
 	public function testCampaign() {
8 8
 	
9 9
 		//execute the contructor and check for the Object type and  attributes
10 10
 		$campaign = new Campaign();
11
-		$this->assertInstanceOf('Campaign',$campaign);
12
-		$this->assertInstanceOf('SugarBean',$campaign);
11
+		$this->assertInstanceOf('Campaign', $campaign);
12
+		$this->assertInstanceOf('SugarBean', $campaign);
13 13
 	
14 14
 		$this->assertAttributeEquals('Campaigns', 'module_dir', $campaign);
15 15
 		$this->assertAttributeEquals('Campaign', 'object_name', $campaign);
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 		//test with attributes preset and verify template variables are set accordingly
29 29
 		$tpl = new Sugar_Smarty();
30 30
 		$campaign->list_view_parse_additional_sections($tpl);
31
-		$this->assertEquals("" ,$tpl->_tpl_vars['ASSIGNED_USER_NAME']);
31
+		$this->assertEquals("", $tpl->_tpl_vars['ASSIGNED_USER_NAME']);
32 32
 		
33 33
 	}
34 34
 
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
 		$campaign = new Campaign();
39 39
 		
40 40
 		//test without setting name
41
-		$this->assertEquals(Null,$campaign->get_summary_text());
41
+		$this->assertEquals(Null, $campaign->get_summary_text());
42 42
 		
43 43
 		//test with name set
44 44
 		$campaign->name = "test";
45
-		$this->assertEquals('test',$campaign->get_summary_text());
45
+		$this->assertEquals('test', $campaign->get_summary_text());
46 46
 
47 47
 		
48 48
 	}
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
 
55 55
 		//test with empty string params
56 56
 		$expected = "SELECT\n            campaigns.*,\n            users.user_name as assigned_user_name  FROM campaigns LEFT JOIN users\n                      ON campaigns.assigned_user_id=users.id where  campaigns.deleted=0 ORDER BY campaigns.name";
57
-		$actual = $campaign->create_export_query('','');		
58
-		$this->assertSame($expected,$actual);
57
+		$actual = $campaign->create_export_query('', '');		
58
+		$this->assertSame($expected, $actual);
59 59
 		
60 60
 		
61 61
 		//test with valid string params
62 62
 		$expected = "SELECT\n            campaigns.*,\n            users.user_name as assigned_user_name  FROM campaigns LEFT JOIN users\n                      ON campaigns.assigned_user_id=users.id where campaigns.name=\"\" AND  campaigns.deleted=0 ORDER BY campaigns.id";
63
-		$actual = $campaign->create_export_query('campaigns.id','campaigns.name=""');
64
-		$this->assertSame($expected,$actual);
63
+		$actual = $campaign->create_export_query('campaigns.id', 'campaigns.name=""');
64
+		$this->assertSame($expected, $actual);
65 65
 		
66 66
 	}
67 67
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		
143 143
 		//execute the method and test if it works and does not throws an exception.
144 144
 		try {
145
-			$campaign->update_currency_id('','');
145
+			$campaign->update_currency_id('', '');
146 146
 			$this->assertTrue(true);
147 147
 		}
148 148
 		catch (Exception $e) {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		
160 160
 		//execute the method and verify that it retunrs expected results
161 161
 		
162
-		$expected = array (
162
+		$expected = array(
163 163
 				'DELETED' => 0,
164 164
 				'TRACKER_COUNT' => '0',
165 165
 				'REFER_URL' => 'http://',
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
 		);
175 175
 		
176 176
 		$actual = $campaign->get_list_view_data();
177
-        foreach($expected as $expectedKey => $expectedVal){
178
-            if($expectedKey == 'LAUNCH_WIZARD_IMAGE' || $expectedKey == 'TRACK_CAMPAIGN_IMAGE'){
179
-                $this->assertRegExp($expected[$expectedKey],$actual[$expectedKey]);
180
-            }else {
177
+        foreach ($expected as $expectedKey => $expectedVal) {
178
+            if ($expectedKey == 'LAUNCH_WIZARD_IMAGE' || $expectedKey == 'TRACK_CAMPAIGN_IMAGE') {
179
+                $this->assertRegExp($expected[$expectedKey], $actual[$expectedKey]);
180
+            } else {
181 181
                 $this->assertSame($expected[$expectedKey], $actual[$expectedKey]);
182 182
             }
183 183
         }
@@ -191,13 +191,13 @@  discard block
 block discarded – undo
191 191
 		
192 192
 		//test with blank parameter
193 193
 		$expected = "campaigns.name like '%'";
194
-		$actual = $campaign->build_generic_where_clause ("");
195
-		$this->assertSame($expected,$actual);
194
+		$actual = $campaign->build_generic_where_clause("");
195
+		$this->assertSame($expected, $actual);
196 196
 		
197 197
 		//test with valid parameter
198 198
 		$expected = "campaigns.name like '1%'";
199
-		$actual = $campaign->build_generic_where_clause (1);
200
-		$this->assertSame($expected,$actual);
199
+		$actual = $campaign->build_generic_where_clause(1);
200
+		$this->assertSame($expected, $actual);
201 201
 		
202 202
 	}
203 203
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 		//mark the record as deleted and verify that this record cannot be retrieved anymore.
220 220
 		$campaign->mark_deleted($campaign->id);
221 221
 		$result = $campaign->retrieve($campaign->id);
222
-		$this->assertEquals(null,$result);
222
+		$this->assertEquals(null, $result);
223 223
 
224 224
 	}
225 225
 
@@ -237,11 +237,11 @@  discard block
 block discarded – undo
237 237
 				
238 238
 		$result = $campaign->set_notification_body(new Sugar_Smarty(), $campaign);
239 239
 		
240
-		$this->assertEquals($campaign->name ,$result->_tpl_vars['CAMPAIGN_NAME']);
241
-		$this->assertEquals($campaign->budget ,$result->_tpl_vars['CAMPAIGN_AMOUNT']);
242
-		$this->assertEquals($campaign->end_date ,$result->_tpl_vars['CAMPAIGN_CLOSEDATE']);
243
-		$this->assertEquals($campaign->status ,$result->_tpl_vars['CAMPAIGN_STATUS']);
244
-		$this->assertEquals($campaign->content ,$result->_tpl_vars['CAMPAIGN_DESCRIPTION']);
240
+		$this->assertEquals($campaign->name, $result->_tpl_vars['CAMPAIGN_NAME']);
241
+		$this->assertEquals($campaign->budget, $result->_tpl_vars['CAMPAIGN_AMOUNT']);
242
+		$this->assertEquals($campaign->end_date, $result->_tpl_vars['CAMPAIGN_CLOSEDATE']);
243
+		$this->assertEquals($campaign->status, $result->_tpl_vars['CAMPAIGN_STATUS']);
244
+		$this->assertEquals($campaign->content, $result->_tpl_vars['CAMPAIGN_DESCRIPTION']);
245 245
 				
246 246
 	}
247 247
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
     	
252 252
     	$expected = "SELECT campaign_log.*  FROM campaign_log WHERE campaign_log.campaign_id = '' AND campaign_log.deleted=0 AND activity_type = 'lead' AND archived = 0 AND target_id IS NOT NULL ";
253 253
     	$actual = $campaign->track_log_leads();
254
-		$this->assertSame($expected,$actual);
254
+		$this->assertSame($expected, $actual);
255 255
 		
256 256
     }
257 257
 
@@ -262,12 +262,12 @@  discard block
 block discarded – undo
262 262
 		//test without parameters
263 263
 		$expected = "SELECT campaign_log.*  FROM campaign_log WHERE campaign_log.campaign_id = '' AND campaign_log.deleted=0 AND activity_type='targeted' AND archived=0 ";
264 264
 		$actual = $campaign->track_log_entries();
265
-		$this->assertSame($expected,$actual);
265
+		$this->assertSame($expected, $actual);
266 266
 
267 267
 		//test with parameters
268 268
 		$expected = "SELECT campaign_log.*  FROM campaign_log WHERE campaign_log.campaign_id = '' AND campaign_log.deleted=0 AND activity_type='test1' AND archived=0 ";
269
-		$actual = $campaign->track_log_entries(array('test1','test2'));
270
-		$this->assertSame($expected,$actual);
269
+		$actual = $campaign->track_log_entries(array('test1', 'test2'));
270
+		$this->assertSame($expected, $actual);
271 271
 		
272 272
 	}
273 273
 
@@ -279,12 +279,12 @@  discard block
 block discarded – undo
279 279
 		//without parameters
280 280
 		$expected = "SELECT emailman.* ,\n					campaigns.name as campaign_name,\n					email_marketing.name as message_name,\n					(CASE related_type\n						WHEN 'Contacts' THEN LTRIM(RTRIM(CONCAT(IFNULL(contacts.first_name,''),'&nbsp;',IFNULL(contacts.last_name,''))))\n						WHEN 'Leads' THEN LTRIM(RTRIM(CONCAT(IFNULL(leads.first_name,''),'&nbsp;',IFNULL(leads.last_name,''))))\n						WHEN 'Accounts' THEN accounts.name\n						WHEN 'Users' THEN LTRIM(RTRIM(CONCAT(IFNULL(users.first_name,''),'&nbsp;',IFNULL(users.last_name,''))))\n						WHEN 'Prospects' THEN LTRIM(RTRIM(CONCAT(IFNULL(prospects.first_name,''),'&nbsp;',IFNULL(prospects.last_name,''))))\n					END) recipient_name FROM emailman\n		            LEFT JOIN users ON users.id = emailman.related_id and emailman.related_type ='Users'\n					LEFT JOIN contacts ON contacts.id = emailman.related_id and emailman.related_type ='Contacts'\n					LEFT JOIN leads ON leads.id = emailman.related_id and emailman.related_type ='Leads'\n					LEFT JOIN accounts ON accounts.id = emailman.related_id and emailman.related_type ='Accounts'\n					LEFT JOIN prospects ON prospects.id = emailman.related_id and emailman.related_type ='Prospects'\n					LEFT JOIN prospect_lists ON prospect_lists.id = emailman.list_id\n                    LEFT JOIN email_addr_bean_rel ON email_addr_bean_rel.bean_id = emailman.related_id and emailman.related_type = email_addr_bean_rel.bean_module and email_addr_bean_rel.primary_address = 1 and email_addr_bean_rel.deleted=0\n					LEFT JOIN campaigns ON campaigns.id = emailman.campaign_id\n					LEFT JOIN email_marketing ON email_marketing.id = emailman.marketing_id WHERE  emailman.campaign_id = '' AND emailman.deleted=0 AND  emailman.deleted=0";
281 281
 		$actual = $campaign->get_queue_items();
282
-		$this->assertSame($expected,$actual);
282
+		$this->assertSame($expected, $actual);
283 283
 		
284 284
 		//with parameters		
285 285
 		$expected = "SELECT emailman.* ,\n					campaigns.name as campaign_name,\n					email_marketing.name as message_name,\n					(CASE related_type\n						WHEN 'Contacts' THEN LTRIM(RTRIM(CONCAT(IFNULL(contacts.first_name,''),'&nbsp;',IFNULL(contacts.last_name,''))))\n						WHEN 'Leads' THEN LTRIM(RTRIM(CONCAT(IFNULL(leads.first_name,''),'&nbsp;',IFNULL(leads.last_name,''))))\n						WHEN 'Accounts' THEN accounts.name\n						WHEN 'Users' THEN LTRIM(RTRIM(CONCAT(IFNULL(users.first_name,''),'&nbsp;',IFNULL(users.last_name,''))))\n						WHEN 'Prospects' THEN LTRIM(RTRIM(CONCAT(IFNULL(prospects.first_name,''),'&nbsp;',IFNULL(prospects.last_name,''))))\n					END) recipient_name FROM emailman\n		            LEFT JOIN users ON users.id = emailman.related_id and emailman.related_type ='Users'\n					LEFT JOIN contacts ON contacts.id = emailman.related_id and emailman.related_type ='Contacts'\n					LEFT JOIN leads ON leads.id = emailman.related_id and emailman.related_type ='Leads'\n					LEFT JOIN accounts ON accounts.id = emailman.related_id and emailman.related_type ='Accounts'\n					LEFT JOIN prospects ON prospects.id = emailman.related_id and emailman.related_type ='Prospects'\n					LEFT JOIN prospect_lists ON prospect_lists.id = emailman.list_id\n                    LEFT JOIN email_addr_bean_rel ON email_addr_bean_rel.bean_id = emailman.related_id and emailman.related_type = email_addr_bean_rel.bean_module and email_addr_bean_rel.primary_address = 1 and email_addr_bean_rel.deleted=0\n					LEFT JOIN campaigns ON campaigns.id = emailman.campaign_id\n					LEFT JOIN email_marketing ON email_marketing.id = emailman.marketing_id INNER JOIN (select min(id) as id from emailman  em GROUP BY users.id  ) secondary\n			           on emailman.id = secondary.id	WHERE  emailman.campaign_id = '' AND emailman.deleted=0 AND marketing_id ='1'  AND  emailman.deleted=0";
286
-		$actual = $campaign->get_queue_items(array("EMAIL_MARKETING_ID_VALUE"=>1,"group_by"=>"users.id"));
287
-		$this->assertSame($expected,$actual);
286
+		$actual = $campaign->get_queue_items(array("EMAIL_MARKETING_ID_VALUE"=>1, "group_by"=>"users.id"));
287
+		$this->assertSame($expected, $actual);
288 288
 		
289 289
 	}
290 290
 
@@ -308,17 +308,17 @@  discard block
 block discarded – undo
308 308
     	//test without parameters
309 309
     	$expected = "";
310 310
     	$actual = $campaign->create_list_count_query('');
311
-    	$this->assertSame($expected,$actual);
311
+    	$this->assertSame($expected, $actual);
312 312
 
313 313
     	//test with query parameters
314 314
     	$expected = "SELECT count(*) c FROM campaigns";
315 315
     	$actual = $campaign->create_list_count_query('select * from campaigns');
316
-    	$this->assertSame($expected,$actual);
316
+    	$this->assertSame($expected, $actual);
317 317
 
318 318
     	//test with distinct
319 319
     	$expected = "SELECT count(DISTINCT campaigns.id) c FROM campaigns";
320 320
     	$actual = $campaign->create_list_count_query('SELECT distinct marketing_id FROM campaigns');
321
-    	$this->assertSame($expected,$actual);
321
+    	$this->assertSame($expected, $actual);
322 322
     	    	
323 323
     }
324 324
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
     {
328 328
     	$campaign = new Campaign();
329 329
     	$result = $campaign->getDeletedCampaignLogLeadsCount();
330
-    	$this->assertEquals(0,$result);
330
+    	$this->assertEquals(0, $result);
331 331
     	
332 332
     }
333 333
 
Please login to merge, or discard this patch.