Completed
Push — master ( fed072...89d815 )
by Oleg
16:38
created
tests/OptimizelyPHPTest/Service/v2/CampaignsTest.php 1 patch
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
                         array(
26 26
                             "project_id" => 1000,
27 27
                             "changes" => array(
28
-                              array(
28
+                                array(
29 29
                                 "type" => "custom_code",
30 30
                                 "allow_additional_redirect" => true,
31 31
                                 "async" => true,
32 32
                                 "selector" => "a[href*=\"optimizely\"]",
33 33
                                 "dependencies" => array(
34
-                                  24,
35
-                                  26
34
+                                    24,
35
+                                    26
36 36
                                 ),
37 37
                                 "destination" => "https://app.optimizely.com/",
38 38
                                 "extension_id" => 1234,
@@ -40,32 +40,32 @@  discard block
 block discarded – undo
40 40
                                 "src" => 524,
41 41
                                 "value" => "window.someGlobalFunction();",
42 42
                                 "id" => "string"
43
-                              )
43
+                                )
44 44
                             ),
45 45
                             "created" => "2016-10-18T03:27:04.123Z",
46 46
                             "earliest" => "2016-10-18T03:27:04.123Z",
47 47
                             "experiment_ids" => array(
48
-                              0
48
+                                0
49 49
                             ),
50 50
                             "holdback" => 0,
51 51
                             "last_modified" => "2016-10-18T03:27:04.123Z",
52 52
                             "latest" => "2016-10-18T03:27:04.123Z",
53 53
                             "metrics" => array(
54
-                              array(
54
+                                array(
55 55
                                 "aggregator" => "unique",
56 56
                                 "event_id" => 0,
57 57
                                 "field" => "revenue",
58 58
                                 "scope" => "session"
59
-                              )
59
+                                )
60 60
                             ),
61 61
                             "name" => "Landing Page Optimization",
62 62
                             "page_ids" => array(
63
-                              0
63
+                                0
64 64
                             ),
65 65
                             "status" => "active",
66 66
                             "type" => "a/b",
67 67
                             "id" => 2000
68
-                          )
68
+                            )
69 69
                         ), 200);
70 70
         
71 71
         $optimizelyApiClientMock->method('sendApiRequest')
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
         $result = new Result(array(
122 122
                             "project_id" => 1000,
123 123
                             "changes" => array(
124
-                              array(
124
+                                array(
125 125
                                 "type" => "custom_code",
126 126
                                 "allow_additional_redirect" => true,
127 127
                                 "async" => true,
128 128
                                 "selector" => "a[href*=\"optimizely\"]",
129 129
                                 "dependencies" => array(
130
-                                  24,
131
-                                  26
130
+                                    24,
131
+                                    26
132 132
                                 ),
133 133
                                 "destination" => "https://app.optimizely.com/",
134 134
                                 "extension_id" => 1234,
@@ -136,27 +136,27 @@  discard block
 block discarded – undo
136 136
                                 "src" => 524,
137 137
                                 "value" => "window.someGlobalFunction();",
138 138
                                 "id" => "string"
139
-                              )
139
+                                )
140 140
                             ),
141 141
                             "created" => "2016-10-18T03:27:04.139Z",
142 142
                             "earliest" => "2016-10-18T03:27:04.139Z",
143 143
                             "experiment_ids" => array(
144
-                              0
144
+                                0
145 145
                             ),
146 146
                             "holdback" => 0,
147 147
                             "last_modified" => "2016-10-18T03:27:04.139Z",
148 148
                             "latest" => "2016-10-18T03:27:04.139Z",
149 149
                             "metrics" => array(
150
-                              array(
150
+                                array(
151 151
                                 "aggregator" => "unique",
152 152
                                 "event_id" => 0,
153 153
                                 "field" => "revenue",
154 154
                                 "scope" => "session"
155
-                              )
155
+                                )
156 156
                             ),
157 157
                             "name" => "Landing Page Optimization",
158 158
                             "page_ids" => array(
159
-                              0
159
+                                0
160 160
                             ),
161 161
                             "status" => "active",
162 162
                             "type" => "a/b",
@@ -187,47 +187,47 @@  discard block
 block discarded – undo
187 187
                             "confidence_threshold" => 0,
188 188
                             "end_time" => "2016-10-18T03:27:04.147Z",
189 189
                             "metrics" => array(
190
-                              array(
190
+                                array(
191 191
                                 "event" => "string",
192 192
                                 "event_name" => "string",
193 193
                                 "measure" => "conversions",
194 194
                                 "metric_id" => "string",
195 195
                                 "priority" => 0,
196 196
                                 "results" => array(
197
-                                  "campaign" => array(
197
+                                    "campaign" => array(
198 198
                                     "experiment_id" => 0,
199 199
                                     "is_baseline" => true,
200 200
                                     "lift" => array(
201
-                                      "confidence_interval" => array(
201
+                                        "confidence_interval" => array(
202 202
                                         0.010399560300730457,
203 203
                                         0.0850821459929161
204
-                                      ),
205
-                                      "is_most_conclusive" => true,
206
-                                      "is_significant" => true,
207
-                                      "significance" => 0,
208
-                                      "value" => 0,
209
-                                      "visitors_remaining" => 0
204
+                                        ),
205
+                                        "is_most_conclusive" => true,
206
+                                        "is_significant" => true,
207
+                                        "significance" => 0,
208
+                                        "value" => 0,
209
+                                        "visitors_remaining" => 0
210 210
                                     ),
211 211
                                     "name" => "Blue Button",
212 212
                                     "rate" => 0,
213 213
                                     "scope" => "variation",
214 214
                                     "total_increase" => array(
215
-                                      "confidence_interval" => array(
215
+                                        "confidence_interval" => array(
216 216
                                         0.010399560300730457,
217 217
                                         0.0850821459929161
218
-                                      ),
219
-                                      "is_most_conclusive" => true,
220
-                                      "is_significant" => true,
221
-                                      "significance" => 0,
222
-                                      "value" => 0,
223
-                                      "visitors_remaining" => 0
218
+                                        ),
219
+                                        "is_most_conclusive" => true,
220
+                                        "is_significant" => true,
221
+                                        "significance" => 0,
222
+                                        "value" => 0,
223
+                                        "visitors_remaining" => 0
224 224
                                     ),
225 225
                                     "value" => 0,
226 226
                                     "variation_id" => "string"
227
-                                  )
227
+                                    )
228 228
                                 ),
229 229
                                 "unit" => "session"
230
-                              )
230
+                                )
231 231
                             ),
232 232
                             "start_time" => "2016-10-18T03:27:04.148Z"
233 233
                         ), 200);
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
         $result = new Result(array(
256 256
                             "project_id" => 1000,
257 257
                             "changes" => array(
258
-                              array(
258
+                                array(
259 259
                                 "type" => "custom_code",
260 260
                                 "allow_additional_redirect" => true, 
261 261
                                 "async" => true,
262 262
                                 "selector" => "a[href*=\"optimizely\"]",
263 263
                                 "dependencies" => array(
264
-                                  24,
265
-                                  26
264
+                                    24,
265
+                                    26
266 266
                                 ),
267 267
                                 "destination" => "https://app.optimizely.com/",
268 268
                                 "extension_id" => 1234,
@@ -270,27 +270,27 @@  discard block
 block discarded – undo
270 270
                                 "src" => 524,
271 271
                                 "value" => "window.someGlobalFunction();",
272 272
                                 "id" => "string"
273
-                              )
273
+                                )
274 274
                             ),
275 275
                             "created" => "2016-10-18T03:27:04.155Z",
276 276
                             "earliest" => "2016-10-18T03:27:04.155Z",
277 277
                             "experiment_ids" => array(
278
-                              0
278
+                                0
279 279
                             ),
280 280
                             "holdback" => 0,
281 281
                             "last_modified" => "2016-10-18T03:27:04.155Z",
282 282
                             "latest" => "2016-10-18T03:27:04.155Z",
283 283
                             "metrics" => array(
284
-                              array(
284
+                                array(
285 285
                                 "aggregator" => "unique",
286 286
                                 "event_id" => 0,
287 287
                                 "field" => "revenue",
288 288
                                 "scope" => "session"
289
-                              )
289
+                                )
290 290
                             ),
291 291
                             "name" => "Landing Page Optimization",
292 292
                             "page_ids" => array(
293
-                              0
293
+                                0
294 294
                             ),
295 295
                             "status" => "active",
296 296
                             "type" => "a/b",
@@ -305,41 +305,41 @@  discard block
 block discarded – undo
305 305
         $campaign = new Campaign(array(
306 306
                 "project_id" => 1000,
307 307
                 "changes" => array(
308
-                  array(
308
+                    array(
309 309
                     "type" => "custom_code",
310 310
                     "allow_additional_redirect" => true,
311 311
                     "async" => true,
312 312
                     "selector" => "a[href*=\"optimizely\"]",
313 313
                     "dependencies" => array(
314
-                      24,
315
-                      26
314
+                        24,
315
+                        26
316 316
                     ),
317 317
                     "destination" => "https://app.optimizely.com/",
318 318
                     "extension_id" => 1234,
319 319
                     "preserve_parameters" => true,
320 320
                     "src" => 524,
321 321
                     "value" => "window.someGlobalFunction();"
322
-                  )
322
+                    )
323 323
                 ),
324 324
                 "created" => "2016-10-18T03:27:04.067Z",
325 325
                 "earliest" => "2016-10-18T03:27:04.067Z",
326 326
                 "experiment_ids" => array(
327
-                  0
327
+                    0
328 328
                 ),
329 329
                 "holdback" => 0,
330 330
                 "last_modified" => "2016-10-18T03:27:04.067Z",
331 331
                 "latest" => "2016-10-18T03:27:04.067Z",
332 332
                 "metrics" => array(
333
-                  array(
333
+                    array(
334 334
                     "aggregator" => "unique",
335 335
                     "event_id" => 0,
336 336
                     "field" => "revenue",
337 337
                     "scope" => "session"
338
-                  )
338
+                    )
339 339
                 ),
340 340
                 "name" => "Landing Page Optimization",
341 341
                 "page_ids" => array(
342
-                  0
342
+                    0
343 343
                 ),
344 344
                 "status" => "active",
345 345
                 "type" => "a/b"
@@ -362,14 +362,14 @@  discard block
 block discarded – undo
362 362
         $result = new Result(array(
363 363
                             "project_id" => 1000,
364 364
                             "changes" => array(
365
-                              array(
365
+                                array(
366 366
                                 "type" => "custom_code",
367 367
                                 "allow_additional_redirect" => true, 
368 368
                                 "async" => true,
369 369
                                 "selector" => "a[href*=\"optimizely\"]",
370 370
                                 "dependencies" => array(
371
-                                  24,
372
-                                  26
371
+                                    24,
372
+                                    26
373 373
                                 ),
374 374
                                 "destination" => "https://app.optimizely.com/",
375 375
                                 "extension_id" => 1234,
@@ -377,27 +377,27 @@  discard block
 block discarded – undo
377 377
                                 "src" => 524,
378 378
                                 "value" => "window.someGlobalFunction();",
379 379
                                 "id" => "string"
380
-                              )
380
+                                )
381 381
                             ),
382 382
                             "created" => "2016-10-18T03:27:04.155Z",
383 383
                             "earliest" => "2016-10-18T03:27:04.155Z",
384 384
                             "experiment_ids" => array(
385
-                              0
385
+                                0
386 386
                             ),
387 387
                             "holdback" => 0,
388 388
                             "last_modified" => "2016-10-18T03:27:04.155Z",
389 389
                             "latest" => "2016-10-18T03:27:04.155Z",
390 390
                             "metrics" => array(
391
-                              array(
391
+                                array(
392 392
                                 "aggregator" => "unique",
393 393
                                 "event_id" => 0,
394 394
                                 "field" => "revenue",
395 395
                                 "scope" => "session"
396
-                              )
396
+                                )
397 397
                             ),
398 398
                             "name" => "Landing Page Optimization",
399 399
                             "page_ids" => array(
400
-                              0
400
+                                0
401 401
                             ),
402 402
                             "status" => "active",
403 403
                             "type" => "a/b",
@@ -412,41 +412,41 @@  discard block
 block discarded – undo
412 412
         $campaign = new Campaign(array(
413 413
                 "project_id" => 1000,
414 414
                 "changes" => array(
415
-                  array(
415
+                    array(
416 416
                     "type" => "custom_code",
417 417
                     "allow_additional_redirect" => true,
418 418
                     "async" => true,
419 419
                     "selector" => "a[href*=\"optimizely\"]",
420 420
                     "dependencies" => array(
421
-                      24,
422
-                      26
421
+                        24,
422
+                        26
423 423
                     ),
424 424
                     "destination" => "https://app.optimizely.com/",
425 425
                     "extension_id" => 1234,
426 426
                     "preserve_parameters" => true,
427 427
                     "src" => 524,
428 428
                     "value" => "window.someGlobalFunction();"
429
-                  )
429
+                    )
430 430
                 ),
431 431
                 "created" => "2016-10-18T03:27:04.067Z",
432 432
                 "earliest" => "2016-10-18T03:27:04.067Z",
433 433
                 "experiment_ids" => array(
434
-                  0
434
+                    0
435 435
                 ),
436 436
                 "holdback" => 0,
437 437
                 "last_modified" => "2016-10-18T03:27:04.067Z",
438 438
                 "latest" => "2016-10-18T03:27:04.067Z",
439 439
                 "metrics" => array(
440
-                  array(
440
+                    array(
441 441
                     "aggregator" => "unique",
442 442
                     "event_id" => 0,
443 443
                     "field" => "revenue",
444 444
                     "scope" => "session"
445
-                  )
445
+                    )
446 446
                 ),
447 447
                 "name" => "Landing Page Optimization",
448 448
                 "page_ids" => array(
449
-                  0
449
+                    0
450 450
                 ),
451 451
                 "status" => "active",
452 452
                 "type" => "a/b"
@@ -498,14 +498,14 @@  discard block
 block discarded – undo
498 498
             "platform" => "web",
499 499
             "status" => "active",
500 500
             "web_snippet" => array(
501
-              "enable_force_variation" => false,
502
-              "exclude_disabled_experiments" => false,
503
-              "exclude_names" => true,
504
-              "include_jquery" => true,
505
-              "ip_anonymization" => false,
506
-              "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
507
-              "library" => "jquery-1.11.3-trim",
508
-              "project_javascript" => "alert(\"Active Experiment\")"
501
+                "enable_force_variation" => false,
502
+                "exclude_disabled_experiments" => false,
503
+                "exclude_names" => true,
504
+                "include_jquery" => true,
505
+                "ip_anonymization" => false,
506
+                "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
507
+                "library" => "jquery-1.11.3-trim",
508
+                "project_javascript" => "alert(\"Active Experiment\")"
509 509
             )
510 510
         ));
511 511
         
@@ -539,30 +539,30 @@  discard block
 block discarded – undo
539 539
         $campaign = new Campaign(array(
540 540
                 "project_id" => $createdProject->getId(),
541 541
                 "changes" => array(
542
-                  array(
542
+                    array(
543 543
                     "type" => "custom_code",
544 544
                     "value" => "window.someGlobalFunction();"
545
-                  )
545
+                    )
546 546
                 ),
547 547
                 "created" => "2016-10-18T03:27:04.067Z",
548 548
                 "earliest" => "2016-10-18T03:27:04.067Z",
549 549
                 "experiment_ids" => array(
550
-                  0
550
+                    0
551 551
                 ),
552 552
                 "holdback" => 0,
553 553
                 "last_modified" => "2016-10-18T03:27:04.067Z",
554 554
                 "latest" => "2016-10-18T03:27:04.067Z",
555 555
                 "metrics" => array(
556
-                  array(
556
+                    array(
557 557
                     "aggregator" => "sum",
558 558
                     "event_id" => 0,
559 559
                     "field" => "revenue",
560 560
                     "scope" => "session"
561
-                  )
561
+                    )
562 562
                 ),
563 563
                 "name" => "Landing Page Optimization",
564 564
                 "page_ids" => array(
565
-                  $createdPage->getId(),
565
+                    $createdPage->getId(),
566 566
                 ),
567 567
                 "status" => "not_started",
568 568
                 "type" => "a/b"
Please login to merge, or discard this patch.
tests/OptimizelyPHPTest/Service/v2/ExperimentsTest.php 1 patch
Indentation   +232 added lines, -232 removed lines patch added patch discarded remove patch
@@ -27,20 +27,20 @@  discard block
 block discarded – undo
27 27
                         array(
28 28
                             "project_id" => 1000,
29 29
                             "audience_ids" => array(
30
-                              1234,
31
-                              1212,
32
-                              1432
30
+                                1234,
31
+                                1212,
32
+                                1432
33 33
                             ),
34 34
                             "campaign_id" => 2000,
35 35
                             "changes" => array(
36
-                              array(
36
+                                array(
37 37
                                 "type" => "custom_code",
38 38
                                 "allow_additional_redirect" => true,
39 39
                                 "async" => true,
40 40
                                 "selector" => "a[href*=\"optimizely\"]",
41 41
                                 "dependencies" => array(
42
-                                  24,
43
-                                  26
42
+                                    24,
43
+                                    26
44 44
                                 ),
45 45
                                 "destination" => "https://app.optimizely.com/",
46 46
                                 "extension_id" => 1234,
@@ -48,39 +48,39 @@  discard block
 block discarded – undo
48 48
                                 "src" => 524,
49 49
                                 "value" => "window.someGlobalFunction();",
50 50
                                 "id" => "string"
51
-                              )
51
+                                )
52 52
                             ),
53 53
                             "description" => "string",
54 54
                             "holdback" => 5000,
55 55
                             "key" => "home_page_experiment",
56 56
                             "metrics" => array(
57
-                              array(
57
+                                array(
58 58
                                 "aggregator" => "unique",
59 59
                                 "event_id" => 0,
60 60
                                 "field" => "revenue",
61 61
                                 "scope" => "visitor"
62
-                              )
62
+                                )
63 63
                             ),
64 64
                             "name" => "Blue Button Experiment",
65 65
                             "schedule" => array(
66
-                              "start_time" => "2016-10-17T07:05:00.070Z",
67
-                              "stop_time" => "2016-10-17T07:05:00.070Z",
68
-                              "time_zone" => "UTC"
66
+                                "start_time" => "2016-10-17T07:05:00.070Z",
67
+                                "stop_time" => "2016-10-17T07:05:00.070Z",
68
+                                "time_zone" => "UTC"
69 69
                             ),
70 70
                             "status" => "active",
71 71
                             "variations" => array(
72
-                              array(
72
+                                array(
73 73
                                 "actions" => array(
74
-                                  array(
74
+                                    array(
75 75
                                     "changes" => array(
76
-                                      array(
76
+                                        array(
77 77
                                         "type" => "custom_code",
78 78
                                         "allow_additional_redirect" => true, 
79 79
                                         "async" => true,
80 80
                                         "selector" => "a[href*=\"optimizely\"]",
81 81
                                         "dependencies" => array(
82
-                                          24,
83
-                                          26
82
+                                            24,
83
+                                            26
84 84
                                         ),
85 85
                                         "destination" => "https://app.optimizely.com/",
86 86
                                         "extension_id" => 1234,
@@ -88,23 +88,23 @@  discard block
 block discarded – undo
88 88
                                         "src" => 524,
89 89
                                         "value" => "window.someGlobalFunction();",
90 90
                                         "id" => "string"
91
-                                      )
91
+                                        )
92 92
                                     ),
93 93
                                     "page_id" => 0
94
-                                  )
94
+                                    )
95 95
                                 ),
96 96
                                 "archived"=> true,
97 97
                                 "key" => "blue_button_variation",
98 98
                                 "name" => "Blue Button",
99 99
                                 "variation_id" => 0,
100 100
                                 "weight" => 0
101
-                              )
101
+                                )
102 102
                             ),
103 103
                             "created" => "2016-10-17T07:05:00.070Z",
104 104
                             "id" => 3000,
105 105
                             "is_classic" => false,
106 106
                             "last_modified" => "2016-10-17T07:05:00.070Z"
107
-                          )
107
+                            )
108 108
                         ), 200);
109 109
         
110 110
         $optimizelyApiClientMock->method('sendApiRequest')
@@ -175,20 +175,20 @@  discard block
 block discarded – undo
175 175
         $result = new Result(array(
176 176
                             "project_id" => 1000,
177 177
                             "audience_ids" => array(
178
-                              1234,
179
-                              1212,
180
-                              1432
178
+                                1234,
179
+                                1212,
180
+                                1432
181 181
                             ),
182 182
                             "campaign_id" => 2000,
183 183
                             "changes" => array(
184
-                              array(
184
+                                array(
185 185
                                 "type" => "custom_code",
186 186
                                 "allow_additional_redirect" => true,
187 187
                                 "async" => true,
188 188
                                 "selector" => "a[href*=\"optimizely\"]",
189 189
                                 "dependencies" => array(
190
-                                  24,
191
-                                  26
190
+                                    24,
191
+                                    26
192 192
                                 ),
193 193
                                 "destination" => "https://app.optimizely.com/",
194 194
                                 "extension_id" => 1234,
@@ -196,39 +196,39 @@  discard block
 block discarded – undo
196 196
                                 "src" => 524,
197 197
                                 "value" => "window.someGlobalFunction();",
198 198
                                 "id" => "string"
199
-                              )
199
+                                )
200 200
                             ),
201 201
                             "description" => "string",
202 202
                             "holdback" => 5000,
203 203
                             "key" => "home_page_experiment",
204 204
                             "metrics" => array(
205
-                              array(
205
+                                array(
206 206
                                 "aggregator" => "unique",
207 207
                                 "event_id" => 0,
208 208
                                 "field" => "revenue",
209 209
                                 "scope" => "session"
210
-                              )
210
+                                )
211 211
                             ),
212 212
                             "name" => "Blue Button Experiment",
213 213
                             "schedule" => array(
214
-                              "start_time" => "2016-10-17T07:05:00.070Z",
215
-                              "stop_time" => "2016-10-17T07:05:00.070Z",
216
-                              "time_zone" => "UTC"
214
+                                "start_time" => "2016-10-17T07:05:00.070Z",
215
+                                "stop_time" => "2016-10-17T07:05:00.070Z",
216
+                                "time_zone" => "UTC"
217 217
                             ),
218 218
                             "status" => "active",
219 219
                             "variations" => array(
220
-                              array(
220
+                                array(
221 221
                                 "actions" => array(
222
-                                  array(
222
+                                    array(
223 223
                                     "changes" => array(
224
-                                      array(
224
+                                        array(
225 225
                                         "type" => "custom_code",
226 226
                                         "allow_additional_redirect" => true, 
227 227
                                         "async" => true,
228 228
                                         "selector" => "a[href*=\"optimizely\"]",
229 229
                                         "dependencies" => array(
230
-                                          24,
231
-                                          26
230
+                                            24,
231
+                                            26
232 232
                                         ),
233 233
                                         "destination" => "https://app.optimizely.com/",
234 234
                                         "extension_id" => 1234,
@@ -236,23 +236,23 @@  discard block
 block discarded – undo
236 236
                                         "src" => 524,
237 237
                                         "value" => "window.someGlobalFunction();",
238 238
                                         "id" => "string"
239
-                                      )
239
+                                        )
240 240
                                     ),
241 241
                                     "page_id" => 0
242
-                                  )
242
+                                    )
243 243
                                 ),
244 244
                                 "archived"=> true,
245 245
                                 "key" => "blue_button_variation",
246 246
                                 "name" => "Blue Button",
247 247
                                 "variation_id" => 0,
248 248
                                 "weight" => 0
249
-                              )
249
+                                )
250 250
                             ),
251 251
                             "created" => "2016-10-17T07:05:00.070Z",
252 252
                             "id" => 3000,
253 253
                             "is_classic" => false,
254 254
                             "last_modified" => "2016-10-17T07:05:00.070Z"
255
-                          ), 200);
255
+                            ), 200);
256 256
         
257 257
         $optimizelyApiClientMock->method('sendApiRequest')
258 258
                     ->willReturn($result);
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                             "end_time" => "2016-10-17T07:05:00.089Z",
309 309
                             "experiment_id" => 3000,
310 310
                             "metrics" => array(
311
-                              array(
311
+                                array(
312 312
                                 "event" => "string",
313 313
                                 "event_name" => "string",
314 314
                                 "measure" => "conversions",
@@ -316,54 +316,54 @@  discard block
 block discarded – undo
316 316
                                 "priority" => 1,
317 317
                                 "unit" => "session",
318 318
                                 "variation_results" => array(
319
-                                  "9000" => array(
319
+                                    "9000" => array(
320 320
                                     "experiment_id" => 0,
321 321
                                     "is_baseline" => true,
322 322
                                     "lift" => array(
323
-                                      "confidence_interval" => array(
323
+                                        "confidence_interval" => array(
324 324
                                         0.010399560300730457,
325 325
                                         0.0850821459929161
326
-                                      ),
327
-                                      "is_most_conclusive" => true,
328
-                                      "is_significant" => true,
329
-                                      "significance" => 0,
330
-                                      "value" => 0,
331
-                                      "visitors_remaining" => 0
326
+                                        ),
327
+                                        "is_most_conclusive" => true,
328
+                                        "is_significant" => true,
329
+                                        "significance" => 0,
330
+                                        "value" => 0,
331
+                                        "visitors_remaining" => 0
332 332
                                     ),
333 333
                                     "name" => "Blue Button",
334 334
                                     "rate" => 0,
335 335
                                     "scope" => "variation",
336 336
                                     "total_increase" => array(
337
-                                      "confidence_interval" => array(
337
+                                        "confidence_interval" => array(
338 338
                                         0.010399560300730457,
339 339
                                         0.0850821459929161
340
-                                      ),
341
-                                      "is_most_conclusive" => true,
342
-                                      "is_significant" => true,
343
-                                      "significance" => 0,
344
-                                      "value" => 0,
345
-                                      "visitors_remaining" => 0
340
+                                        ),
341
+                                        "is_most_conclusive" => true,
342
+                                        "is_significant" => true,
343
+                                        "significance" => 0,
344
+                                        "value" => 0,
345
+                                        "visitors_remaining" => 0
346 346
                                     ),
347 347
                                     "value" => 0,
348 348
                                     "variation_id" => "string"
349
-                                  )
349
+                                    )
350
+                                )
350 351
                                 )
351
-                              )
352 352
                             ),
353 353
                             "reach" => array(
354
-                              "baseline_count" => 0,
355
-                              "baseline_reach" => 0,
356
-                              "total_count" => 0,
357
-                              "treatment_count" => 0,
358
-                              "treatment_reach" => 0,
359
-                              "variations" => array(
354
+                                "baseline_count" => 0,
355
+                                "baseline_reach" => 0,
356
+                                "total_count" => 0,
357
+                                "treatment_count" => 0,
358
+                                "treatment_reach" => 0,
359
+                                "variations" => array(
360 360
                                 "9000" => array(
361
-                                  "count" => 0,
362
-                                  "name" => "Blue Button",
363
-                                  "variation_id" => "string",
364
-                                  "variation_reach" => 0
361
+                                    "count" => 0,
362
+                                    "name" => "Blue Button",
363
+                                    "variation_id" => "string",
364
+                                    "variation_reach" => 0
365
+                                )
365 366
                                 )
366
-                              )
367 367
                             ),
368 368
                             "start_time" => "2016-10-17T07:05:00.090Z"
369 369
                         ), 200);
@@ -390,20 +390,20 @@  discard block
 block discarded – undo
390 390
         $result = new Result(array(
391 391
                             "project_id" => 1000,
392 392
                             "audience_ids" => array(
393
-                              1234,
394
-                              1212,
395
-                              1432
393
+                                1234,
394
+                                1212,
395
+                                1432
396 396
                             ),
397 397
                             "campaign_id" => 2000,
398 398
                             "changes" => array(
399
-                              array(
399
+                                array(
400 400
                                 "type" => "custom_code",
401 401
                                 "allow_additional_redirect" => true,
402 402
                                 "async" => true,
403 403
                                 "selector" => "a[href*=\"optimizely\"]",
404 404
                                 "dependencies" => array(
405
-                                  24,
406
-                                  26
405
+                                    24,
406
+                                    26
407 407
                                 ),
408 408
                                 "destination" => "https://app.optimizely.com/",
409 409
                                 "extension_id" => 1234,
@@ -411,39 +411,39 @@  discard block
 block discarded – undo
411 411
                                 "src" => 524,
412 412
                                 "value" => "window.someGlobalFunction();",
413 413
                                 "id" => "string"
414
-                              )
414
+                                )
415 415
                             ),
416 416
                             "description" => "string",
417 417
                             "holdback" => 5000,
418 418
                             "key" => "home_page_experiment",
419 419
                             "metrics" => array(
420
-                              array(
420
+                                array(
421 421
                                 "aggregator" => "unique",
422 422
                                 "event_id" => 0,
423 423
                                 "field" => "revenue",
424 424
                                 "scope" => "session"
425
-                              )
425
+                                )
426 426
                             ),
427 427
                             "name" => "Blue Button Experiment",
428 428
                             "schedule" => array(
429
-                              "start_time" => "2016-10-17T07:05:00.099Z",
430
-                              "stop_time" => "2016-10-17T07:05:00.099Z",
431
-                              "time_zone" => "UTC"
429
+                                "start_time" => "2016-10-17T07:05:00.099Z",
430
+                                "stop_time" => "2016-10-17T07:05:00.099Z",
431
+                                "time_zone" => "UTC"
432 432
                             ),
433 433
                             "status" => "active",
434 434
                             "variations" => array(
435
-                              array(
435
+                                array(
436 436
                                 "actions" => array(
437
-                                  array(
437
+                                    array(
438 438
                                     "changes" => array(
439
-                                      array(
439
+                                        array(
440 440
                                         "type" => "custom_code",
441 441
                                         "allow_additional_redirect" => true,
442 442
                                         "async" => true,
443 443
                                         "selector" => "a[href*=\"optimizely\"]",
444 444
                                         "dependencies" => array(
445
-                                          24,
446
-                                          26
445
+                                            24,
446
+                                            26
447 447
                                         ),
448 448
                                         "destination" => "https://app.optimizely.com/",
449 449
                                         "extension_id" => 1234,
@@ -451,17 +451,17 @@  discard block
 block discarded – undo
451 451
                                         "src" => 524,
452 452
                                         "value" => "window.someGlobalFunction();",
453 453
                                         "id" => "string"
454
-                                      )
454
+                                        )
455 455
                                     ),
456 456
                                     "page_id" => 0
457
-                                  )
457
+                                    )
458 458
                                 ),
459 459
                                 "archived" => true,
460 460
                                 "key" => "blue_button_variation",
461 461
                                 "name" => "Blue Button",
462 462
                                 "variation_id" => 0,
463 463
                                 "weight" => 0
464
-                              )
464
+                                )
465 465
                             ),
466 466
                             "created" => "2016-10-17T07:05:00.099Z",
467 467
                             "id" => 3000,
@@ -477,76 +477,76 @@  discard block
 block discarded – undo
477 477
         $experiment = new Experiment(array(
478 478
             "project_id" => 1000,
479 479
             "audience_ids" => array(
480
-              1234,
481
-              1212,
482
-              1432
480
+                1234,
481
+                1212,
482
+                1432
483 483
             ),
484 484
             "campaign_id" => 2000,
485 485
             "changes" => array(
486
-              array(
486
+                array(
487 487
                 "type" => "custom_code",
488 488
                 "allow_additional_redirect" => true,
489 489
                 "async" => true,
490 490
                 "selector" => "a[href*=\"optimizely\"]",
491 491
                 "dependencies" => array(
492
-                  24,
493
-                  26
492
+                    24,
493
+                    26
494 494
                 ),
495 495
                 "destination" => "https://app.optimizely.com/",
496 496
                 "extension_id" => 1234,
497 497
                 "preserve_parameters" => true,
498 498
                 "src" => 524,
499 499
                 "value" => "window.someGlobalFunction();"
500
-              )
500
+                )
501 501
             ),
502 502
             "description" => "string",
503 503
             "holdback" => 5000,
504 504
             "key" => "home_page_experiment",
505 505
             "metrics" => array(
506
-              array(
506
+                array(
507 507
                 "aggregator" => "unique",
508 508
                 "event_id" => 0,
509 509
                 "field" => "revenue",
510 510
                 "scope" => "session"
511
-              )
511
+                )
512 512
             ),
513 513
             "name" => "Blue Button Experiment",
514 514
             "schedule" => array(
515
-              "start_time" => "2016-10-17T07:04:59.724Z",
516
-              "stop_time" => "2016-10-17T07:04:59.724Z",
517
-              "time_zone" => "UTC"
515
+                "start_time" => "2016-10-17T07:04:59.724Z",
516
+                "stop_time" => "2016-10-17T07:04:59.724Z",
517
+                "time_zone" => "UTC"
518 518
             ),
519 519
             "status" => "active",
520 520
             "variations" => array(
521
-              array(
521
+                array(
522 522
                 "actions" => array(
523
-                  array(
523
+                    array(
524 524
                     "changes" => array(
525
-                      array(
525
+                        array(
526 526
                         "type" => "custom_code",
527 527
                         "allow_additional_redirect" => true,
528 528
                         "async" => true,
529 529
                         "selector" => "a[href*=\"optimizely\"]",
530 530
                         "dependencies" => array(
531
-                          24,
532
-                          26
531
+                            24,
532
+                            26
533 533
                         ),
534 534
                         "destination" => "https://app.optimizely.com/",
535 535
                         "extension_id" => 1234,
536 536
                         "preserve_parameters" => true,
537 537
                         "src" => 524,
538 538
                         "value" => "window.someGlobalFunction();"
539
-                      )
539
+                        )
540 540
                     ),
541 541
                     "page_id" => 0
542
-                  )
542
+                    )
543 543
                 ),
544 544
                 "archived" => true,
545 545
                 "key" => "blue_button_variation",
546 546
                 "name" => "Blue Button",
547 547
                 "variation_id" => 0,
548 548
                 "weight" => 0
549
-              )
549
+                )
550 550
             )
551 551
         ));
552 552
         
@@ -567,20 +567,20 @@  discard block
 block discarded – undo
567 567
         $result = new Result(array(
568 568
                         "project_id" => 1000,
569 569
                         "audience_ids" => array(
570
-                          1234,
571
-                          1212,
572
-                          1432
570
+                            1234,
571
+                            1212,
572
+                            1432
573 573
                         ),
574 574
                         "campaign_id" => 2000,
575 575
                         "changes" => array(
576
-                          array(
576
+                            array(
577 577
                             "type" => "custom_code",
578 578
                             "allow_additional_redirect" => true,
579 579
                             "async" => true,
580 580
                             "selector" => "a[href*=\"optimizely\"]",
581 581
                             "dependencies" => array(
582
-                              24,
583
-                              26
582
+                                24,
583
+                                26
584 584
                             ),
585 585
                             "destination" => "https://app.optimizely.com/",
586 586
                             "extension_id" => 1234,
@@ -588,39 +588,39 @@  discard block
 block discarded – undo
588 588
                             "src" => 524,
589 589
                             "value" => "window.someGlobalFunction();",
590 590
                             "id" => "string"
591
-                          )
591
+                            )
592 592
                         ),
593 593
                         "description" => "string",
594 594
                         "holdback" => 5000,
595 595
                         "key" => "home_page_experiment",
596 596
                         "metrics" => array(
597
-                          array(
597
+                            array(
598 598
                             "aggregator" => "unique",
599 599
                             "event_id" => 0,
600 600
                             "field" => "revenue",
601 601
                             "scope" => "session"
602
-                          )
602
+                            )
603 603
                         ),
604 604
                         "name" => "Blue Button Experiment",
605 605
                         "schedule" => array(
606
-                          "start_time" => "2016-10-17T07:05:00.109Z",
607
-                          "stop_time" => "2016-10-17T07:05:00.109Z",
608
-                          "time_zone" => "UTC"
606
+                            "start_time" => "2016-10-17T07:05:00.109Z",
607
+                            "stop_time" => "2016-10-17T07:05:00.109Z",
608
+                            "time_zone" => "UTC"
609 609
                         ),
610 610
                         "status" => "active",
611 611
                         "variations" => array(
612
-                          array(
612
+                            array(
613 613
                             "actions" => array(
614
-                              array(
614
+                                array(
615 615
                                 "changes" => array(
616
-                                  array(
616
+                                    array(
617 617
                                     "type" => "custom_code",
618 618
                                     "allow_additional_redirect" => true,
619 619
                                     "async" => true,
620 620
                                     "selector" => "a[href*=\"optimizely\"]",
621 621
                                     "dependencies" => array(
622
-                                      24,
623
-                                      26
622
+                                        24,
623
+                                        26
624 624
                                     ),
625 625
                                     "destination" => "https://app.optimizely.com/",
626 626
                                     "extension_id" => 1234,
@@ -628,17 +628,17 @@  discard block
 block discarded – undo
628 628
                                     "src" => 524,
629 629
                                     "value" => "window.someGlobalFunction();",
630 630
                                     "id" => "string"
631
-                                  )
631
+                                    )
632 632
                                 ),
633 633
                                 "page_id" => 0
634
-                              )
634
+                                )
635 635
                             ),
636 636
                             "archived" => true,
637 637
                             "key" => "blue_button_variation",
638 638
                             "name" => "Blue Button",
639 639
                             "variation_id" => 0,
640 640
                             "weight" => 0
641
-                          )
641
+                            )
642 642
                         ),
643 643
                         "created" => "2016-10-17T07:05:00.109Z",
644 644
                         "id" => 3000,
@@ -652,75 +652,75 @@  discard block
 block discarded – undo
652 652
         $experimentsService = new Experiments($optimizelyApiClientMock);
653 653
         
654 654
         $experiment = new Experiment(array(
655
-              "audience_ids" => array(
655
+                "audience_ids" => array(
656 656
                 0
657
-              ),
658
-              "changes" => array(
657
+                ),
658
+                "changes" => array(
659 659
                 array(
660
-                  "type" => "custom_code",
661
-                  "allow_additional_redirect" => true,
662
-                  "async" => true,
663
-                  "selector" => "a[href*=\"optimizely\"]",
664
-                  "dependencies" => array(
660
+                    "type" => "custom_code",
661
+                    "allow_additional_redirect" => true,
662
+                    "async" => true,
663
+                    "selector" => "a[href*=\"optimizely\"]",
664
+                    "dependencies" => array(
665 665
                     24,
666 666
                     26
667
-                  ),
668
-                  "destination" => "https://app.optimizely.com/",
669
-                  "extension_id" => 1234,
670
-                  "preserve_parameters" => true,
671
-                  "src" => 524,
672
-                  "value" => "window.someGlobalFunction();"
667
+                    ),
668
+                    "destination" => "https://app.optimizely.com/",
669
+                    "extension_id" => 1234,
670
+                    "preserve_parameters" => true,
671
+                    "src" => 524,
672
+                    "value" => "window.someGlobalFunction();"
673 673
                 )
674
-              ),
675
-              "description" => "AB Test to see if the Blue Button converts more visitors",
676
-              "holdback" => 0,
677
-              "key" => "home_page_experiment",
678
-              "metrics" => array(
674
+                ),
675
+                "description" => "AB Test to see if the Blue Button converts more visitors",
676
+                "holdback" => 0,
677
+                "key" => "home_page_experiment",
678
+                "metrics" => array(
679 679
                 array(
680
-                  "aggregator" => "unique",
681
-                  "event_id" => 0,
682
-                  "field" => "revenue",
683
-                  "scope" => "session"
680
+                    "aggregator" => "unique",
681
+                    "event_id" => 0,
682
+                    "field" => "revenue",
683
+                    "scope" => "session"
684 684
                 )
685
-              ),
686
-              "name" => "Blue Button Experiment",
687
-              "schedule" => array(
685
+                ),
686
+                "name" => "Blue Button Experiment",
687
+                "schedule" => array(
688 688
                 "start_time" => "2016-10-17T07:04:59.731Z",
689 689
                 "stop_time" => "2016-10-17T07:04:59.731Z",
690 690
                 "time_zone" => "UTC"
691
-              ),
692
-              "status" => "active",
693
-              "variations" => array(
691
+                ),
692
+                "status" => "active",
693
+                "variations" => array(
694 694
                 array(
695
-                  "actions" => array(
695
+                    "actions" => array(
696 696
                     array(
697
-                      "changes" => array(
697
+                        "changes" => array(
698 698
                         array(
699
-                          "type" => "custom_code",
700
-                          "allow_additional_redirect" => true,
701
-                          "async" => true,
702
-                          "selector" => "a[href*=\"optimizely\"]",
703
-                          "dependencies" => array(
699
+                            "type" => "custom_code",
700
+                            "allow_additional_redirect" => true,
701
+                            "async" => true,
702
+                            "selector" => "a[href*=\"optimizely\"]",
703
+                            "dependencies" => array(
704 704
                             24,
705 705
                             26
706
-                          ),
707
-                          "destination" => "https://app.optimizely.com/",
708
-                          "extension_id" => 1234,
709
-                          "preserve_parameters" => true,
710
-                          "src" => 524,
711
-                          "value" => "window.someGlobalFunction();"
706
+                            ),
707
+                            "destination" => "https://app.optimizely.com/",
708
+                            "extension_id" => 1234,
709
+                            "preserve_parameters" => true,
710
+                            "src" => 524,
711
+                            "value" => "window.someGlobalFunction();"
712 712
                         )
713
-                      ),
714
-                      "page_id" => 0
713
+                        ),
714
+                        "page_id" => 0
715 715
                     )
716
-                  ),
717
-                  "archived" => true,
718
-                  "key" => "blue_button_variation",
719
-                  "name" => "Blue Button",
720
-                  "variation_id" => 0,
721
-                  "weight" => 0
716
+                    ),
717
+                    "archived" => true,
718
+                    "key" => "blue_button_variation",
719
+                    "name" => "Blue Button",
720
+                    "variation_id" => 0,
721
+                    "weight" => 0
722
+                )
722 723
                 )
723
-              )
724 724
         ));
725 725
         
726 726
         $result = $experimentsService->update(1000, $experiment, 'start');
@@ -768,14 +768,14 @@  discard block
 block discarded – undo
768 768
             "platform" => "web",
769 769
             "status" => "active",
770 770
             "web_snippet" => array(
771
-              "enable_force_variation" => false,
772
-              "exclude_disabled_experiments" => false,
773
-              "exclude_names" => true,
774
-              "include_jquery" => true,
775
-              "ip_anonymization" => false,
776
-              "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
777
-              "library" => "jquery-1.11.3-trim",
778
-              "project_javascript" => "alert(\"Active Experiment\")"
771
+                "enable_force_variation" => false,
772
+                "exclude_disabled_experiments" => false,
773
+                "exclude_names" => true,
774
+                "include_jquery" => true,
775
+                "ip_anonymization" => false,
776
+                "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
777
+                "library" => "jquery-1.11.3-trim",
778
+                "project_javascript" => "alert(\"Active Experiment\")"
779 779
             )
780 780
         ));
781 781
         
@@ -804,22 +804,22 @@  discard block
 block discarded – undo
804 804
         
805 805
         // Create new event in the project
806 806
         $event = new ClickEvent(array(
807
-              "event_filter" => array(
807
+                "event_filter" => array(
808 808
                 "filter_type" => "target_selector",
809 809
                 "selector" => ".menu-options"
810
-              ),
811
-              "name" => "Add to Cart",
812
-              "archived" => true,
813
-              "category" => "add_to_cart",
814
-              "description" => "Some simple event",
815
-              "event_type" => "click",
816
-              "key" => "add_to_cart",
817
-              "created" => "2016-10-18T05:07:04.153Z",
818
-              "id" => 0,
819
-              "is_classic" => false,
820
-              //"is_editable" => true,
821
-              "page_id" => $createdPage->getId(),
822
-              "project_id" => $createdProject->getId()
810
+                ),
811
+                "name" => "Add to Cart",
812
+                "archived" => true,
813
+                "category" => "add_to_cart",
814
+                "description" => "Some simple event",
815
+                "event_type" => "click",
816
+                "key" => "add_to_cart",
817
+                "created" => "2016-10-18T05:07:04.153Z",
818
+                "id" => 0,
819
+                "is_classic" => false,
820
+                //"is_editable" => true,
821
+                "page_id" => $createdPage->getId(),
822
+                "project_id" => $createdProject->getId()
823 823
         ));
824 824
         
825 825
         $result = $optimizelyClient->events()->createClickEvent($createdPage->getId(), $event);
@@ -843,15 +843,15 @@  discard block
 block discarded – undo
843 843
             "project_id" => $createdProject->getId(),
844 844
             "variations" => [
845 845
             [
846
-              "weight" => 10000,
847
-              "actions" => [
846
+                "weight" => 10000,
847
+                "actions" => [
848 848
                 [
849
-                  "changes" => [
849
+                    "changes" => [
850 850
                     [
851
-                      "type" => "attribute",
852
-                      //"allow_additional_redirect" => true,
853
-                      "async" => true,
854
-                      "attributes" => [
851
+                        "type" => "attribute",
852
+                        //"allow_additional_redirect" => true,
853
+                        "async" => true,
854
+                        "attributes" => [
855 855
                         "class" => "intro",
856 856
                         "hide" => true,
857 857
                         "href" => "example.com",
@@ -860,9 +860,9 @@  discard block
 block discarded – undo
860 860
                         "src" => "song.mp3",
861 861
                         "style" => "background-color:blue;",
862 862
                         "text" => "Some nice message"
863
-                      ],
864
-                      //"config" => ["name" => "Flash Sale Today!", "color" => "blue"],
865
-                      "css" => [
863
+                        ],
864
+                        //"config" => ["name" => "Flash Sale Today!", "color" => "blue"],
865
+                        "css" => [
866 866
                         "background-color" => "string",
867 867
                         "background-image" => "string",
868 868
                         "border-color" => "string",
@@ -874,38 +874,38 @@  discard block
 block discarded – undo
874 874
                         "height" => "string",
875 875
                         "position" => "string",
876 876
                         "width" => "string"
877
-                      ],
878
-                      /*"dependencies" => [
877
+                        ],
878
+                        /*"dependencies" => [
879 879
                         '24',
880 880
                         '26'
881 881
                       ],*/
882
-                      //"destination" => "https://app.optimizely.com/",
883
-                      "name" => "Setting button text",
884
-                      //"operator" => "after",
885
-                      //"preserve_parameters" => true,
886
-                      "rearrange" => "{\"insertSelector\": \".greyBox\", \"operator\": \"before\"}",
887
-                      "selector" => "a[href*=\"optimizely\"]",
888
-                      //"value" => "window.someGlobalFunction();"
882
+                        //"destination" => "https://app.optimizely.com/",
883
+                        "name" => "Setting button text",
884
+                        //"operator" => "after",
885
+                        //"preserve_parameters" => true,
886
+                        "rearrange" => "{\"insertSelector\": \".greyBox\", \"operator\": \"before\"}",
887
+                        "selector" => "a[href*=\"optimizely\"]",
888
+                        //"value" => "window.someGlobalFunction();"
889 889
                     ]
890
-                  ],
891
-                  "page_id" => $createdPage->getId(),
890
+                    ],
891
+                    "page_id" => $createdPage->getId(),
892 892
                 ]
893
-              ],
894
-              "archived" => false,
895
-              "key" => "blue_button_variation",
896
-              "name" => "Blue Button"
893
+                ],
894
+                "archived" => false,
895
+                "key" => "blue_button_variation",
896
+                "name" => "Blue Button"
897 897
             ]
898
-          ],
898
+            ],
899 899
             "description" => "string",
900 900
             "holdback" => 5000,
901 901
             "key" => "home_page_experiment",
902 902
             "metrics" => array(
903
-              array(
903
+                array(
904 904
                 "aggregator" => "sum",
905 905
                 "event_id" => $createdEvent->getId(),
906 906
                 "field" => "revenue",
907 907
                 "scope" => "visitor"
908
-              )
908
+                )
909 909
             ),
910 910
             "name" => "Blue Button Experiment",
911 911
             /*"schedule" => array(
Please login to merge, or discard this patch.