Completed
Push — master ( 091458...fe2892 )
by Oleg
03:56
created
tests/OptimizelyPHPTest/Service/v2/CampaignsTest.php 4 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace OptimizelyPHPTest\Service\v2;
3 3
 
4
-use PHPUnit_Framework_TestCase;
5 4
 use WebMarketingROI\OptimizelyPHP\OptimizelyApiClient;
6 5
 use WebMarketingROI\OptimizelyPHP\Result;
7 6
 use WebMarketingROI\OptimizelyPHP\Service\v2\Campaigns;
Please login to merge, or discard this patch.
Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
                         array(
24 24
                             "project_id" => 1000,
25 25
                             "changes" => array(
26
-                              array(
26
+                                array(
27 27
                                 "type" => "custom_code",
28 28
                                 "allow_additional_redirect" => true,
29 29
                                 "async" => true,
30 30
                                 "css_selector" => "a[href*=\"optimizely\"]",
31 31
                                 "dependencies" => array(
32
-                                  24,
33
-                                  26
32
+                                    24,
33
+                                    26
34 34
                                 ),
35 35
                                 "destination" => "https://app.optimizely.com/",
36 36
                                 "extension_id" => 1234,
@@ -38,30 +38,30 @@  discard block
 block discarded – undo
38 38
                                 "src" => 524,
39 39
                                 "value" => "window.someGlobalFunction();",
40 40
                                 "id" => "string"
41
-                              )
41
+                                )
42 42
                             ),
43 43
                             "created" => "2016-10-18T03:27:04.123Z",
44 44
                             "earliest" => "2016-10-18T03:27:04.123Z",
45 45
                             "experiment_ids" => array(
46
-                              0
46
+                                0
47 47
                             ),
48 48
                             "holdback" => 0,
49 49
                             "last_modified" => "2016-10-18T03:27:04.123Z",
50 50
                             "latest" => "2016-10-18T03:27:04.123Z",
51 51
                             "metrics" => array(
52
-                              array(
52
+                                array(
53 53
                                 "kind" => "string",
54 54
                                 "id" => 0
55
-                              )
55
+                                )
56 56
                             ),
57 57
                             "name" => "Landing Page Optimization",
58 58
                             "page_ids" => array(
59
-                              0
59
+                                0
60 60
                             ),
61 61
                             "status" => "active",
62 62
                             "type" => "a/b",
63 63
                             "id" => 2000
64
-                          )
64
+                            )
65 65
                         ), 200);
66 66
         
67 67
         $optimizelyApiClientMock->method('sendApiRequest')
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
         $result = new Result(array(
118 118
                             "project_id" => 1000,
119 119
                             "changes" => array(
120
-                              array(
120
+                                array(
121 121
                                 "type" => "custom_code",
122 122
                                 "allow_additional_redirect" => true,
123 123
                                 "async" => true,
124 124
                                 "css_selector" => "a[href*=\"optimizely\"]",
125 125
                                 "dependencies" => array(
126
-                                  24,
127
-                                  26
126
+                                    24,
127
+                                    26
128 128
                                 ),
129 129
                                 "destination" => "https://app.optimizely.com/",
130 130
                                 "extension_id" => 1234,
@@ -132,25 +132,25 @@  discard block
 block discarded – undo
132 132
                                 "src" => 524,
133 133
                                 "value" => "window.someGlobalFunction();",
134 134
                                 "id" => "string"
135
-                              )
135
+                                )
136 136
                             ),
137 137
                             "created" => "2016-10-18T03:27:04.139Z",
138 138
                             "earliest" => "2016-10-18T03:27:04.139Z",
139 139
                             "experiment_ids" => array(
140
-                              0
140
+                                0
141 141
                             ),
142 142
                             "holdback" => 0,
143 143
                             "last_modified" => "2016-10-18T03:27:04.139Z",
144 144
                             "latest" => "2016-10-18T03:27:04.139Z",
145 145
                             "metrics" => array(
146
-                              array(
146
+                                array(
147 147
                                 "kind" => "string",
148 148
                                 "id" => 0
149
-                              )
149
+                                )
150 150
                             ),
151 151
                             "name" => "Landing Page Optimization",
152 152
                             "page_ids" => array(
153
-                              0
153
+                                0
154 154
                             ),
155 155
                             "status" => "active",
156 156
                             "type" => "a/b",
@@ -181,47 +181,47 @@  discard block
 block discarded – undo
181 181
                             "confidence_threshold" => 0,
182 182
                             "end_time" => "2016-10-18T03:27:04.147Z",
183 183
                             "metrics" => array(
184
-                              array(
184
+                                array(
185 185
                                 "event" => "string",
186 186
                                 "event_name" => "string",
187 187
                                 "measure" => "conversions",
188 188
                                 "metric_id" => "string",
189 189
                                 "priority" => 0,
190 190
                                 "results" => array(
191
-                                  "campaign" => array(
191
+                                    "campaign" => array(
192 192
                                     "experiment_id" => 0,
193 193
                                     "is_baseline" => true,
194 194
                                     "lift" => array(
195
-                                      "confidence_interval" => array(
195
+                                        "confidence_interval" => array(
196 196
                                         0.010399560300730457,
197 197
                                         0.0850821459929161
198
-                                      ),
199
-                                      "is_most_conclusive" => true,
200
-                                      "is_significant" => true,
201
-                                      "significance" => 0,
202
-                                      "value" => 0,
203
-                                      "visitors_remaining" => 0
198
+                                        ),
199
+                                        "is_most_conclusive" => true,
200
+                                        "is_significant" => true,
201
+                                        "significance" => 0,
202
+                                        "value" => 0,
203
+                                        "visitors_remaining" => 0
204 204
                                     ),
205 205
                                     "name" => "Blue Button",
206 206
                                     "rate" => 0,
207 207
                                     "scope" => "variation",
208 208
                                     "total_increase" => array(
209
-                                      "confidence_interval" => array(
209
+                                        "confidence_interval" => array(
210 210
                                         0.010399560300730457,
211 211
                                         0.0850821459929161
212
-                                      ),
213
-                                      "is_most_conclusive" => true,
214
-                                      "is_significant" => true,
215
-                                      "significance" => 0,
216
-                                      "value" => 0,
217
-                                      "visitors_remaining" => 0
212
+                                        ),
213
+                                        "is_most_conclusive" => true,
214
+                                        "is_significant" => true,
215
+                                        "significance" => 0,
216
+                                        "value" => 0,
217
+                                        "visitors_remaining" => 0
218 218
                                     ),
219 219
                                     "value" => 0,
220 220
                                     "variation_id" => "string"
221
-                                  )
221
+                                    )
222 222
                                 ),
223 223
                                 "unit" => "session"
224
-                              )
224
+                                )
225 225
                             ),
226 226
                             "start_time" => "2016-10-18T03:27:04.148Z"
227 227
                         ), 200);
@@ -249,14 +249,14 @@  discard block
 block discarded – undo
249 249
         $result = new Result(array(
250 250
                             "project_id" => 1000,
251 251
                             "changes" => array(
252
-                              array(
252
+                                array(
253 253
                                 "type" => "custom_code",
254 254
                                 "allow_additional_redirect" => true, 
255 255
                                 "async" => true,
256 256
                                 "css_selector" => "a[href*=\"optimizely\"]",
257 257
                                 "dependencies" => array(
258
-                                  24,
259
-                                  26
258
+                                    24,
259
+                                    26
260 260
                                 ),
261 261
                                 "destination" => "https://app.optimizely.com/",
262 262
                                 "extension_id" => 1234,
@@ -264,25 +264,25 @@  discard block
 block discarded – undo
264 264
                                 "src" => 524,
265 265
                                 "value" => "window.someGlobalFunction();",
266 266
                                 "id" => "string"
267
-                              )
267
+                                )
268 268
                             ),
269 269
                             "created" => "2016-10-18T03:27:04.155Z",
270 270
                             "earliest" => "2016-10-18T03:27:04.155Z",
271 271
                             "experiment_ids" => array(
272
-                              0
272
+                                0
273 273
                             ),
274 274
                             "holdback" => 0,
275 275
                             "last_modified" => "2016-10-18T03:27:04.155Z",
276 276
                             "latest" => "2016-10-18T03:27:04.155Z",
277 277
                             "metrics" => array(
278
-                              array(
278
+                                array(
279 279
                                 "kind" => "string",
280 280
                                 "id" => 0
281
-                              )
281
+                                )
282 282
                             ),
283 283
                             "name" => "Landing Page Optimization",
284 284
                             "page_ids" => array(
285
-                              0
285
+                                0
286 286
                             ),
287 287
                             "status" => "active",
288 288
                             "type" => "a/b",
@@ -297,38 +297,38 @@  discard block
 block discarded – undo
297 297
         $campaign = new Campaign(array(
298 298
                 "project_id" => 1000,
299 299
                 "changes" => array(
300
-                  array(
300
+                    array(
301 301
                     "type" => "custom_code",
302 302
                     "allow_additional_redirect" => true,
303 303
                     "async" => true,
304 304
                     "css_selector" => "a[href*=\"optimizely\"]",
305 305
                     "dependencies" => array(
306
-                      24,
307
-                      26
306
+                        24,
307
+                        26
308 308
                     ),
309 309
                     "destination" => "https://app.optimizely.com/",
310 310
                     "extension_id" => 1234,
311 311
                     "preserve_parameters" => true,
312 312
                     "src" => 524,
313 313
                     "value" => "window.someGlobalFunction();"
314
-                  )
314
+                    )
315 315
                 ),
316 316
                 "created" => "2016-10-18T03:27:04.067Z",
317 317
                 "earliest" => "2016-10-18T03:27:04.067Z",
318 318
                 "experiment_ids" => array(
319
-                  0
319
+                    0
320 320
                 ),
321 321
                 "holdback" => 0,
322 322
                 "last_modified" => "2016-10-18T03:27:04.067Z",
323 323
                 "latest" => "2016-10-18T03:27:04.067Z",
324 324
                 "metrics" => array(
325
-                  array(
325
+                    array(
326 326
                     "kind" => "string"
327
-                  )
327
+                    )
328 328
                 ),
329 329
                 "name" => "Landing Page Optimization",
330 330
                 "page_ids" => array(
331
-                  0
331
+                    0
332 332
                 ),
333 333
                 "status" => "active",
334 334
                 "type" => "a/b"
@@ -351,14 +351,14 @@  discard block
 block discarded – undo
351 351
         $result = new Result(array(
352 352
                             "project_id" => 1000,
353 353
                             "changes" => array(
354
-                              array(
354
+                                array(
355 355
                                 "type" => "custom_code",
356 356
                                 "allow_additional_redirect" => true, 
357 357
                                 "async" => true,
358 358
                                 "css_selector" => "a[href*=\"optimizely\"]",
359 359
                                 "dependencies" => array(
360
-                                  24,
361
-                                  26
360
+                                    24,
361
+                                    26
362 362
                                 ),
363 363
                                 "destination" => "https://app.optimizely.com/",
364 364
                                 "extension_id" => 1234,
@@ -366,25 +366,25 @@  discard block
 block discarded – undo
366 366
                                 "src" => 524,
367 367
                                 "value" => "window.someGlobalFunction();",
368 368
                                 "id" => "string"
369
-                              )
369
+                                )
370 370
                             ),
371 371
                             "created" => "2016-10-18T03:27:04.155Z",
372 372
                             "earliest" => "2016-10-18T03:27:04.155Z",
373 373
                             "experiment_ids" => array(
374
-                              0
374
+                                0
375 375
                             ),
376 376
                             "holdback" => 0,
377 377
                             "last_modified" => "2016-10-18T03:27:04.155Z",
378 378
                             "latest" => "2016-10-18T03:27:04.155Z",
379 379
                             "metrics" => array(
380
-                              array(
380
+                                array(
381 381
                                 "kind" => "string",
382 382
                                 "id" => 0
383
-                              )
383
+                                )
384 384
                             ),
385 385
                             "name" => "Landing Page Optimization",
386 386
                             "page_ids" => array(
387
-                              0
387
+                                0
388 388
                             ),
389 389
                             "status" => "active",
390 390
                             "type" => "a/b",
@@ -399,38 +399,38 @@  discard block
 block discarded – undo
399 399
         $campaign = new Campaign(array(
400 400
                 "project_id" => 1000,
401 401
                 "changes" => array(
402
-                  array(
402
+                    array(
403 403
                     "type" => "custom_code",
404 404
                     "allow_additional_redirect" => true,
405 405
                     "async" => true,
406 406
                     "css_selector" => "a[href*=\"optimizely\"]",
407 407
                     "dependencies" => array(
408
-                      24,
409
-                      26
408
+                        24,
409
+                        26
410 410
                     ),
411 411
                     "destination" => "https://app.optimizely.com/",
412 412
                     "extension_id" => 1234,
413 413
                     "preserve_parameters" => true,
414 414
                     "src" => 524,
415 415
                     "value" => "window.someGlobalFunction();"
416
-                  )
416
+                    )
417 417
                 ),
418 418
                 "created" => "2016-10-18T03:27:04.067Z",
419 419
                 "earliest" => "2016-10-18T03:27:04.067Z",
420 420
                 "experiment_ids" => array(
421
-                  0
421
+                    0
422 422
                 ),
423 423
                 "holdback" => 0,
424 424
                 "last_modified" => "2016-10-18T03:27:04.067Z",
425 425
                 "latest" => "2016-10-18T03:27:04.067Z",
426 426
                 "metrics" => array(
427
-                  array(
427
+                    array(
428 428
                     "kind" => "string"
429
-                  )
429
+                    )
430 430
                 ),
431 431
                 "name" => "Landing Page Optimization",
432 432
                 "page_ids" => array(
433
-                  0
433
+                    0
434 434
                 ),
435 435
                 "status" => "active",
436 436
                 "type" => "a/b"
@@ -482,14 +482,14 @@  discard block
 block discarded – undo
482 482
             "platform" => "web",
483 483
             "status" => "active",
484 484
             "web_snippet" => array(
485
-              "enable_force_variation" => false,
486
-              "exclude_disabled_experiments" => false,
487
-              "exclude_names" => true,
488
-              "include_jquery" => true,
489
-              "ip_anonymization" => false,
490
-              "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
491
-              "library" => "jquery-1.11.3-trim",
492
-              "project_javascript" => "alert(\"Active Experiment\")"
485
+                "enable_force_variation" => false,
486
+                "exclude_disabled_experiments" => false,
487
+                "exclude_names" => true,
488
+                "include_jquery" => true,
489
+                "ip_anonymization" => false,
490
+                "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
491
+                "library" => "jquery-1.11.3-trim",
492
+                "project_javascript" => "alert(\"Active Experiment\")"
493 493
             )
494 494
         ));
495 495
         
@@ -500,38 +500,38 @@  discard block
 block discarded – undo
500 500
         $campaign = new Campaign(array(
501 501
                 "project_id" => $createdProject->getId(),
502 502
                 "changes" => array(
503
-                  array(
503
+                    array(
504 504
                     "type" => "custom_code",
505 505
                     "allow_additional_redirect" => true,
506 506
                     "async" => true,
507 507
                     "css_selector" => "a[href*=\"optimizely\"]",
508 508
                     "dependencies" => array(
509
-                      '24',
510
-                      '26'
509
+                        '24',
510
+                        '26'
511 511
                     ),
512 512
                     "destination" => "https://app.optimizely.com/",
513 513
                     "extension_id" => '1234',
514 514
                     "preserve_parameters" => true,
515 515
                     "src" => '524',
516 516
                     "value" => "window.someGlobalFunction();"
517
-                  )
517
+                    )
518 518
                 ),
519 519
                 "created" => "2016-10-18T03:27:04.067Z",
520 520
                 "earliest" => "2016-10-18T03:27:04.067Z",
521 521
                 "experiment_ids" => array(
522
-                  0
522
+                    0
523 523
                 ),
524 524
                 "holdback" => 0,
525 525
                 "last_modified" => "2016-10-18T03:27:04.067Z",
526 526
                 "latest" => "2016-10-18T03:27:04.067Z",
527 527
                 "metrics" => array(
528
-                  array(
528
+                    array(
529 529
                     "kind" => "string"
530
-                  )
530
+                    )
531 531
                 ),
532 532
                 "name" => "Landing Page Optimization",
533 533
                 "page_ids" => array(
534
-                  0
534
+                    0
535 535
                 ),
536 536
                 "status" => "not_started",
537 537
                 "type" => "a/b"
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
         $result = $campaignsService->listAll(1000);
73 73
         $campaigns = $result->getPayload();
74 74
         
75
-        $this->assertTrue(count($campaigns)==1);
75
+        $this->assertTrue(count($campaigns) == 1);
76 76
         $this->assertTrue($campaigns[0] instanceOf Campaign);
77
-        $this->assertTrue($campaigns[0]->getName()=='Landing Page Optimization');        
77
+        $this->assertTrue($campaigns[0]->getName() == 'Landing Page Optimization');        
78 78
     }
79 79
     
80 80
     /**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $campaign = $result->getPayload();
167 167
         
168 168
         $this->assertTrue($campaign instanceOf Campaign);
169
-        $this->assertTrue($campaign->getName()=='Landing Page Optimization');        
169
+        $this->assertTrue($campaign->getName() == 'Landing Page Optimization');        
170 170
     }
171 171
     
172 172
     public function testGetResults()
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
         $campaignResults = $result->getPayload();
236 236
         
237 237
         $this->assertTrue($campaignResults instanceOf CampaignResults);
238
-        $this->assertTrue($campaignResults->getConfidenceThreshold()==0);        
239
-        $this->assertTrue($campaignResults->getStartTime()=="2016-10-18T03:27:04.148Z");        
238
+        $this->assertTrue($campaignResults->getConfidenceThreshold() == 0);        
239
+        $this->assertTrue($campaignResults->getStartTime() == "2016-10-18T03:27:04.148Z");        
240 240
     }
241 241
     
242 242
     public function testCreate()
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
         $createdCampaign = $result->getPayload();
339 339
         
340 340
         $this->assertTrue($createdCampaign instanceOf Campaign);
341
-        $this->assertTrue($createdCampaign->getName()=='Landing Page Optimization');                
341
+        $this->assertTrue($createdCampaign->getName() == 'Landing Page Optimization');                
342 342
     }
343 343
     
344 344
     public function testUpdate()
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
         $updatedCampaign = $result->getPayload();
441 441
                  
442 442
         $this->assertTrue($updatedCampaign instanceOf Campaign);
443
-        $this->assertTrue($updatedCampaign->getName()=='Landing Page Optimization');                
443
+        $this->assertTrue($updatedCampaign->getName() == 'Landing Page Optimization');                
444 444
     }
445 445
     
446 446
     public function testDelete()
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
         $credentials = $this->loadCredentialsFromFile();
472 472
         
473 473
         $optimizelyClient = new OptimizelyApiClient($credentials, 'v2');
474
-        $this->assertTrue($optimizelyClient!=null);
474
+        $this->assertTrue($optimizelyClient != null);
475 475
         
476 476
         // Create new project        
477 477
         $curDate = date('Y-m-d H:i:s');
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
         $createdCampaign = $result->getPayload();
542 542
         
543 543
         $this->assertTrue($createdCampaign instanceOf Campaign);
544
-        $this->assertTrue($createdCampaign->getName()=='Landing Page Optimization');  
544
+        $this->assertTrue($createdCampaign->getName() == 'Landing Page Optimization');  
545 545
         
546 546
         // Update campaign
547 547
         $createdCampaign->setName('Some new compaign name');
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -465,8 +465,9 @@
 block discarded – undo
465 465
     
466 466
     public function testIntegration()
467 467
     {
468
-        if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) 
469
-            $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set');
468
+        if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) {
469
+                    $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set');
470
+        }
470 471
         
471 472
         $credentials = $this->loadCredentialsFromFile();
472 473
         
Please login to merge, or discard this patch.
tests/OptimizelyPHPTest/Service/v2/ProjectsTest.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
         $result = $projectsService->listAll();
52 52
         $projects = $result->getPayload();
53 53
         
54
-        $this->assertTrue(count($projects)==1);
54
+        $this->assertTrue(count($projects) == 1);
55 55
         $this->assertTrue($projects[0] instanceOf Project);
56
-        $this->assertTrue($projects[0]->getName()=='Some Optimizely Project');        
56
+        $this->assertTrue($projects[0]->getName() == 'Some Optimizely Project');        
57 57
     }
58 58
     
59 59
     /**
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         $project = $result->getPayload();
127 127
         
128 128
         $this->assertTrue($project instanceOf Project);
129
-        $this->assertTrue($project->getName()=='Some Optimizely Project');        
129
+        $this->assertTrue($project->getName() == 'Some Optimizely Project');        
130 130
     }
131 131
     
132 132
     /**
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
         $createdProject = $result->getPayload();
207 207
         
208 208
         $this->assertTrue($createdProject instanceOf Project);
209
-        $this->assertTrue($createdProject->getName()=='Test Project');        
210
-        $this->assertTrue($createdProject->getAccountId()==12345);        
209
+        $this->assertTrue($createdProject->getName() == 'Test Project');        
210
+        $this->assertTrue($createdProject->getAccountId() == 12345);        
211 211
     }
212 212
     
213 213
     /**
@@ -286,8 +286,8 @@  discard block
 block discarded – undo
286 286
         $updatedProject = $result->getPayload();
287 287
         
288 288
         $this->assertTrue($updatedProject instanceOf Project);
289
-        $this->assertTrue($updatedProject->getName()=='Test Project');        
290
-        $this->assertTrue($updatedProject->getAccountId()==12345);        
289
+        $this->assertTrue($updatedProject->getName() == 'Test Project');        
290
+        $this->assertTrue($updatedProject->getAccountId() == 12345);        
291 291
     }
292 292
     
293 293
     /**
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
         $credentials = $this->loadCredentialsFromFile();
331 331
         
332 332
         $optimizelyClient = new OptimizelyApiClient($credentials, 'v2');
333
-        $this->assertTrue($optimizelyClient!=null);
333
+        $this->assertTrue($optimizelyClient != null);
334 334
                 
335 335
         // Create new project        
336 336
         $curDate = date('Y-m-d H:i:s');
@@ -357,9 +357,9 @@  discard block
 block discarded – undo
357 357
         //print_r($optimizelyClient->getDiagnosticsInfo());
358 358
         
359 359
         $this->assertEquals(201, $result->getHttpCode());        
360
-        $this->assertTrue($result->getRateLimit()>0);
361
-        $this->assertTrue($result->getRateLimitRemaining()>0);
362
-        $this->assertTrue($result->getRateLimitReset()>0);
360
+        $this->assertTrue($result->getRateLimit() > 0);
361
+        $this->assertTrue($result->getRateLimitRemaining() > 0);
362
+        $this->assertTrue($result->getRateLimitReset() > 0);
363 363
         
364 364
         $createdProject = $result->getPayload();
365 365
         
@@ -381,18 +381,18 @@  discard block
 block discarded – undo
381 381
                 $projects = $result->getPayload();
382 382
 
383 383
                 foreach ($projects as $project) {
384
-                    echo "Name: " . $project->getName() . "\n";
385
-                    if ($project->getName()=="Test Project $curDate") {
384
+                    echo "Name: ".$project->getName()."\n";
385
+                    if ($project->getName() == "Test Project $curDate") {
386 386
                         $projectId = $project->getId();
387 387
                         $projectFound = true;
388 388
                         break;
389 389
                     }
390 390
                 }
391 391
 
392
-                if ($result->getNextPage()==null)
392
+                if ($result->getNextPage() == null)
393 393
                     break;
394 394
 
395
-                $page ++;
395
+                $page++;
396 396
             }
397 397
         }
398 398
         catch (Exception $e) {
@@ -410,14 +410,14 @@  discard block
 block discarded – undo
410 410
         try {
411 411
             $result = $optimizelyClient->projects()->get(12345678);        
412 412
         } 
413
-        catch(Exception $e) {
413
+        catch (Exception $e) {
414 414
             //print_r($optimizelyClient->getDiagnosticsInfo());
415 415
             $this->assertEquals(Exception::CODE_API_ERROR, $e->getCode());
416 416
             $this->assertEquals('not_found', $e->getHttpCode());
417
-            $this->assertTrue(strlen($e->getUuid())!=0);
418
-            $this->assertTrue($e->getRateLimit()>0);
419
-            $this->assertTrue($e->getRateLimitRemaining()>0);
420
-            $this->assertTrue($e->getRateLimitReset()>0);
417
+            $this->assertTrue(strlen($e->getUuid()) != 0);
418
+            $this->assertTrue($e->getRateLimit() > 0);
419
+            $this->assertTrue($e->getRateLimitRemaining() > 0);
420
+            $this->assertTrue($e->getRateLimitReset() > 0);
421 421
         }
422 422
         
423 423
         // Retrieve existing project by ID        
Please login to merge, or discard this patch.