@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | require_once('modules/Audit/Audit.php'); |
3 | -class AuditTest extends PHPUnit_Framework_TestCase { |
|
3 | +class AuditTest extends PHPUnit_Framework_TestCase { |
|
4 | 4 | |
5 | 5 | |
6 | 6 | public function testAudit() { |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | |
10 | 10 | //execute the contructor and check for the Object type and attributes |
11 | 11 | $audit = new Audit(); |
12 | - $this->assertInstanceOf('Audit',$audit); |
|
13 | - $this->assertInstanceOf('SugarBean',$audit); |
|
12 | + $this->assertInstanceOf('Audit', $audit); |
|
13 | + $this->assertInstanceOf('SugarBean', $audit); |
|
14 | 14 | $this->assertAttributeEquals('Audit', 'module_dir', $audit); |
15 | 15 | $this->assertAttributeEquals('Audit', 'object_name', $audit); |
16 | 16 | |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | $audit = new Audit(); |
23 | 23 | |
24 | 24 | //test without setting name |
25 | - $this->assertEquals(Null,$audit->get_summary_text()); |
|
25 | + $this->assertEquals(Null, $audit->get_summary_text()); |
|
26 | 26 | |
27 | 27 | //test with name set |
28 | 28 | $audit->name = "test"; |
29 | - $this->assertEquals('test',$audit->get_summary_text()); |
|
29 | + $this->assertEquals('test', $audit->get_summary_text()); |
|
30 | 30 | |
31 | 31 | } |
32 | 32 | |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | $audit = new Audit(); |
155 | 155 | |
156 | 156 | //test with name field |
157 | - $result = $audit->getAssociatedFieldName("name","1"); |
|
158 | - $this->assertEquals("1",$result); |
|
157 | + $result = $audit->getAssociatedFieldName("name", "1"); |
|
158 | + $this->assertEquals("1", $result); |
|
159 | 159 | |
160 | 160 | //test with parent_id field |
161 | - $result = $audit->getAssociatedFieldName("parent_id","1"); |
|
162 | - $this->assertEquals(null,$result); |
|
161 | + $result = $audit->getAssociatedFieldName("parent_id", "1"); |
|
162 | + $this->assertEquals(null, $result); |
|
163 | 163 | |
164 | 164 | } |
165 | 165 |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | class AOR_Scheduled_ReportsTest extends PHPUnit_Framework_TestCase { |
4 | 4 | |
5 | 5 | |
6 | - public function testAOR_Scheduled_Reports(){ |
|
6 | + public function testAOR_Scheduled_Reports() { |
|
7 | 7 | |
8 | 8 | //execute the contructor and check for the Object type and attributes |
9 | 9 | $aorScheduledReports = new AOR_Scheduled_Reports(); |
10 | - $this->assertInstanceOf('AOR_Scheduled_Reports',$aorScheduledReports); |
|
11 | - $this->assertInstanceOf('Basic',$aorScheduledReports); |
|
12 | - $this->assertInstanceOf('SugarBean',$aorScheduledReports); |
|
10 | + $this->assertInstanceOf('AOR_Scheduled_Reports', $aorScheduledReports); |
|
11 | + $this->assertInstanceOf('Basic', $aorScheduledReports); |
|
12 | + $this->assertInstanceOf('SugarBean', $aorScheduledReports); |
|
13 | 13 | |
14 | 14 | $this->assertAttributeEquals('AOR_Scheduled_Reports', 'module_dir', $aorScheduledReports); |
15 | 15 | $this->assertAttributeEquals('AOR_Scheduled_Reports', 'object_name', $aorScheduledReports); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | } |
22 | 22 | |
23 | - public function testbean_implements(){ |
|
23 | + public function testbean_implements() { |
|
24 | 24 | |
25 | 25 | error_reporting(E_ERROR | E_PARSE); |
26 | 26 | |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | |
32 | 32 | } |
33 | 33 | |
34 | - public function testSaveAndGet_email_recipients(){ |
|
34 | + public function testSaveAndGet_email_recipients() { |
|
35 | 35 | |
36 | 36 | $aorScheduledReports = new AOR_Scheduled_Reports(); |
37 | 37 | $aorScheduledReports->name = "test"; |
38 | 38 | $aorScheduledReports->description = "test description"; |
39 | - $_POST['email_recipients']= Array('email_target_type'=> array('Email Address','all','Specify User') ,'email' =>array('[email protected]','','1') ); |
|
39 | + $_POST['email_recipients'] = Array('email_target_type'=> array('Email Address', 'all', 'Specify User'), 'email' =>array('[email protected]', '', '1')); |
|
40 | 40 | |
41 | 41 | |
42 | 42 | //test save and test for record ID to verify that record is saved |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | |
48 | 48 | |
49 | 49 | //test get_email_recipients |
50 | - $expected = array('[email protected]','','1'); |
|
50 | + $expected = array('[email protected]', '', '1'); |
|
51 | 51 | $aorScheduledReports->retrieve($aorScheduledReports->id); |
52 | 52 | $emails = $aorScheduledReports->get_email_recipients(); |
53 | 53 | |
54 | 54 | $this->assertTrue(is_array($emails)); |
55 | - $this->assertEquals('[email protected]',$emails[0]); |
|
55 | + $this->assertEquals('[email protected]', $emails[0]); |
|
56 | 56 | |
57 | 57 | |
58 | 58 | $aorScheduledReports->mark_deleted($aorScheduledReports->id); |
@@ -62,17 +62,17 @@ discard block |
||
62 | 62 | |
63 | 63 | |
64 | 64 | |
65 | - public function testshouldRun(){ |
|
65 | + public function testshouldRun() { |
|
66 | 66 | |
67 | 67 | |
68 | 68 | $aorScheduledReports = new AOR_Scheduled_Reports(); |
69 | 69 | $aorScheduledReports->schedule = " 8 * * * *"; |
70 | 70 | |
71 | 71 | //test without a last_run date |
72 | - $this->assertFalse($aorScheduledReports->shouldRun(new DateTime()) ); |
|
72 | + $this->assertFalse($aorScheduledReports->shouldRun(new DateTime())); |
|
73 | 73 | |
74 | 74 | //test without a older last_run date |
75 | - $aorScheduledReports->last_run = date("d-m-y H:i:s", mktime(0,0,0,10,3,2014)); |
|
75 | + $aorScheduledReports->last_run = date("d-m-y H:i:s", mktime(0, 0, 0, 10, 3, 2014)); |
|
76 | 76 | $this->assertTrue($aorScheduledReports->shouldRun(new DateTime())); |
77 | 77 | |
78 | 78 |
@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | class AOK_Knowledge_Base_CategoriesTest extends PHPUnit_Framework_TestCase { |
4 | 4 | |
5 | - public function testAOK_Knowledge_Base_Categories(){ |
|
5 | + public function testAOK_Knowledge_Base_Categories() { |
|
6 | 6 | |
7 | 7 | //execute the contructor and check for the Object type and type attribute |
8 | 8 | $aok_KBCategories = new AOK_Knowledge_Base_Categories(); |
9 | - $this->assertInstanceOf('AOK_Knowledge_Base_Categories',$aok_KBCategories); |
|
10 | - $this->assertInstanceOf('Basic',$aok_KBCategories); |
|
11 | - $this->assertInstanceOf('SugarBean',$aok_KBCategories); |
|
9 | + $this->assertInstanceOf('AOK_Knowledge_Base_Categories', $aok_KBCategories); |
|
10 | + $this->assertInstanceOf('Basic', $aok_KBCategories); |
|
11 | + $this->assertInstanceOf('SugarBean', $aok_KBCategories); |
|
12 | 12 | |
13 | 13 | $this->assertAttributeEquals('AOK_Knowledge_Base_Categories', 'module_dir', $aok_KBCategories); |
14 | 14 | $this->assertAttributeEquals('AOK_Knowledge_Base_Categories', 'object_name', $aok_KBCategories); |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | //execute the contructor and check for the Object type and attributes |
10 | 10 | $jjwgAreas = new jjwg_Areas(); |
11 | 11 | |
12 | - $this->assertInstanceOf('jjwg_Areas',$jjwgAreas); |
|
13 | - $this->assertInstanceOf('Basic',$jjwgAreas); |
|
14 | - $this->assertInstanceOf('SugarBean',$jjwgAreas); |
|
12 | + $this->assertInstanceOf('jjwg_Areas', $jjwgAreas); |
|
13 | + $this->assertInstanceOf('Basic', $jjwgAreas); |
|
14 | + $this->assertInstanceOf('SugarBean', $jjwgAreas); |
|
15 | 15 | |
16 | 16 | $this->assertAttributeEquals('jjwg_Areas', 'module_dir', $jjwgAreas); |
17 | 17 | $this->assertAttributeEquals('jjwg_Areas', 'object_name', $jjwgAreas); |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | $jjwgAreas = new jjwg_Areas(); |
38 | 38 | $jjwgAreas->configuration(); |
39 | 39 | |
40 | - $this->assertInstanceOf('jjwg_Maps',$jjwgAreas->jjwg_Maps); |
|
40 | + $this->assertInstanceOf('jjwg_Maps', $jjwgAreas->jjwg_Maps); |
|
41 | 41 | $this->assertTrue(is_array($jjwgAreas->settings)); |
42 | - $this->assertGreaterThan(0,count($jjwgAreas->settings)); |
|
42 | + $this->assertGreaterThan(0, count($jjwgAreas->settings)); |
|
43 | 43 | |
44 | 44 | } |
45 | 45 | |
@@ -51,26 +51,26 @@ discard block |
||
51 | 51 | |
52 | 52 | //test without pre settting attributes |
53 | 53 | $jjwgAreas->retrieve(); |
54 | - $this->assertEquals(false ,$jjwgAreas->polygon); |
|
55 | - $this->assertEquals(0,$jjwgAreas->area); |
|
56 | - $this->assertEquals(null,$jjwgAreas->centroid); |
|
54 | + $this->assertEquals(false, $jjwgAreas->polygon); |
|
55 | + $this->assertEquals(0, $jjwgAreas->area); |
|
56 | + $this->assertEquals(null, $jjwgAreas->centroid); |
|
57 | 57 | |
58 | 58 | |
59 | 59 | //test with required attributes preset |
60 | - $jjwgAreas->coordinates= "100,80,10\r\n101,81,11\r\n102,82,12"; |
|
60 | + $jjwgAreas->coordinates = "100,80,10\r\n101,81,11\r\n102,82,12"; |
|
61 | 61 | |
62 | - $expected_polygon = array ( |
|
63 | - array ('lng' => '100', 'lat' => '80','elv' => '10' ), |
|
64 | - array ('lng' => '101', 'lat' => '81', 'elv' => '11'), |
|
65 | - array ('lng' => '102', 'lat' => '82', 'elv' => '12' ) |
|
62 | + $expected_polygon = array( |
|
63 | + array('lng' => '100', 'lat' => '80', 'elv' => '10'), |
|
64 | + array('lng' => '101', 'lat' => '81', 'elv' => '11'), |
|
65 | + array('lng' => '102', 'lat' => '82', 'elv' => '12') |
|
66 | 66 | ); |
67 | 67 | $expected_centroid = array("lng"=>67.3333333333333285963817615993320941925048828125, "lat" =>54.0, "elv"=>0); |
68 | 68 | |
69 | 69 | $jjwgAreas->retrieve(); |
70 | 70 | |
71 | - $this->assertSame($expected_polygon ,$jjwgAreas->polygon); |
|
72 | - $this->assertEquals(20,$jjwgAreas->area); |
|
73 | - $this->assertSame($expected_centroid,$jjwgAreas->centroid); |
|
71 | + $this->assertSame($expected_polygon, $jjwgAreas->polygon); |
|
72 | + $this->assertEquals(20, $jjwgAreas->area); |
|
73 | + $this->assertSame($expected_centroid, $jjwgAreas->centroid); |
|
74 | 74 | |
75 | 75 | } |
76 | 76 | |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | |
86 | 86 | |
87 | 87 | //test with required attributes preset |
88 | - $jjwgAreas->coordinates= "100,80,10\r\n101,81,11\r\n102,82,12"; |
|
89 | - $expected = array ( |
|
90 | - array ('lng' => '100', 'lat' => '80','elv' => '10' ), |
|
91 | - array ('lng' => '101', 'lat' => '81', 'elv' => '11'), |
|
92 | - array ('lng' => '102', 'lat' => '82', 'elv' => '12' ) |
|
88 | + $jjwgAreas->coordinates = "100,80,10\r\n101,81,11\r\n102,82,12"; |
|
89 | + $expected = array( |
|
90 | + array('lng' => '100', 'lat' => '80', 'elv' => '10'), |
|
91 | + array('lng' => '101', 'lat' => '81', 'elv' => '11'), |
|
92 | + array('lng' => '102', 'lat' => '82', 'elv' => '12') |
|
93 | 93 | ); |
94 | 94 | $actual = $jjwgAreas->define_polygon(); |
95 | 95 | $this->assertSame($actual, $expected); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | //test with required attributes preset |
112 | 112 | $jjwgAreas->name = "test"; |
113 | - $jjwgAreas->centroid = array("lng"=> 100 , "lat"=> 50); |
|
113 | + $jjwgAreas->centroid = array("lng"=> 100, "lat"=> 50); |
|
114 | 114 | |
115 | 115 | $expected = array("name"=>"test", "lat"=>50, "lng"=>100); |
116 | 116 | $result = $jjwgAreas->define_area_loc(); |
@@ -129,11 +129,11 @@ discard block |
||
129 | 129 | |
130 | 130 | |
131 | 131 | //test with coordinates setup |
132 | - $jjwgAreas->coordinates= "100,80,10\r\n101,81,11\r\n102,82,12"; |
|
132 | + $jjwgAreas->coordinates = "100,80,10\r\n101,81,11\r\n102,82,12"; |
|
133 | 133 | $expected = array("lng"=>67.3333333333333285963817615993320941925048828125, "lat" =>54.0, "elv"=>0); |
134 | 134 | |
135 | 135 | $result = $jjwgAreas->define_centroid(); |
136 | - $this->assertSame($expected,$result); |
|
136 | + $this->assertSame($expected, $result); |
|
137 | 137 | |
138 | 138 | } |
139 | 139 | |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | |
149 | 149 | |
150 | 150 | //test with coordinates setup |
151 | - $jjwgAreas->coordinates= "100,80,10\r\n101,81,11\r\n102,82,12"; |
|
151 | + $jjwgAreas->coordinates = "100,80,10\r\n101,81,11\r\n102,82,12"; |
|
152 | 152 | |
153 | 153 | $result = $jjwgAreas->define_area(); |
154 | - $this->assertEquals(20,$result); |
|
154 | + $this->assertEquals(20, $result); |
|
155 | 155 | |
156 | 156 | } |
157 | 157 | |
@@ -180,13 +180,13 @@ discard block |
||
180 | 180 | $jjwgAreas = new jjwg_Areas(); |
181 | 181 | |
182 | 182 | //test with invalid values |
183 | - $this->assertEquals(false, $jjwgAreas->is_valid_lng('') ); |
|
184 | - $this->assertEquals(false, $jjwgAreas->is_valid_lng(181) ); |
|
185 | - $this->assertEquals(false, $jjwgAreas->is_valid_lng(-181) ); |
|
183 | + $this->assertEquals(false, $jjwgAreas->is_valid_lng('')); |
|
184 | + $this->assertEquals(false, $jjwgAreas->is_valid_lng(181)); |
|
185 | + $this->assertEquals(false, $jjwgAreas->is_valid_lng(-181)); |
|
186 | 186 | |
187 | 187 | //test with valid values |
188 | - $this->assertEquals(true, $jjwgAreas->is_valid_lng(180) ); |
|
189 | - $this->assertEquals(true, $jjwgAreas->is_valid_lng(-180) ); |
|
188 | + $this->assertEquals(true, $jjwgAreas->is_valid_lng(180)); |
|
189 | + $this->assertEquals(true, $jjwgAreas->is_valid_lng(-180)); |
|
190 | 190 | |
191 | 191 | } |
192 | 192 | |
@@ -196,13 +196,13 @@ discard block |
||
196 | 196 | $jjwgAreas = new jjwg_Areas(); |
197 | 197 | |
198 | 198 | //test with invalid values |
199 | - $this->assertEquals(false, $jjwgAreas->is_valid_lat('') ); |
|
200 | - $this->assertEquals(false, $jjwgAreas->is_valid_lat(91) ); |
|
201 | - $this->assertEquals(false, $jjwgAreas->is_valid_lat(-91) ); |
|
199 | + $this->assertEquals(false, $jjwgAreas->is_valid_lat('')); |
|
200 | + $this->assertEquals(false, $jjwgAreas->is_valid_lat(91)); |
|
201 | + $this->assertEquals(false, $jjwgAreas->is_valid_lat(-91)); |
|
202 | 202 | |
203 | 203 | //test with valid values |
204 | - $this->assertEquals(true, $jjwgAreas->is_valid_lat(90) ); |
|
205 | - $this->assertEquals(true, $jjwgAreas->is_valid_lat(-90) ); |
|
204 | + $this->assertEquals(true, $jjwgAreas->is_valid_lat(90)); |
|
205 | + $this->assertEquals(true, $jjwgAreas->is_valid_lat(-90)); |
|
206 | 206 | |
207 | 207 | } |
208 | 208 | |
@@ -214,11 +214,11 @@ discard block |
||
214 | 214 | $marker = array("name"=>"test", "lat"=>100, "lng"=>40); |
215 | 215 | |
216 | 216 | //test without setting up coordinates |
217 | - $this->assertEquals(false, $jjwgAreas->is_marker_in_area($marker) ); |
|
217 | + $this->assertEquals(false, $jjwgAreas->is_marker_in_area($marker)); |
|
218 | 218 | |
219 | 219 | //test with coordinates set |
220 | - $jjwgAreas->coordinates= "100,40,0.0 101,81,0.0 102,32,0.0"; |
|
221 | - $this->assertEquals(false, $jjwgAreas->is_marker_in_area($marker) ); |
|
220 | + $jjwgAreas->coordinates = "100,40,0.0 101,81,0.0 102,32,0.0"; |
|
221 | + $this->assertEquals(false, $jjwgAreas->is_marker_in_area($marker)); |
|
222 | 222 | |
223 | 223 | } |
224 | 224 | |
@@ -227,13 +227,13 @@ discard block |
||
227 | 227 | $jjwgAreas = new jjwg_Areas(); |
228 | 228 | |
229 | 229 | //test without setting up coordinates |
230 | - $this->assertEquals(false, $jjwgAreas->is_point_in_area(100,40) ); |
|
230 | + $this->assertEquals(false, $jjwgAreas->is_point_in_area(100, 40)); |
|
231 | 231 | |
232 | 232 | |
233 | 233 | //test with coordinates set |
234 | - $jjwgAreas->coordinates= "100,40,10 101,81,11 102,82,12"; |
|
235 | - $this->assertEquals(false, $jjwgAreas->is_point_in_area(101,40) ); |
|
236 | - $this->assertEquals(true, $jjwgAreas->is_point_in_area(100,40) ); |
|
234 | + $jjwgAreas->coordinates = "100,40,10 101,81,11 102,82,12"; |
|
235 | + $this->assertEquals(false, $jjwgAreas->is_point_in_area(101, 40)); |
|
236 | + $this->assertEquals(true, $jjwgAreas->is_point_in_area(100, 40)); |
|
237 | 237 | |
238 | 238 | } |
239 | 239 | |
@@ -243,12 +243,12 @@ discard block |
||
243 | 243 | $jjwgAreas = new jjwg_Areas(); |
244 | 244 | |
245 | 245 | //test without setting up coordinates |
246 | - $this->assertEquals(false, $jjwgAreas->point_in_polygon('100,40,0.0') ); |
|
246 | + $this->assertEquals(false, $jjwgAreas->point_in_polygon('100,40,0.0')); |
|
247 | 247 | |
248 | 248 | |
249 | 249 | //test with coordinates set |
250 | - $jjwgAreas->coordinates= "100,40,10 101,81,11 102,82,12"; |
|
251 | - $this->assertEquals(true, $jjwgAreas->point_in_polygon('100,40,0.0') ); |
|
250 | + $jjwgAreas->coordinates = "100,40,10 101,81,11 102,82,12"; |
|
251 | + $this->assertEquals(true, $jjwgAreas->point_in_polygon('100,40,0.0')); |
|
252 | 252 | |
253 | 253 | } |
254 | 254 | |
@@ -256,9 +256,9 @@ discard block |
||
256 | 256 | |
257 | 257 | $jjwgAreas = new jjwg_Areas(); |
258 | 258 | |
259 | - $vertices= array("100,40,10", "101,81,11", "102,82,12"); |
|
260 | - $this->assertEquals(false, $jjwgAreas->point_on_vertex("100,40,0.0",$vertices)); |
|
261 | - $this->assertEquals(true, $jjwgAreas->point_on_vertex("100,40,10",$vertices)); |
|
259 | + $vertices = array("100,40,10", "101,81,11", "102,82,12"); |
|
260 | + $this->assertEquals(false, $jjwgAreas->point_on_vertex("100,40,0.0", $vertices)); |
|
261 | + $this->assertEquals(true, $jjwgAreas->point_on_vertex("100,40,10", $vertices)); |
|
262 | 262 | |
263 | 263 | } |
264 | 264 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | |
267 | 267 | $jjwgAreas = new jjwg_Areas(); |
268 | 268 | |
269 | - $expected = array("x"=>100,"y"=>40); |
|
269 | + $expected = array("x"=>100, "y"=>40); |
|
270 | 270 | $actual = $jjwgAreas->point_string_to_coordinates("100,40,10"); |
271 | 271 | $this->assertEquals($expected, $actual); |
272 | 272 |
@@ -7,16 +7,16 @@ discard block |
||
7 | 7 | |
8 | 8 | //execute the contructor and check for the Object type and type attribute |
9 | 9 | $admin = new Administration(); |
10 | - $this->assertInstanceOf('Administration',$admin); |
|
11 | - $this->assertInstanceOf('SugarBean',$admin); |
|
10 | + $this->assertInstanceOf('Administration', $admin); |
|
11 | + $this->assertInstanceOf('SugarBean', $admin); |
|
12 | 12 | |
13 | 13 | $this->assertAttributeEquals('Administration', 'module_dir', $admin); |
14 | 14 | $this->assertAttributeEquals('Administration', 'object_name', $admin); |
15 | 15 | $this->assertAttributeEquals('config', 'table_name', $admin); |
16 | 16 | $this->assertAttributeEquals(true, 'new_schema', $admin); |
17 | 17 | $this->assertAttributeEquals(true, 'disable_custom_fields', $admin); |
18 | - $this->assertAttributeEquals( array('disclosure', 'notify','system','portal','proxy','massemailer','ldap','captcha','sugarpdf') , 'config_categories', $admin); |
|
19 | - $this->assertAttributeEquals( array("notify_send_by_default", "mail_smtpauth_req", "notify_on", 'portal_on', 'skypeout_on', 'system_mailmerge_on', 'proxy_auth', 'proxy_on', 'system_ldap_enabled','captcha_on') , 'checkbox_fields', $admin); |
|
18 | + $this->assertAttributeEquals(array('disclosure', 'notify', 'system', 'portal', 'proxy', 'massemailer', 'ldap', 'captcha', 'sugarpdf'), 'config_categories', $admin); |
|
19 | + $this->assertAttributeEquals(array("notify_send_by_default", "mail_smtpauth_req", "notify_on", 'portal_on', 'skypeout_on', 'system_mailmerge_on', 'proxy_auth', 'proxy_on', 'system_ldap_enabled', 'captcha_on'), 'checkbox_fields', $admin); |
|
20 | 20 | |
21 | 21 | } |
22 | 22 | |
@@ -26,31 +26,31 @@ discard block |
||
26 | 26 | |
27 | 27 | //execute with default parameters and test if it returns object itself |
28 | 28 | $result = $admin->retrieveSettings(); |
29 | - $this->assertInstanceOf('Administration',$result); |
|
30 | - $this->assertSame($admin,$result); |
|
29 | + $this->assertInstanceOf('Administration', $result); |
|
30 | + $this->assertSame($admin, $result); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | |
34 | 34 | //execute with a invalid category and test if it returns object itself. |
35 | 35 | $result = $admin->retrieveSettings('test'); |
36 | - $this->assertInstanceOf('Administration',$result); |
|
37 | - $this->assertSame($admin,$result); |
|
38 | - $this->assertEquals(true,$admin->settings['test']); |
|
36 | + $this->assertInstanceOf('Administration', $result); |
|
37 | + $this->assertSame($admin, $result); |
|
38 | + $this->assertEquals(true, $admin->settings['test']); |
|
39 | 39 | |
40 | 40 | |
41 | 41 | |
42 | 42 | //execute with a valid category and test if it returns object itself. |
43 | 43 | $result = $admin->retrieveSettings('notify'); |
44 | - $this->assertInstanceOf('Administration',$result); |
|
45 | - $this->assertSame($admin,$result); |
|
44 | + $this->assertInstanceOf('Administration', $result); |
|
45 | + $this->assertSame($admin, $result); |
|
46 | 46 | |
47 | 47 | |
48 | 48 | |
49 | 49 | //execute with a valid category and clean=true and test if it returns object itself. |
50 | 50 | $admin = new Administration(); |
51 | - $result = $admin->retrieveSettings('notify',true); |
|
52 | - $this->assertInstanceOf('Administration',$result); |
|
53 | - $this->assertSame($admin,$result); |
|
51 | + $result = $admin->retrieveSettings('notify', true); |
|
52 | + $this->assertInstanceOf('Administration', $result); |
|
53 | + $this->assertSame($admin, $result); |
|
54 | 54 | |
55 | 55 | |
56 | 56 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | //execute the method and verify that it sets the correct config key |
65 | 65 | $admin->saveConfig(); |
66 | 66 | $actual = $admin->settings['proxy_test']; |
67 | - $this->assertEquals($actual, "test value" ); |
|
67 | + $this->assertEquals($actual, "test value"); |
|
68 | 68 | |
69 | 69 | } |
70 | 70 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $result = $admin->saveSetting('category', 'key', 'test value'); |
77 | 77 | $admin->retrieveSettings('category'); |
78 | 78 | $actual = $admin->settings['category_key']; |
79 | - $this->assertEquals($actual, "test value" ); |
|
79 | + $this->assertEquals($actual, "test value"); |
|
80 | 80 | |
81 | 81 | } |
82 | 82 |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | |
10 | 10 | //execute the contructor and check for the Object type and attributes |
11 | 11 | $email = new Email(); |
12 | - $this->assertInstanceOf('Email',$email); |
|
13 | - $this->assertInstanceOf('SugarBean',$email); |
|
12 | + $this->assertInstanceOf('Email', $email); |
|
13 | + $this->assertInstanceOf('SugarBean', $email); |
|
14 | 14 | |
15 | 15 | $this->assertAttributeEquals('Emails', 'module_dir', $email); |
16 | 16 | $this->assertAttributeEquals('Email', 'object_name', $email); |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | $email = new Email(); |
30 | 30 | $email->email2init(); |
31 | 31 | |
32 | - $this->assertInstanceOf('EmailUI',$email->et); |
|
32 | + $this->assertInstanceOf('EmailUI', $email->et); |
|
33 | 33 | |
34 | 34 | } |
35 | 35 | |
36 | - public function testbean_implements(){ |
|
36 | + public function testbean_implements() { |
|
37 | 37 | |
38 | 38 | $email = new Email(); |
39 | 39 | $this->assertEquals(false, $email->bean_implements('')); //test with blank value |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | |
57 | 57 | $email = new Email(); |
58 | 58 | |
59 | - $this->assertEquals(false,$email->safeAttachmentName("test.ext")); |
|
60 | - $this->assertEquals(false,$email->safeAttachmentName("test.exe")); |
|
61 | - $this->assertEquals(true,$email->safeAttachmentName("test.cgi")); |
|
59 | + $this->assertEquals(false, $email->safeAttachmentName("test.ext")); |
|
60 | + $this->assertEquals(false, $email->safeAttachmentName("test.exe")); |
|
61 | + $this->assertEquals(true, $email->safeAttachmentName("test.cgi")); |
|
62 | 62 | |
63 | 63 | } |
64 | 64 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | $email->email2init(); |
72 | 72 | $addresses = "abc<[email protected]>,xyz<[email protected]>"; |
73 | - $expected = array (array('email' =>'[email protected]', 'display' => 'abc'), array('email' => '[email protected]','display' => 'xyz')); |
|
73 | + $expected = array(array('email' =>'[email protected]', 'display' => 'abc'), array('email' => '[email protected]', 'display' => 'xyz')); |
|
74 | 74 | |
75 | 75 | $result = $email->email2ParseAddresses($addresses); |
76 | 76 | $this->assertSame($expected, $result); |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | //test with simplest format |
86 | 86 | $addresses = "[email protected],[email protected]"; |
87 | 87 | $result = $email->email2ParseAddressesForAddressesOnly($addresses); |
88 | - $this->assertEquals(array("[email protected]", "[email protected]"), $result ); |
|
88 | + $this->assertEquals(array("[email protected]", "[email protected]"), $result); |
|
89 | 89 | |
90 | 90 | //test with more used format |
91 | 91 | $addresses = "abc<[email protected]>,xyz<[email protected]>"; |
92 | 92 | $result = $email->email2ParseAddressesForAddressesOnly($addresses); |
93 | - $this->assertEquals(array("[email protected]", "[email protected]"), $result ); |
|
93 | + $this->assertEquals(array("[email protected]", "[email protected]"), $result); |
|
94 | 94 | |
95 | 95 | } |
96 | 96 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | //test without a filename |
104 | 104 | $result = $email->email2GetMime(); |
105 | - $this->assertEquals("application/octet-stream", $result ); |
|
105 | + $this->assertEquals("application/octet-stream", $result); |
|
106 | 106 | |
107 | 107 | //test with a filename |
108 | 108 | $result = $email->email2GetMime('config.php'); |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | |
116 | 116 | $email = new Email(); |
117 | 117 | |
118 | - $this->assertEquals("some text", $email->decodeDuringSend("some text") ); |
|
119 | - $this->assertEquals("< some text >", $email->decodeDuringSend("sugarLessThan some text sugarGreaterThan") ); |
|
118 | + $this->assertEquals("some text", $email->decodeDuringSend("some text")); |
|
119 | + $this->assertEquals("< some text >", $email->decodeDuringSend("sugarLessThan some text sugarGreaterThan")); |
|
120 | 120 | |
121 | 121 | } |
122 | 122 | |
@@ -126,17 +126,17 @@ discard block |
||
126 | 126 | $email = new Email(); |
127 | 127 | |
128 | 128 | //test with required parametr set |
129 | - $this->assertEquals(true, $email->isDraftEmail(array('saveDraft'=>'1')) ); |
|
129 | + $this->assertEquals(true, $email->isDraftEmail(array('saveDraft'=>'1'))); |
|
130 | 130 | |
131 | 131 | |
132 | 132 | //test with one of required attribute set |
133 | 133 | $email->type = 'draft'; |
134 | - $this->assertEquals(false, $email->isDraftEmail()); |
|
134 | + $this->assertEquals(false, $email->isDraftEmail()); |
|
135 | 135 | |
136 | 136 | |
137 | 137 | //test with both of required attribute set |
138 | 138 | $email->status = 'draft'; |
139 | - $this->assertEquals(true, $email->isDraftEmail()); |
|
139 | + $this->assertEquals(true, $email->isDraftEmail()); |
|
140 | 140 | |
141 | 141 | } |
142 | 142 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $this->assertEquals("", $result); |
160 | 160 | |
161 | 161 | //test with valid array |
162 | - $result = $email->_arrayToDelimitedString(array('value1','value2')); |
|
162 | + $result = $email->_arrayToDelimitedString(array('value1', 'value2')); |
|
163 | 163 | $this->assertEquals("value1,value2", $result); |
164 | 164 | |
165 | 165 | } |
@@ -305,10 +305,10 @@ discard block |
||
305 | 305 | //retrieve and verify that email addresses were saved properly |
306 | 306 | $email->retrieveEmailAddresses(); |
307 | 307 | |
308 | - $this->assertNotSame(false, strpos($email->from_addr, "[email protected]") ); |
|
309 | - $this->assertNotSame(false, strpos($email->to_addrs, "[email protected]") ); |
|
310 | - $this->assertNotSame(false, strpos($email->cc_addrs, "[email protected]") ); |
|
311 | - $this->assertNotSame(false, strpos($email->bcc_addrs, "[email protected]") ); |
|
308 | + $this->assertNotSame(false, strpos($email->from_addr, "[email protected]")); |
|
309 | + $this->assertNotSame(false, strpos($email->to_addrs, "[email protected]")); |
|
310 | + $this->assertNotSame(false, strpos($email->cc_addrs, "[email protected]")); |
|
311 | + $this->assertNotSame(false, strpos($email->bcc_addrs, "[email protected]")); |
|
312 | 312 | |
313 | 313 | } |
314 | 314 | |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | $email = $email->retrieve($id); |
369 | 369 | |
370 | 370 | $email->type = 'out'; |
371 | - $email->status ='draft'; |
|
371 | + $email->status = 'draft'; |
|
372 | 372 | $_REQUEST['record'] = $id; |
373 | 373 | |
374 | 374 | $email->handleAttachments(); |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | $email->delete($id); |
386 | 386 | |
387 | 387 | $result = $email->retrieve($id); |
388 | - $this->assertEquals(null,$result); |
|
388 | + $this->assertEquals(null, $result); |
|
389 | 389 | |
390 | 390 | } |
391 | 391 | |
@@ -398,22 +398,22 @@ discard block |
||
398 | 398 | $email->id = 1; |
399 | 399 | |
400 | 400 | //test saveTempNoteAttachments method to create a note for email |
401 | - $email->saveTempNoteAttachments("test_file","test", "text/plain"); |
|
401 | + $email->saveTempNoteAttachments("test_file", "test", "text/plain"); |
|
402 | 402 | |
403 | 403 | |
404 | 404 | |
405 | 405 | //test doesImportedEmailHaveAttachment method to verify note created. |
406 | 406 | $result = $email->doesImportedEmailHaveAttachment($email->id); |
407 | - $this->assertEquals(1,$result); |
|
407 | + $this->assertEquals(1, $result); |
|
408 | 408 | |
409 | 409 | |
410 | 410 | |
411 | 411 | //test getNotes method and verify that it retrieves the created note. |
412 | 412 | $email->getNotes($email->id); |
413 | 413 | $this->assertTrue(is_array($email->attachments)); |
414 | - foreach($email->attachments as $note){ |
|
414 | + foreach ($email->attachments as $note) { |
|
415 | 415 | $this->assertTrue(isset($note)); |
416 | - $this->assertInstanceOf('Note',$note); |
|
416 | + $this->assertInstanceOf('Note', $note); |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | //test with more used format |
437 | 437 | $addresses = "abc<[email protected]>,xyz<[email protected]>"; |
438 | 438 | $result = $email->cleanEmails($addresses); |
439 | - $this->assertEquals('abc <[email protected]>, xyz <[email protected]>', $result ); |
|
439 | + $this->assertEquals('abc <[email protected]>, xyz <[email protected]>', $result); |
|
440 | 440 | |
441 | 441 | } |
442 | 442 | |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | $email = new Email(); |
606 | 606 | |
607 | 607 | $result = $email->getUserEditorPreference(); |
608 | - $this->assertEquals("html",$result); |
|
608 | + $this->assertEquals("html", $result); |
|
609 | 609 | |
610 | 610 | } |
611 | 611 | |
@@ -618,9 +618,9 @@ discard block |
||
618 | 618 | $addrs_names = "abc;xyz"; |
619 | 619 | $addrs_emails = "[email protected];[email protected]"; |
620 | 620 | |
621 | - $expected = array( array ('email' => '[email protected]', 'display' => 'abc', 'contact_id' => '1' ), array ('email' => '[email protected]', 'display' => 'xyz', 'contact_id' => '2' ) ); |
|
621 | + $expected = array(array('email' => '[email protected]', 'display' => 'abc', 'contact_id' => '1'), array('email' => '[email protected]', 'display' => 'xyz', 'contact_id' => '2')); |
|
622 | 622 | |
623 | - $actual = $email->parse_addrs($addrs , $addrs_ids, $addrs_names, $addrs_emails); |
|
623 | + $actual = $email->parse_addrs($addrs, $addrs_ids, $addrs_names, $addrs_emails); |
|
624 | 624 | |
625 | 625 | $this->assertSame($expected, $actual); |
626 | 626 | |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | |
639 | 639 | |
640 | 640 | //test for array without empty values |
641 | - $expected = array("val1","val2"); |
|
641 | + $expected = array("val1", "val2"); |
|
642 | 642 | $fields = array("val1", "val2"); |
643 | 643 | $actual = $email->remove_empty_fields($fields); |
644 | 644 | $this->assertSame($expected, $actual); |
@@ -654,12 +654,12 @@ discard block |
||
654 | 654 | $email->description = "some text with sign"; |
655 | 655 | |
656 | 656 | //test for strings with signature present |
657 | - $sig = array("signature_html"=>"sign", "signature"=>"sign" ); |
|
657 | + $sig = array("signature_html"=>"sign", "signature"=>"sign"); |
|
658 | 658 | $result = $email->hasSignatureInBody($sig); |
659 | 659 | $this->assertEquals(true, $result); |
660 | 660 | |
661 | 661 | //test for strings with signature absent |
662 | - $sig = array("signature_html"=>"signature", "signature"=>"signature" ); |
|
662 | + $sig = array("signature_html"=>"signature", "signature"=>"signature"); |
|
663 | 663 | $result = $email->hasSignatureInBody($sig); |
664 | 664 | $this->assertEquals(false, $result); |
665 | 665 | |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | |
687 | 687 | //test without assigned_user_id in url |
688 | 688 | $url = "index.php?module=Users&offset=6&stamp=1453274421025259800&return_module=Users&action=DetailView&record=seed_max_id"; |
689 | - $expected = array ( |
|
689 | + $expected = array( |
|
690 | 690 | 'module' => 'Users', |
691 | 691 | 'action' => 'DetailView', |
692 | 692 | 'group' => '', |
@@ -697,13 +697,13 @@ discard block |
||
697 | 697 | 'return_module' => 'Users', |
698 | 698 | ); |
699 | 699 | $actual = $email->getStartPage($url); |
700 | - $this->assertSame($expected,$actual); |
|
700 | + $this->assertSame($expected, $actual); |
|
701 | 701 | |
702 | 702 | |
703 | 703 | |
704 | 704 | //test with assigned_user_id in url |
705 | 705 | $url = "index.php?module=Users&offset=6&stamp=1453274421025259800&return_module=Users&action=DetailView&record=seed_max_id&assigned_user_id=1"; |
706 | - $expected = array ( |
|
706 | + $expected = array( |
|
707 | 707 | 'module' => 'Users', |
708 | 708 | 'action' => 'DetailView', |
709 | 709 | 'group' => '', |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | 'current_view' => 'DetailView&module=Users&assigned_user_id=1&type=' |
717 | 717 | ); |
718 | 718 | $actual = $email->getStartPage($url); |
719 | - $this->assertSame($expected,$actual); |
|
719 | + $this->assertSame($expected, $actual); |
|
720 | 720 | |
721 | 721 | } |
722 | 722 | |
@@ -726,10 +726,10 @@ discard block |
||
726 | 726 | |
727 | 727 | $email = new Email(); |
728 | 728 | |
729 | - $result = $email->setMailer(new SugarPHPMailer(),'',''); |
|
729 | + $result = $email->setMailer(new SugarPHPMailer(), '', ''); |
|
730 | 730 | |
731 | - $this->assertInstanceOf('SugarPHPMailer',$result); |
|
732 | - $this->assertInstanceOf('OutboundEmail',$result->oe); |
|
731 | + $this->assertInstanceOf('SugarPHPMailer', $result); |
|
732 | + $this->assertInstanceOf('OutboundEmail', $result->oe); |
|
733 | 733 | |
734 | 734 | } |
735 | 735 | |
@@ -745,18 +745,18 @@ discard block |
||
745 | 745 | $result = $email->handleBody(new SugarPHPMailer()); |
746 | 746 | |
747 | 747 | $this->assertEquals("some email description containing email text & ' \n ", $email->description); |
748 | - $this->assertInstanceOf('SugarPHPMailer',$result); |
|
748 | + $this->assertInstanceOf('SugarPHPMailer', $result); |
|
749 | 749 | |
750 | 750 | |
751 | 751 | //test with REQUEST parameters set |
752 | - $_REQUEST['setEditor'] =1; |
|
752 | + $_REQUEST['setEditor'] = 1; |
|
753 | 753 | $_REQUEST['description_html'] = "1"; |
754 | 754 | $email->description_html = "some email description containing email text & ' <br> "; |
755 | 755 | |
756 | 756 | $result = $email->handleBody(new SugarPHPMailer()); |
757 | 757 | |
758 | 758 | $this->assertEquals("some email description containing email text & ' \n ", $email->description); |
759 | - $this->assertInstanceOf('SugarPHPMailer',$result); |
|
759 | + $this->assertInstanceOf('SugarPHPMailer', $result); |
|
760 | 760 | |
761 | 761 | } |
762 | 762 | |
@@ -778,13 +778,13 @@ discard block |
||
778 | 778 | |
779 | 779 | |
780 | 780 | |
781 | - public function testlistviewACLHelper(){ |
|
781 | + public function testlistviewACLHelper() { |
|
782 | 782 | |
783 | 783 | $email = new Email(); |
784 | 784 | |
785 | - $expected = array("MAIN"=>"a", "PARENT"=>"a", "CONTACT"=>"a" ); |
|
785 | + $expected = array("MAIN"=>"a", "PARENT"=>"a", "CONTACT"=>"a"); |
|
786 | 786 | $actual = $email->listviewACLHelper(); |
787 | - $this->assertSame($expected,$actual); |
|
787 | + $this->assertSame($expected, $actual); |
|
788 | 788 | |
789 | 789 | } |
790 | 790 | |
@@ -792,10 +792,10 @@ discard block |
||
792 | 792 | |
793 | 793 | $email = new Email(); |
794 | 794 | |
795 | - $expected = array( 'email' => '[email protected]', 'name' => 'SuiteCRM'); |
|
795 | + $expected = array('email' => '[email protected]', 'name' => 'SuiteCRM'); |
|
796 | 796 | $actual = $email->getSystemDefaultEmail(); |
797 | 797 | |
798 | - $this->assertSame($expected,$actual); |
|
798 | + $this->assertSame($expected, $actual); |
|
799 | 799 | |
800 | 800 | } |
801 | 801 | |
@@ -806,14 +806,14 @@ discard block |
||
806 | 806 | |
807 | 807 | //test with empty string params |
808 | 808 | $expected = "SELECT emails.*, users.user_name as assigned_user_name\n FROM emails\n LEFT JOIN users ON emails.assigned_user_id=users.id \nWHERE emails.deleted=0 \n ORDER BY date_sent DESC"; |
809 | - $actual = $email->create_new_list_query('',''); |
|
810 | - $this->assertSame($expected,$actual); |
|
809 | + $actual = $email->create_new_list_query('', ''); |
|
810 | + $this->assertSame($expected, $actual); |
|
811 | 811 | |
812 | 812 | |
813 | 813 | //test with valid string params |
814 | 814 | $expected = "SELECT emails.*, users.user_name as assigned_user_name\n FROM emails\n LEFT JOIN users ON emails.assigned_user_id=users.id \nWHERE users.user_name = \"\" AND emails.deleted=0 \n ORDER BY emails.id"; |
815 | - $actual = $email->create_new_list_query('emails.id','users.user_name = ""'); |
|
816 | - $this->assertSame($expected,$actual); |
|
815 | + $actual = $email->create_new_list_query('emails.id', 'users.user_name = ""'); |
|
816 | + $this->assertSame($expected, $actual); |
|
817 | 817 | |
818 | 818 | } |
819 | 819 | |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | $email->fill_in_additional_list_fields(); |
830 | 830 | |
831 | 831 | $this->assertEquals('DetailView', $email->link_action); |
832 | - $this->assertEquals('', $email->attachment_image ); |
|
832 | + $this->assertEquals('', $email->attachment_image); |
|
833 | 833 | |
834 | 834 | |
835 | 835 | } |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | $email->fill_in_additional_list_fields(); |
847 | 847 | |
848 | 848 | $this->assertEquals('Administrator', $email->created_by_name); |
849 | - $this->assertEquals('Administrator', $email->modified_by_name ); |
|
849 | + $this->assertEquals('Administrator', $email->modified_by_name); |
|
850 | 850 | $this->assertEquals('', $email->type_name); |
851 | 851 | $this->assertEquals('', $email->name); |
852 | 852 | $this->assertEquals('DetailView', $email->link_action); |
@@ -862,13 +862,13 @@ discard block |
||
862 | 862 | |
863 | 863 | //test with empty string params |
864 | 864 | $expected = "SELECT emails.* FROM emails where emails.deleted=0 ORDER BY emails.name"; |
865 | - $actual = $email->create_export_query('',''); |
|
866 | - $this->assertSame($expected,$actual); |
|
865 | + $actual = $email->create_export_query('', ''); |
|
866 | + $this->assertSame($expected, $actual); |
|
867 | 867 | |
868 | 868 | //test with valid string params |
869 | 869 | $expected = "SELECT emails.* FROM emails where users.user_name = \"\" AND emails.deleted=0 ORDER BY emails.id"; |
870 | - $actual = $email->create_export_query('emails.id','users.user_name = ""'); |
|
871 | - $this->assertSame($expected,$actual); |
|
870 | + $actual = $email->create_export_query('emails.id', 'users.user_name = ""'); |
|
871 | + $this->assertSame($expected, $actual); |
|
872 | 872 | |
873 | 873 | } |
874 | 874 | |
@@ -883,7 +883,7 @@ discard block |
||
883 | 883 | $email->link_action = "DetailView"; |
884 | 884 | $email->type_name = "out"; |
885 | 885 | |
886 | - $expected = array ( |
|
886 | + $expected = array( |
|
887 | 887 | 'ID' => 1, |
888 | 888 | 'FROM_ADDR_NAME' => 'Admin', |
889 | 889 | 'TYPE' => 'Archived', |
@@ -900,10 +900,10 @@ discard block |
||
900 | 900 | ); |
901 | 901 | |
902 | 902 | $actual = $email->get_list_view_data(); |
903 | - foreach($expected as $expectedKey => $expectedVal){ |
|
904 | - if($expectedKey == 'CREATE_RELATED'){ |
|
905 | - $this->assertRegExp($expected[$expectedKey],$actual[$expectedKey]); |
|
906 | - }else { |
|
903 | + foreach ($expected as $expectedKey => $expectedVal) { |
|
904 | + if ($expectedKey == 'CREATE_RELATED') { |
|
905 | + $this->assertRegExp($expected[$expectedKey], $actual[$expectedKey]); |
|
906 | + } else { |
|
907 | 907 | $this->assertSame($expected[$expectedKey], $actual[$expectedKey]); |
908 | 908 | } |
909 | 909 | } |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | ."~"; |
920 | 920 | |
921 | 921 | $actual = $email->quickCreateForm(); |
922 | - $this->assertRegExp($expected,$actual); |
|
922 | + $this->assertRegExp($expected, $actual); |
|
923 | 923 | } |
924 | 924 | |
925 | 925 | |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | |
941 | 941 | $expected = "SELECT emails.id , emails.mailbox_id, emails.name, emails.date_sent, emails.status, emails.type, emails.flagged, emails.reply_to_status,\n emails_text.from_addr, emails_text.to_addrs FROM emails JOIN emails_text on emails.id = emails_text.email_id WHERE (emails.type= 'inbound' OR emails.type='archived' OR emails.type='out') AND emails.deleted = 0 "; |
942 | 942 | $actual = $email->_genereateSearchImportedEmailsQuery(); |
943 | - $this->assertSame($expected,$actual); |
|
943 | + $this->assertSame($expected, $actual); |
|
944 | 944 | |
945 | 945 | } |
946 | 946 | |
@@ -953,30 +953,30 @@ discard block |
||
953 | 953 | //test without request params |
954 | 954 | $expected = ""; |
955 | 955 | $actual = $email->_generateSearchImportWhereClause(); |
956 | - $this->assertSame($expected,$actual); |
|
956 | + $this->assertSame($expected, $actual); |
|
957 | 957 | |
958 | 958 | |
959 | 959 | //test with searchDateFrom request param only |
960 | - $_REQUEST['searchDateFrom']= "2015-01-01 00:00:00"; |
|
960 | + $_REQUEST['searchDateFrom'] = "2015-01-01 00:00:00"; |
|
961 | 961 | $expected = "emails.date_sent >= '' "; |
962 | 962 | $actual = $email->_generateSearchImportWhereClause(); |
963 | - $this->assertSame($expected,$actual); |
|
963 | + $this->assertSame($expected, $actual); |
|
964 | 964 | |
965 | 965 | |
966 | 966 | //test with searchDateTo request param only |
967 | 967 | $_REQUEST['searchDateFrom'] = ""; |
968 | - $_REQUEST['searchDateTo']= "2015-01-01 00:00:00"; |
|
968 | + $_REQUEST['searchDateTo'] = "2015-01-01 00:00:00"; |
|
969 | 969 | $expected = "emails.date_sent <= '' "; |
970 | 970 | $actual = $email->_generateSearchImportWhereClause(); |
971 | - $this->assertSame($expected,$actual); |
|
971 | + $this->assertSame($expected, $actual); |
|
972 | 972 | |
973 | 973 | |
974 | 974 | //test with both request params |
975 | - $_REQUEST['searchDateFrom']= "2015-01-01 00:00:00"; |
|
976 | - $_REQUEST['searchDateTo']= "2015-01-01 00:00:00"; |
|
975 | + $_REQUEST['searchDateFrom'] = "2015-01-01 00:00:00"; |
|
976 | + $_REQUEST['searchDateTo'] = "2015-01-01 00:00:00"; |
|
977 | 977 | $expected = "( emails.date_sent >= '' AND\n emails.date_sent <= '' )"; |
978 | 978 | $actual = $email->_generateSearchImportWhereClause(); |
979 | - $this->assertSame($expected,$actual); |
|
979 | + $this->assertSame($expected, $actual); |
|
980 | 980 | |
981 | 981 | } |
982 | 982 | |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | |
988 | 988 | $this->assertEquals("test string", $email->trimLongTo("test string")); //test without any separator |
989 | 989 | $this->assertEquals("test string 1...", $email->trimLongTo("test string 1, test string2")); //test with , separator |
990 | - $this->assertEquals("test string 1...", $email->trimLongTo("test string 1; test string2"));//test with ; separator |
|
990 | + $this->assertEquals("test string 1...", $email->trimLongTo("test string 1; test string2")); //test with ; separator |
|
991 | 991 | |
992 | 992 | } |
993 | 993 | |
@@ -996,11 +996,11 @@ discard block |
||
996 | 996 | $email = new Email(); |
997 | 997 | |
998 | 998 | //test without setting name |
999 | - $this->assertEquals(Null,$email->get_summary_text()); |
|
999 | + $this->assertEquals(Null, $email->get_summary_text()); |
|
1000 | 1000 | |
1001 | 1001 | //test with name set |
1002 | 1002 | $email->name = "test"; |
1003 | - $this->assertEquals('test',$email->get_summary_text()); |
|
1003 | + $this->assertEquals('test', $email->get_summary_text()); |
|
1004 | 1004 | |
1005 | 1005 | } |
1006 | 1006 | |
@@ -1037,13 +1037,13 @@ discard block |
||
1037 | 1037 | //test with empty string |
1038 | 1038 | $expected = "<div><input title=\"\"\n class=\"button\"\n type=\"button\" name=\"button\"\n onClick=\"window.location='index.php?module=Emails&action=Check&type=';\"\n style=\"margin-bottom:2px\"\n value=\" \"></div>"; |
1039 | 1039 | $actual = $email->checkInbox(''); |
1040 | - $this->assertSame($expected,$actual); |
|
1040 | + $this->assertSame($expected, $actual); |
|
1041 | 1041 | |
1042 | 1042 | |
1043 | 1043 | //test with valid string |
1044 | 1044 | $expected = "<div><input title=\"\"\n class=\"button\"\n type=\"button\" name=\"button\"\n onClick=\"window.location='index.php?module=Emails&action=Check&type=test';\"\n style=\"margin-bottom:2px\"\n value=\" \"></div>"; |
1045 | 1045 | $actual = $email->checkInbox('test'); |
1046 | - $this->assertSame($expected,$actual); |
|
1046 | + $this->assertSame($expected, $actual); |
|
1047 | 1047 | |
1048 | 1048 | } |
1049 | 1049 |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -class CampaignLogTest extends PHPUnit_Framework_TestCase { |
|
4 | +class CampaignLogTest extends PHPUnit_Framework_TestCase { |
|
5 | 5 | |
6 | 6 | |
7 | 7 | public function testCampaignLog() { |
8 | 8 | |
9 | 9 | //execute the contructor and check for the Object type and attributes |
10 | 10 | $campaignLog = new CampaignLog(); |
11 | - $this->assertInstanceOf('CampaignLog',$campaignLog); |
|
12 | - $this->assertInstanceOf('SugarBean',$campaignLog); |
|
11 | + $this->assertInstanceOf('CampaignLog', $campaignLog); |
|
12 | + $this->assertInstanceOf('SugarBean', $campaignLog); |
|
13 | 13 | |
14 | 14 | $this->assertAttributeEquals('CampaignLog', 'module_dir', $campaignLog); |
15 | 15 | $this->assertAttributeEquals('CampaignLog', 'object_name', $campaignLog); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | } |
20 | 20 | |
21 | - public function testget_list_view_data(){ |
|
21 | + public function testget_list_view_data() { |
|
22 | 22 | |
23 | 23 | error_reporting(E_ERROR | E_PARSE); |
24 | 24 | |
@@ -27,16 +27,16 @@ discard block |
||
27 | 27 | //execute the method and verify it returns an array |
28 | 28 | $actual = $campaignLog->get_list_view_data(); |
29 | 29 | $this->assertTrue(is_array($actual)); |
30 | - $this->assertSame(array(),$actual); |
|
30 | + $this->assertSame(array(), $actual); |
|
31 | 31 | |
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | - public function testretrieve_email_address(){ |
|
35 | + public function testretrieve_email_address() { |
|
36 | 36 | |
37 | 37 | $campaignLog = new CampaignLog(); |
38 | 38 | $actual = $campaignLog->retrieve_email_address(); |
39 | - $this->assertGreaterThanOrEqual("",$actual); |
|
39 | + $this->assertGreaterThanOrEqual("", $actual); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | require_once 'modules/AOR_Charts/lib/pChart/pChart.php'; |
4 | 4 | class AOR_ChartTest extends PHPUnit_Framework_TestCase { |
5 | 5 | |
6 | - public function testAOR_Chart(){ |
|
6 | + public function testAOR_Chart() { |
|
7 | 7 | |
8 | 8 | //execute the contructor and check for the Object type and attributes |
9 | 9 | $aorChart = new AOR_Chart(); |
10 | - $this->assertInstanceOf('AOR_Chart',$aorChart); |
|
11 | - $this->assertInstanceOf('Basic',$aorChart); |
|
12 | - $this->assertInstanceOf('SugarBean',$aorChart); |
|
10 | + $this->assertInstanceOf('AOR_Chart', $aorChart); |
|
11 | + $this->assertInstanceOf('Basic', $aorChart); |
|
12 | + $this->assertInstanceOf('SugarBean', $aorChart); |
|
13 | 13 | |
14 | 14 | $this->assertAttributeEquals('AOR_Charts', 'module_dir', $aorChart); |
15 | 15 | $this->assertAttributeEquals('AOR_Chart', 'object_name', $aorChart); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | } |
22 | 22 | |
23 | - public function testsave_lines(){ |
|
23 | + public function testsave_lines() { |
|
24 | 24 | |
25 | 25 | error_reporting(E_ERROR | E_PARSE); |
26 | 26 | |
@@ -51,75 +51,75 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | - public function testbuildChartImageBar(){ |
|
54 | + public function testbuildChartImageBar() { |
|
55 | 55 | |
56 | 56 | |
57 | 57 | $aorChart = new AOR_Chart(); |
58 | 58 | |
59 | 59 | $chartData = new pData(); |
60 | - $chartData->addPoints(10,'data'); |
|
61 | - $chartData->addPoints(10,'Labels'); |
|
60 | + $chartData->addPoints(10, 'data'); |
|
61 | + $chartData->addPoints(10, 'Labels'); |
|
62 | 62 | |
63 | 63 | |
64 | 64 | //execute with recordImageMap true and verify that the chartPicture is changed |
65 | - $chartPicture = new pImage(700,700,$chartData); |
|
66 | - $aorChart->buildChartImageBar($chartPicture,true); |
|
67 | - $this->assertNotEquals($chartPicture, new pImage(700,700,$chartData) ); |
|
65 | + $chartPicture = new pImage(700, 700, $chartData); |
|
66 | + $aorChart->buildChartImageBar($chartPicture, true); |
|
67 | + $this->assertNotEquals($chartPicture, new pImage(700, 700, $chartData)); |
|
68 | 68 | |
69 | 69 | |
70 | 70 | //execute with recordImageMap false and verify that the chartPicture is changed |
71 | - $chartPicture = new pImage(700,700,$chartData); |
|
72 | - $aorChart->buildChartImageBar($chartPicture,false); |
|
73 | - $this->assertNotEquals($chartPicture, new pImage(700,700,$chartData) ); |
|
71 | + $chartPicture = new pImage(700, 700, $chartData); |
|
72 | + $aorChart->buildChartImageBar($chartPicture, false); |
|
73 | + $this->assertNotEquals($chartPicture, new pImage(700, 700, $chartData)); |
|
74 | 74 | |
75 | 75 | unset($chartData); |
76 | 76 | unset($chartPicture); |
77 | 77 | } |
78 | 78 | |
79 | - public function testbuildChartImagePie(){ |
|
79 | + public function testbuildChartImagePie() { |
|
80 | 80 | |
81 | 81 | |
82 | 82 | $aorChart = new AOR_Chart(); |
83 | 83 | |
84 | 84 | $chartData = new pData(); |
85 | - $chartData->addPoints(10,'data'); |
|
86 | - $chartData->addPoints(10,'Labels'); |
|
85 | + $chartData->addPoints(10, 'data'); |
|
86 | + $chartData->addPoints(10, 'Labels'); |
|
87 | 87 | |
88 | 88 | |
89 | 89 | //execute with recordImageMap false and verify that the chartPicture is changed |
90 | - $chartPicture = new pImage(700,700,$chartData); |
|
91 | - $aorChart->buildChartImagePie($chartPicture,$chartData,array(array('x'=>10), array('x'=>20)),700, 700, 'x',false); |
|
92 | - $this->assertNotEquals($chartPicture, new pImage(700,700,$chartData) ); |
|
90 | + $chartPicture = new pImage(700, 700, $chartData); |
|
91 | + $aorChart->buildChartImagePie($chartPicture, $chartData, array(array('x'=>10), array('x'=>20)), 700, 700, 'x', false); |
|
92 | + $this->assertNotEquals($chartPicture, new pImage(700, 700, $chartData)); |
|
93 | 93 | |
94 | 94 | |
95 | 95 | //execute with recordImageMap true and verify that the chartPicture is changed |
96 | - $chartPicture = new pImage(700,700,$chartData); |
|
97 | - $aorChart->buildChartImagePie($chartPicture,$chartData,array(array('x'=>10), array('x'=>20)),700, 700, 'x',true); |
|
98 | - $this->assertNotEquals($chartPicture, new pImage(700,700,$chartData) ); |
|
96 | + $chartPicture = new pImage(700, 700, $chartData); |
|
97 | + $aorChart->buildChartImagePie($chartPicture, $chartData, array(array('x'=>10), array('x'=>20)), 700, 700, 'x', true); |
|
98 | + $this->assertNotEquals($chartPicture, new pImage(700, 700, $chartData)); |
|
99 | 99 | |
100 | 100 | unset($chartData); |
101 | 101 | unset($chartPicture); |
102 | 102 | |
103 | 103 | } |
104 | 104 | |
105 | - public function testbuildChartImageLine(){ |
|
105 | + public function testbuildChartImageLine() { |
|
106 | 106 | |
107 | 107 | $aorChart = new AOR_Chart(); |
108 | 108 | |
109 | 109 | $chartData = new pData(); |
110 | - $chartData->addPoints(10,'data'); |
|
111 | - $chartData->addPoints(10,'Labels'); |
|
110 | + $chartData->addPoints(10, 'data'); |
|
111 | + $chartData->addPoints(10, 'Labels'); |
|
112 | 112 | |
113 | 113 | |
114 | 114 | //execute with recordImageMap true and verify that the chartPicture is changed |
115 | - $chartPicture = new pImage(700,700,$chartData); |
|
116 | - $aorChart->buildChartImageLine($chartPicture,true); |
|
117 | - $this->assertNotEquals($chartPicture, new pImage(700,700,$chartData) ); |
|
115 | + $chartPicture = new pImage(700, 700, $chartData); |
|
116 | + $aorChart->buildChartImageLine($chartPicture, true); |
|
117 | + $this->assertNotEquals($chartPicture, new pImage(700, 700, $chartData)); |
|
118 | 118 | |
119 | 119 | //execute with recordImageMap false and verify that the chartPicture is changed |
120 | - $chartPicture = new pImage(700,700,$chartData); |
|
121 | - $aorChart->buildChartImageLine($chartPicture,false); |
|
122 | - $this->assertNotEquals($chartPicture, new pImage(700,700,$chartData) ); |
|
120 | + $chartPicture = new pImage(700, 700, $chartData); |
|
121 | + $aorChart->buildChartImageLine($chartPicture, false); |
|
122 | + $this->assertNotEquals($chartPicture, new pImage(700, 700, $chartData)); |
|
123 | 123 | |
124 | 124 | |
125 | 125 | unset($chartData); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | } |
129 | 129 | |
130 | - public function testbuildChartImageRadar(){ |
|
130 | + public function testbuildChartImageRadar() { |
|
131 | 131 | |
132 | 132 | |
133 | 133 | $aorChart = new AOR_Chart(); |
@@ -135,12 +135,12 @@ discard block |
||
135 | 135 | //preset the required objects and properties |
136 | 136 | $chartData = new pData(); |
137 | 137 | $chartData->loadPalette("modules/AOR_Charts/lib/pChart/palettes/navy.color", TRUE); |
138 | - $chartData->addPoints(10,'data'); |
|
139 | - $chartData->addPoints('10','Labels'); |
|
140 | - $chartData->addPoints(120,'data'); |
|
141 | - $chartData->addPoints('120','Labels'); |
|
138 | + $chartData->addPoints(10, 'data'); |
|
139 | + $chartData->addPoints('10', 'Labels'); |
|
140 | + $chartData->addPoints(120, 'data'); |
|
141 | + $chartData->addPoints('120', 'Labels'); |
|
142 | 142 | |
143 | - $chartData->setSerieDescription("Months","Month"); |
|
143 | + $chartData->setSerieDescription("Months", "Month"); |
|
144 | 144 | $chartData->setAbscissa("Labels"); |
145 | 145 | |
146 | 146 | $imageWidth = 700; |
@@ -148,18 +148,18 @@ discard block |
||
148 | 148 | |
149 | 149 | |
150 | 150 | //execute with recordImageMap true and verify that the chartPicture is changed |
151 | - $chartPicture = new pImage($imageWidth,$imageHeight,$chartData); |
|
152 | - $chartPicture->setGraphArea(60,60,$imageWidth-60,$imageHeight-100); |
|
153 | - $aorChart->buildChartImageRadar($chartPicture,$chartData,true); |
|
154 | - $this->assertNotEquals($chartPicture, new pImage(700,700,$chartData) ); |
|
151 | + $chartPicture = new pImage($imageWidth, $imageHeight, $chartData); |
|
152 | + $chartPicture->setGraphArea(60, 60, $imageWidth - 60, $imageHeight - 100); |
|
153 | + $aorChart->buildChartImageRadar($chartPicture, $chartData, true); |
|
154 | + $this->assertNotEquals($chartPicture, new pImage(700, 700, $chartData)); |
|
155 | 155 | |
156 | 156 | |
157 | 157 | |
158 | 158 | //execute with recordImageMap false and verify that the chartPicture is changed |
159 | - $chartPicture = new pImage(700,700,$chartData); |
|
160 | - $chartPicture->setGraphArea(60,60,$imageWidth-60,$imageHeight-100); |
|
161 | - $aorChart->buildChartImageRadar($chartPicture,$chartData,false); |
|
162 | - $this->assertNotEquals($chartPicture, new pImage(700,700,$chartData) ); |
|
159 | + $chartPicture = new pImage(700, 700, $chartData); |
|
160 | + $chartPicture->setGraphArea(60, 60, $imageWidth - 60, $imageHeight - 100); |
|
161 | + $aorChart->buildChartImageRadar($chartPicture, $chartData, false); |
|
162 | + $this->assertNotEquals($chartPicture, new pImage(700, 700, $chartData)); |
|
163 | 163 | |
164 | 164 | |
165 | 165 | unset($chartData); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | } |
169 | 169 | |
170 | - public function testbuildChartImage(){ |
|
170 | + public function testbuildChartImage() { |
|
171 | 171 | |
172 | 172 | $this->markTestSkipped("Skipping testing chart image"); |
173 | 173 | |
@@ -186,35 +186,35 @@ discard block |
||
186 | 186 | $fields['x'] = json_decode('{"label": "x"}'); |
187 | 187 | $fields['y'] = json_decode('{"label": "y"}'); |
188 | 188 | |
189 | - $reportData = array(array('xx'=>10,'yy'=>10), array('xx'=>20, 'yy'=>20)); |
|
189 | + $reportData = array(array('xx'=>10, 'yy'=>10), array('xx'=>20, 'yy'=>20)); |
|
190 | 190 | |
191 | 191 | //execute the method and verify it returns expected results |
192 | 192 | $aorChart->type = 'bar'; |
193 | 193 | $result = $aorChart->buildChartImage($reportData, $fields); |
194 | - $this->assertEquals('data:image/png;base64,',$result); |
|
194 | + $this->assertEquals('data:image/png;base64,', $result); |
|
195 | 195 | |
196 | 196 | |
197 | 197 | //execute the method and verify it returns expected results |
198 | 198 | $aorChart->type = 'Line'; |
199 | 199 | $result = $aorChart->buildChartImage($reportData, $fields); |
200 | - $this->assertEquals('',$result); |
|
200 | + $this->assertEquals('', $result); |
|
201 | 201 | |
202 | 202 | |
203 | 203 | //execute the method and verify it returns expected results |
204 | 204 | $aorChart->type = 'pie'; |
205 | 205 | $result = $aorChart->buildChartImage($reportData, $fields); |
206 | - $this->assertEquals('data:image/png;base64,',$result); |
|
206 | + $this->assertEquals('data:image/png;base64,', $result); |
|
207 | 207 | |
208 | 208 | |
209 | 209 | //execute the method and verify it returns expected results |
210 | 210 | $aorChart->type = 'radar'; |
211 | - $result = $aorChart->buildChartImage($reportData, $fields,true); |
|
212 | - $this->assertEquals('data:image/png;base64,',$result); |
|
211 | + $result = $aorChart->buildChartImage($reportData, $fields, true); |
|
212 | + $this->assertEquals('data:image/png;base64,', $result); |
|
213 | 213 | |
214 | 214 | |
215 | 215 | } |
216 | 216 | |
217 | - public function testbuildChartHTML(){ |
|
217 | + public function testbuildChartHTML() { |
|
218 | 218 | $this->markTestSkipped("Skipping testing chart HTML"); |
219 | 219 | $aorChart = new AOR_Chart(); |
220 | 220 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $fields['x'] = json_decode('{"label": "x"}'); |
227 | 227 | $fields['y'] = json_decode('{"label": "y"}'); |
228 | 228 | |
229 | - $reportData = array(array('xx'=>10,'yy'=>10), array('xx'=>20, 'yy'=>20)); |
|
229 | + $reportData = array(array('xx'=>10, 'yy'=>10), array('xx'=>20, 'yy'=>20)); |
|
230 | 230 | |
231 | 231 | $aorChart->type = 'bar'; |
232 | 232 | |
@@ -236,8 +236,8 @@ discard block |
||
236 | 236 | $this->assertSame($expected, $result); |
237 | 237 | |
238 | 238 | //test with type CHART_TYPE_CHARTJS verify it returns expected results |
239 | - $expected = "<h3></h3><canvas id='chart' width='400' height='400'></canvas> <script>\n \$(document).ready(function(){\n SUGAR.util.doWhen(\"typeof Chart != 'undefined'\", function(){\n var data = {\"labels\":[\"10 [a]\",\"20 [e]\"],\"datasets\":[{\"fillColor\":\"rgba(151,187,205,0.2)\",\"strokeColor\":\"rgba(151,187,205,1)\",\"pointColor\":\"rgba(151,187,205,1)\",\"pointStrokeColor\":\"#fff\",\"pointHighlightFill\":\"#fff\",\"pointHighlightStroke\":\"rgba(151,187,205,1)4\",\"data\":[10,20]}]};\n var ctx = document.getElementById(\"chart\").getContext(\"2d\");\n console.log('Creating new chart');\n var config = [];\n var chart = new Chart(ctx).Bar(data, config);\n var legend = chart.generateLegend();\n $('#chart').after(legend);\n });\n });\n </script>" ; |
|
240 | - $result = $aorChart->buildChartHTML($reportData, $fields,0, AOR_Report::CHART_TYPE_CHARTJS); |
|
239 | + $expected = "<h3></h3><canvas id='chart' width='400' height='400'></canvas> <script>\n \$(document).ready(function(){\n SUGAR.util.doWhen(\"typeof Chart != 'undefined'\", function(){\n var data = {\"labels\":[\"10 [a]\",\"20 [e]\"],\"datasets\":[{\"fillColor\":\"rgba(151,187,205,0.2)\",\"strokeColor\":\"rgba(151,187,205,1)\",\"pointColor\":\"rgba(151,187,205,1)\",\"pointStrokeColor\":\"#fff\",\"pointHighlightFill\":\"#fff\",\"pointHighlightStroke\":\"rgba(151,187,205,1)4\",\"data\":[10,20]}]};\n var ctx = document.getElementById(\"chart\").getContext(\"2d\");\n console.log('Creating new chart');\n var config = [];\n var chart = new Chart(ctx).Bar(data, config);\n var legend = chart.generateLegend();\n $('#chart').after(legend);\n });\n });\n </script>"; |
|
240 | + $result = $aorChart->buildChartHTML($reportData, $fields, 0, AOR_Report::CHART_TYPE_CHARTJS); |
|
241 | 241 | $this->assertSame($expected, $result); |
242 | 242 | |
243 | 243 |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | //execute the contructor and check for the Object type and attributes |
11 | 11 | $relationship = new Relationship(); |
12 | 12 | |
13 | - $this->assertInstanceOf('Relationship',$relationship); |
|
14 | - $this->assertInstanceOf('SugarBean',$relationship); |
|
13 | + $this->assertInstanceOf('Relationship', $relationship); |
|
14 | + $this->assertInstanceOf('SugarBean', $relationship); |
|
15 | 15 | |
16 | 16 | $this->assertAttributeEquals('Relationships', 'module_dir', $relationship); |
17 | 17 | $this->assertAttributeEquals('Relationship', 'object_name', $relationship); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | |
105 | - public function testget_other_module(){ |
|
105 | + public function testget_other_module() { |
|
106 | 106 | |
107 | 107 | //unset and reconnect Db to resolve mysqli fetch exeception |
108 | 108 | global $db; |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | $this->assertEquals(false, $result); |
117 | 117 | |
118 | 118 | //test with valid relationship |
119 | - $result = $relationship->get_other_module("roles_users", "Roles",$db); |
|
119 | + $result = $relationship->get_other_module("roles_users", "Roles", $db); |
|
120 | 120 | $this->assertEquals("Users", $result); |
121 | 121 | |
122 | 122 | } |
123 | 123 | |
124 | - public function testretrieve_by_sides(){ |
|
124 | + public function testretrieve_by_sides() { |
|
125 | 125 | |
126 | 126 | //unset and reconnect Db to resolve mysqli fetch exeception |
127 | 127 | global $db; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | } |
151 | 151 | |
152 | - public function testretrieve_by_modules(){ |
|
152 | + public function testretrieve_by_modules() { |
|
153 | 153 | |
154 | 154 | //unset and reconnect Db to resolve mysqli fetch exeception |
155 | 155 | global $db; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | } |
269 | 269 | |
270 | 270 | |
271 | - public function testtrace_relationship_module(){ |
|
271 | + public function testtrace_relationship_module() { |
|
272 | 272 | |
273 | 273 | //unset and reconnect Db to resolve mysqli fetch exeception |
274 | 274 | global $db; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | |
278 | 278 | $relationship = new Relationship(); |
279 | 279 | $result = $relationship->trace_relationship_module("Roles", "Users"); |
280 | - $this->assertInstanceOf('User',$result); |
|
280 | + $this->assertInstanceOf('User', $result); |
|
281 | 281 | |
282 | 282 | } |
283 | 283 |