Completed
Push — master ( a99496...5c0b02 )
by Oleg
02:28
created
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/InPageEventConfig.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
             switch ($name) {                
29 29
                 case 'selector': $this->setSelector($value); break;
30 30
                 default:
31
-                    throw new Exception('Unknown option found in the InPageConfig entity: ' . $name);
31
+                    throw new Exception('Unknown option found in the InPageConfig entity: '.$name);
32 32
             }
33 33
         }
34 34
     }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         // Remove options with empty values
46 46
         $cleanedOptions = array();
47 47
         foreach ($options as $name=>$value) {
48
-            if ($value!==null)
48
+            if ($value !== null)
49 49
                 $cleanedOptions[$name] = $value;
50 50
         }
51 51
         
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Event.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                 case 'is_editable': $this->setIsEditable($value); break;                
133 133
                 case 'config': $this->setConfig(new InPageEventConfig($value)); break;
134 134
                 default:
135
-                    throw new Exception('Unknown option found in the Event entity: ' . $name);
135
+                    throw new Exception('Unknown option found in the Event entity: '.$name);
136 136
             }
137 137
         }
138 138
     }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             'category' => $this->getCategory(),
149 149
             'created' => $this->getCreated(),
150 150
             'description' => $this->getDescription(),
151
-            'event_filter' => $this->getEventFilter()?$this->getEventFilter()->toArray():null,
151
+            'event_filter' => $this->getEventFilter() ? $this->getEventFilter()->toArray() : null,
152 152
             'event_type' => $this->getEventType(),
153 153
             'key' => $this->getKey(),
154 154
             'name' => $this->getName(),
@@ -157,13 +157,13 @@  discard block
 block discarded – undo
157 157
             'id' => $this->getId(),
158 158
             'is_classic' => $this->getIsClassic(),
159 159
             'is_editable' => $this->getIsEditable(),            
160
-            'config' => $this->getConfig()?$this->getConfig()->toArray():null,
160
+            'config' => $this->getConfig() ? $this->getConfig()->toArray() : null,
161 161
         );
162 162
         
163 163
         // Remove options with empty values
164 164
         $cleanedOptions = array();
165 165
         foreach ($options as $name=>$value) {
166
-            if ($value!==null)
166
+            if ($value !== null)
167 167
                 $cleanedOptions[$name] = $value;
168 168
         }
169 169
         
Please login to merge, or discard this patch.
tests/OptimizelyPHPTest/Service/v2/AttributesTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
         $result = $attributesService->listAll(0);
40 40
         $attributes = $result->getPayload();
41 41
         
42
-        $this->assertTrue(count($attributes)==1);
42
+        $this->assertTrue(count($attributes) == 1);
43 43
         $this->assertTrue($attributes[0] instanceOf Attribute);
44
-        $this->assertTrue($attributes[0]->getName()=='Subscriber Status');        
44
+        $this->assertTrue($attributes[0]->getName() == 'Subscriber Status');        
45 45
     }
46 46
     
47 47
     /**
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         $attribute = $result->getPayload();
102 102
         
103 103
         $this->assertTrue($attribute instanceOf Attribute);
104
-        $this->assertTrue($attribute->getName()=='Subscriber Status');        
104
+        $this->assertTrue($attribute->getName() == 'Subscriber Status');        
105 105
     }
106 106
     
107 107
     public function testCreate()
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         $createdAttribute = $result->getPayload();
143 143
         
144 144
         $this->assertTrue($createdAttribute instanceOf Attribute);
145
-        $this->assertTrue($createdAttribute->getName()=='Subscriber Status');                
145
+        $this->assertTrue($createdAttribute->getName() == 'Subscriber Status');                
146 146
     }
147 147
     
148 148
     public function testUpdate()
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         $createdAttribute = $result->getPayload();
184 184
         
185 185
         $this->assertTrue($createdAttribute instanceOf Attribute);
186
-        $this->assertTrue($createdAttribute->getName()=='Subscriber Status');                
186
+        $this->assertTrue($createdAttribute->getName() == 'Subscriber Status');                
187 187
     }
188 188
     
189 189
     public function testIntegration()
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         $credentials = $this->loadCredentialsFromFile();
195 195
         
196 196
         $optimizelyClient = new OptimizelyApiClient($credentials, 'v2');
197
-        $this->assertTrue($optimizelyClient!=null);
197
+        $this->assertTrue($optimizelyClient != null);
198 198
         
199 199
         // Create new project        
200 200
         $curDate = date('Y-m-d H:i:s');
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         $createdAttribute = $result->getPayload();
236 236
         
237 237
         $this->assertTrue($createdAttribute instanceOf Attribute);
238
-        $this->assertTrue($createdAttribute->getName()=='Subscriber Status');  
238
+        $this->assertTrue($createdAttribute->getName() == 'Subscriber Status');  
239 239
         
240 240
         // List all existing attributes and try to find the created attribute
241 241
         $attributeFound = false;        
@@ -247,16 +247,16 @@  discard block
 block discarded – undo
247 247
                 $attributes = $result->getPayload();
248 248
 
249 249
                 foreach ($attributes as $attribute) {
250
-                    if ($attribute->getName()=="Subscriber Status") {
250
+                    if ($attribute->getName() == "Subscriber Status") {
251 251
                         $attributeFound = true;
252 252
                         break;
253 253
                     }
254 254
                 }
255 255
 
256
-                if ($result->getNextPage()==null)
256
+                if ($result->getNextPage() == null)
257 257
                     break;
258 258
 
259
-                $page ++;
259
+                $page++;
260 260
             }
261 261
         }
262 262
         catch (Exception $e) {
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
         $updatedAttribute = $result->getPayload();                
277 277
         
278 278
         $this->assertTrue($updatedAttribute instanceOf Attribute);
279
-        $this->assertTrue($updatedAttribute->getName()=='Some new attribute name');  
279
+        $this->assertTrue($updatedAttribute->getName() == 'Some new attribute name');  
280 280
         
281 281
         // Make project archived
282 282
         
Please login to merge, or discard this patch.
tests/OptimizelyPHPTest/Service/v2/EventsTest.php 1 patch
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
                             "category" => "add_to_cart",
27 27
                             "description" => "Item added to cart",
28 28
                             "event_filter" => array(
29
-                              "filter_type" => "target_selector",
30
-                              "selector" => ".menu-options"
29
+                                "filter_type" => "target_selector",
30
+                                "selector" => ".menu-options"
31 31
                             ),
32 32
                             "event_type" => "custom",
33 33
                             "key" => "add_to_cart",
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
                             "category" => "add_to_cart",
67 67
                             "description" => "Item added to cart",
68 68
                             "event_filter" => array(
69
-                              "filter_type" => "target_selector",
70
-                              "selector" => ".menu-options"
69
+                                "filter_type" => "target_selector",
70
+                                "selector" => ".menu-options"
71 71
                             ),
72 72
                             "event_type" => "custom",
73 73
                             "key" => "add_to_cart",
@@ -100,22 +100,22 @@  discard block
 block discarded – undo
100 100
                             ->getMock();
101 101
 
102 102
         $result = new Result(array(
103
-                              "event_filter" => array(
103
+                                "event_filter" => array(
104 104
                                 "filter_type" => "target_selector",
105 105
                                 "selector" => ".menu-options"
106
-                              ),
107
-                              "name" => "Add to Cart",
108
-                              "archived" => true,
109
-                              "category" => "add_to_cart",
110
-                              "description" => "string",
111
-                              "event_type" => "click",
112
-                              "key" => "add_to_cart",
113
-                              "created" => "2016-10-18T05:07:04.153Z",
114
-                              "id" => 0,
115
-                              "is_classic" => false,
116
-                              "is_editable" => true,
117
-                              "page_id" => 0,
118
-                              "project_id" => 1000
106
+                                ),
107
+                                "name" => "Add to Cart",
108
+                                "archived" => true,
109
+                                "category" => "add_to_cart",
110
+                                "description" => "string",
111
+                                "event_type" => "click",
112
+                                "key" => "add_to_cart",
113
+                                "created" => "2016-10-18T05:07:04.153Z",
114
+                                "id" => 0,
115
+                                "is_classic" => false,
116
+                                "is_editable" => true,
117
+                                "page_id" => 0,
118
+                                "project_id" => 1000
119 119
                         ), 201);
120 120
         
121 121
         $optimizelyApiClientMock->method('sendApiRequest')
@@ -124,16 +124,16 @@  discard block
 block discarded – undo
124 124
         $eventsService = new Events($optimizelyApiClientMock);
125 125
         
126 126
         $event = new ClickEvent(array(
127
-              "event_filter" => array(
127
+                "event_filter" => array(
128 128
                 "filter_type" => "target_selector",
129 129
                 "selector" => ".menu-options"
130
-              ),
131
-              "name" => "Add to Cart",
132
-              "archived" => true,
133
-              "category" => "add_to_cart",
134
-              "description" => "string",
135
-              "event_type" => "click",
136
-              "key" => "add_to_cart"
130
+                ),
131
+                "name" => "Add to Cart",
132
+                "archived" => true,
133
+                "category" => "add_to_cart",
134
+                "description" => "string",
135
+                "event_type" => "click",
136
+                "key" => "add_to_cart"
137 137
         ));
138 138
         
139 139
         $result = $eventsService->createClickEvent(0, $event);
@@ -194,22 +194,22 @@  discard block
 block discarded – undo
194 194
                             ->getMock();
195 195
 
196 196
         $result = new Result(array(
197
-                              "event_filter" => array(
197
+                                "event_filter" => array(
198 198
                                 "filter_type" => "target_selector",
199 199
                                 "selector" => ".menu-options"
200
-                              ),
201
-                              "name" => "Add to Cart",
202
-                              "archived" => true,
203
-                              "category" => "add_to_cart",
204
-                              "description" => "string",
205
-                              "event_type" => "click",
206
-                              "key" => "add_to_cart",
207
-                              "created" => "2016-10-18T05:07:04.153Z",
208
-                              "id" => 0,
209
-                              "is_classic" => false,
210
-                              "is_editable" => true,
211
-                              "page_id" => 0,
212
-                              "project_id" => 1000
200
+                                ),
201
+                                "name" => "Add to Cart",
202
+                                "archived" => true,
203
+                                "category" => "add_to_cart",
204
+                                "description" => "string",
205
+                                "event_type" => "click",
206
+                                "key" => "add_to_cart",
207
+                                "created" => "2016-10-18T05:07:04.153Z",
208
+                                "id" => 0,
209
+                                "is_classic" => false,
210
+                                "is_editable" => true,
211
+                                "page_id" => 0,
212
+                                "project_id" => 1000
213 213
                         ), 200);
214 214
         
215 215
         $optimizelyApiClientMock->method('sendApiRequest')
@@ -218,16 +218,16 @@  discard block
 block discarded – undo
218 218
         $eventsService = new Events($optimizelyApiClientMock);
219 219
         
220 220
         $event = new ClickEvent(array(
221
-              "event_filter" => array(
221
+                "event_filter" => array(
222 222
                 "filter_type" => "target_selector",
223 223
                 "selector" => ".menu-options"
224
-              ),
225
-              "name" => "Add to Cart",
226
-              "archived" => true,
227
-              "category" => "add_to_cart",
228
-              "description" => "string",
229
-              "event_type" => "click",
230
-              "key" => "add_to_cart"
224
+                ),
225
+                "name" => "Add to Cart",
226
+                "archived" => true,
227
+                "category" => "add_to_cart",
228
+                "description" => "string",
229
+                "event_type" => "click",
230
+                "key" => "add_to_cart"
231 231
         ));
232 232
         
233 233
         $result = $eventsService->updateClickEvent(0, 0, $event);
@@ -299,14 +299,14 @@  discard block
 block discarded – undo
299 299
             "platform" => "web",
300 300
             "status" => "active",
301 301
             "web_snippet" => array(
302
-              "enable_force_variation" => false,
303
-              "exclude_disabled_experiments" => false,
304
-              "exclude_names" => true,
305
-              "include_jquery" => true,
306
-              "ip_anonymization" => false,
307
-              "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
308
-              "library" => "jquery-1.11.3-trim",
309
-              "project_javascript" => "alert(\"Active Experiment\")"
302
+                "enable_force_variation" => false,
303
+                "exclude_disabled_experiments" => false,
304
+                "exclude_names" => true,
305
+                "include_jquery" => true,
306
+                "ip_anonymization" => false,
307
+                "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
308
+                "library" => "jquery-1.11.3-trim",
309
+                "project_javascript" => "alert(\"Active Experiment\")"
310 310
             )
311 311
         ));
312 312
         
@@ -338,22 +338,22 @@  discard block
 block discarded – undo
338 338
         
339 339
         // Create new event in the project
340 340
         $event = new ClickEvent(array(
341
-              "event_filter" => array(
341
+                "event_filter" => array(
342 342
                 "filter_type" => "target_selector",
343 343
                 "selector" => ".menu-options"
344
-              ),
345
-              "name" => "Add to Cart",
346
-              "archived" => true,
347
-              "category" => "add_to_cart",
348
-              "description" => "Some simple event",
349
-              "event_type" => "click",
350
-              "key" => "add_to_cart",
351
-              "created" => "2016-10-18T05:07:04.153Z",
352
-              "id" => 0,
353
-              "is_classic" => false,
354
-              //"is_editable" => true,
355
-              "page_id" => $createdPage->getId(),
356
-              "project_id" => $createdProject->getId()
344
+                ),
345
+                "name" => "Add to Cart",
346
+                "archived" => true,
347
+                "category" => "add_to_cart",
348
+                "description" => "Some simple event",
349
+                "event_type" => "click",
350
+                "key" => "add_to_cart",
351
+                "created" => "2016-10-18T05:07:04.153Z",
352
+                "id" => 0,
353
+                "is_classic" => false,
354
+                //"is_editable" => true,
355
+                "page_id" => $createdPage->getId(),
356
+                "project_id" => $createdProject->getId()
357 357
         ));
358 358
         
359 359
         $result = $optimizelyClient->events()->createClickEvent($createdPage->getId(), $event);
Please login to merge, or discard this patch.
tests/OptimizelyPHPTest/Service/v2/ExperimentsTest.php 1 patch
Indentation   +201 added lines, -201 removed lines patch added patch discarded remove patch
@@ -24,20 +24,20 @@  discard block
 block discarded – undo
24 24
                         array(
25 25
                             "project_id" => 1000,
26 26
                             "audience_ids" => array(
27
-                              1234,
28
-                              1212,
29
-                              1432
27
+                                1234,
28
+                                1212,
29
+                                1432
30 30
                             ),
31 31
                             "campaign_id" => 2000,
32 32
                             "changes" => array(
33
-                              array(
33
+                                array(
34 34
                                 "type" => "custom_code",
35 35
                                 "allow_additional_redirect" => true,
36 36
                                 "async" => true,
37 37
                                 "selector" => "a[href*=\"optimizely\"]",
38 38
                                 "dependencies" => array(
39
-                                  24,
40
-                                  26
39
+                                    24,
40
+                                    26
41 41
                                 ),
42 42
                                 "destination" => "https://app.optimizely.com/",
43 43
                                 "extension_id" => 1234,
@@ -45,39 +45,39 @@  discard block
 block discarded – undo
45 45
                                 "src" => 524,
46 46
                                 "value" => "window.someGlobalFunction();",
47 47
                                 "id" => "string"
48
-                              )
48
+                                )
49 49
                             ),
50 50
                             "description" => "string",
51 51
                             "holdback" => 5000,
52 52
                             "key" => "home_page_experiment",
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" => "Blue Button Experiment",
62 62
                             "schedule" => array(
63
-                              "start_time" => "2016-10-17T07:05:00.070Z",
64
-                              "stop_time" => "2016-10-17T07:05:00.070Z",
65
-                              "time_zone" => "UTC"
63
+                                "start_time" => "2016-10-17T07:05:00.070Z",
64
+                                "stop_time" => "2016-10-17T07:05:00.070Z",
65
+                                "time_zone" => "UTC"
66 66
                             ),
67 67
                             "status" => "active",
68 68
                             "variations" => array(
69
-                              array(
69
+                                array(
70 70
                                 "actions" => array(
71
-                                  array(
71
+                                    array(
72 72
                                     "changes" => array(
73
-                                      array(
73
+                                        array(
74 74
                                         "type" => "custom_code",
75 75
                                         "allow_additional_redirect" => true, 
76 76
                                         "async" => true,
77 77
                                         "selector" => "a[href*=\"optimizely\"]",
78 78
                                         "dependencies" => array(
79
-                                          24,
80
-                                          26
79
+                                            24,
80
+                                            26
81 81
                                         ),
82 82
                                         "destination" => "https://app.optimizely.com/",
83 83
                                         "extension_id" => 1234,
@@ -85,23 +85,23 @@  discard block
 block discarded – undo
85 85
                                         "src" => 524,
86 86
                                         "value" => "window.someGlobalFunction();",
87 87
                                         "id" => "string"
88
-                                      )
88
+                                        )
89 89
                                     ),
90 90
                                     "page_id" => 0
91
-                                  )
91
+                                    )
92 92
                                 ),
93 93
                                 "archived"=> true,
94 94
                                 "key" => "blue_button_variation",
95 95
                                 "name" => "Blue Button",
96 96
                                 "variation_id" => 0,
97 97
                                 "weight" => 0
98
-                              )
98
+                                )
99 99
                             ),
100 100
                             "created" => "2016-10-17T07:05:00.070Z",
101 101
                             "id" => 3000,
102 102
                             "is_classic" => false,
103 103
                             "last_modified" => "2016-10-17T07:05:00.070Z"
104
-                          )
104
+                            )
105 105
                         ), 200);
106 106
         
107 107
         $optimizelyApiClientMock->method('sendApiRequest')
@@ -172,20 +172,20 @@  discard block
 block discarded – undo
172 172
         $result = new Result(array(
173 173
                             "project_id" => 1000,
174 174
                             "audience_ids" => array(
175
-                              1234,
176
-                              1212,
177
-                              1432
175
+                                1234,
176
+                                1212,
177
+                                1432
178 178
                             ),
179 179
                             "campaign_id" => 2000,
180 180
                             "changes" => array(
181
-                              array(
181
+                                array(
182 182
                                 "type" => "custom_code",
183 183
                                 "allow_additional_redirect" => true,
184 184
                                 "async" => true,
185 185
                                 "selector" => "a[href*=\"optimizely\"]",
186 186
                                 "dependencies" => array(
187
-                                  24,
188
-                                  26
187
+                                    24,
188
+                                    26
189 189
                                 ),
190 190
                                 "destination" => "https://app.optimizely.com/",
191 191
                                 "extension_id" => 1234,
@@ -193,39 +193,39 @@  discard block
 block discarded – undo
193 193
                                 "src" => 524,
194 194
                                 "value" => "window.someGlobalFunction();",
195 195
                                 "id" => "string"
196
-                              )
196
+                                )
197 197
                             ),
198 198
                             "description" => "string",
199 199
                             "holdback" => 5000,
200 200
                             "key" => "home_page_experiment",
201 201
                             "metrics" => array(
202
-                              array(
202
+                                array(
203 203
                                 "aggregator" => "unique",
204 204
                                 "event_id" => 0,
205 205
                                 "field" => "revenue",
206 206
                                 "scope" => "session"
207
-                              )
207
+                                )
208 208
                             ),
209 209
                             "name" => "Blue Button Experiment",
210 210
                             "schedule" => array(
211
-                              "start_time" => "2016-10-17T07:05:00.070Z",
212
-                              "stop_time" => "2016-10-17T07:05:00.070Z",
213
-                              "time_zone" => "UTC"
211
+                                "start_time" => "2016-10-17T07:05:00.070Z",
212
+                                "stop_time" => "2016-10-17T07:05:00.070Z",
213
+                                "time_zone" => "UTC"
214 214
                             ),
215 215
                             "status" => "active",
216 216
                             "variations" => array(
217
-                              array(
217
+                                array(
218 218
                                 "actions" => array(
219
-                                  array(
219
+                                    array(
220 220
                                     "changes" => array(
221
-                                      array(
221
+                                        array(
222 222
                                         "type" => "custom_code",
223 223
                                         "allow_additional_redirect" => true, 
224 224
                                         "async" => true,
225 225
                                         "selector" => "a[href*=\"optimizely\"]",
226 226
                                         "dependencies" => array(
227
-                                          24,
228
-                                          26
227
+                                            24,
228
+                                            26
229 229
                                         ),
230 230
                                         "destination" => "https://app.optimizely.com/",
231 231
                                         "extension_id" => 1234,
@@ -233,23 +233,23 @@  discard block
 block discarded – undo
233 233
                                         "src" => 524,
234 234
                                         "value" => "window.someGlobalFunction();",
235 235
                                         "id" => "string"
236
-                                      )
236
+                                        )
237 237
                                     ),
238 238
                                     "page_id" => 0
239
-                                  )
239
+                                    )
240 240
                                 ),
241 241
                                 "archived"=> true,
242 242
                                 "key" => "blue_button_variation",
243 243
                                 "name" => "Blue Button",
244 244
                                 "variation_id" => 0,
245 245
                                 "weight" => 0
246
-                              )
246
+                                )
247 247
                             ),
248 248
                             "created" => "2016-10-17T07:05:00.070Z",
249 249
                             "id" => 3000,
250 250
                             "is_classic" => false,
251 251
                             "last_modified" => "2016-10-17T07:05:00.070Z"
252
-                          ), 200);
252
+                            ), 200);
253 253
         
254 254
         $optimizelyApiClientMock->method('sendApiRequest')
255 255
                     ->willReturn($result);
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
                             "end_time" => "2016-10-17T07:05:00.089Z",
306 306
                             "experiment_id" => 3000,
307 307
                             "metrics" => array(
308
-                              array(
308
+                                array(
309 309
                                 "event" => "string",
310 310
                                 "event_name" => "string",
311 311
                                 "measure" => "conversions",
@@ -313,54 +313,54 @@  discard block
 block discarded – undo
313 313
                                 "priority" => 1,
314 314
                                 "unit" => "session",
315 315
                                 "variation_results" => array(
316
-                                  "9000" => array(
316
+                                    "9000" => array(
317 317
                                     "experiment_id" => 0,
318 318
                                     "is_baseline" => true,
319 319
                                     "lift" => array(
320
-                                      "confidence_interval" => array(
320
+                                        "confidence_interval" => array(
321 321
                                         0.010399560300730457,
322 322
                                         0.0850821459929161
323
-                                      ),
324
-                                      "is_most_conclusive" => true,
325
-                                      "is_significant" => true,
326
-                                      "significance" => 0,
327
-                                      "value" => 0,
328
-                                      "visitors_remaining" => 0
323
+                                        ),
324
+                                        "is_most_conclusive" => true,
325
+                                        "is_significant" => true,
326
+                                        "significance" => 0,
327
+                                        "value" => 0,
328
+                                        "visitors_remaining" => 0
329 329
                                     ),
330 330
                                     "name" => "Blue Button",
331 331
                                     "rate" => 0,
332 332
                                     "scope" => "variation",
333 333
                                     "total_increase" => array(
334
-                                      "confidence_interval" => array(
334
+                                        "confidence_interval" => array(
335 335
                                         0.010399560300730457,
336 336
                                         0.0850821459929161
337
-                                      ),
338
-                                      "is_most_conclusive" => true,
339
-                                      "is_significant" => true,
340
-                                      "significance" => 0,
341
-                                      "value" => 0,
342
-                                      "visitors_remaining" => 0
337
+                                        ),
338
+                                        "is_most_conclusive" => true,
339
+                                        "is_significant" => true,
340
+                                        "significance" => 0,
341
+                                        "value" => 0,
342
+                                        "visitors_remaining" => 0
343 343
                                     ),
344 344
                                     "value" => 0,
345 345
                                     "variation_id" => "string"
346
-                                  )
346
+                                    )
347
+                                )
347 348
                                 )
348
-                              )
349 349
                             ),
350 350
                             "reach" => array(
351
-                              "baseline_count" => 0,
352
-                              "baseline_reach" => 0,
353
-                              "total_count" => 0,
354
-                              "treatment_count" => 0,
355
-                              "treatment_reach" => 0,
356
-                              "variations" => array(
351
+                                "baseline_count" => 0,
352
+                                "baseline_reach" => 0,
353
+                                "total_count" => 0,
354
+                                "treatment_count" => 0,
355
+                                "treatment_reach" => 0,
356
+                                "variations" => array(
357 357
                                 "9000" => array(
358
-                                  "count" => 0,
359
-                                  "name" => "Blue Button",
360
-                                  "variation_id" => "string",
361
-                                  "variation_reach" => 0
358
+                                    "count" => 0,
359
+                                    "name" => "Blue Button",
360
+                                    "variation_id" => "string",
361
+                                    "variation_reach" => 0
362
+                                )
362 363
                                 )
363
-                              )
364 364
                             ),
365 365
                             "start_time" => "2016-10-17T07:05:00.090Z"
366 366
                         ), 200);
@@ -387,20 +387,20 @@  discard block
 block discarded – undo
387 387
         $result = new Result(array(
388 388
                             "project_id" => 1000,
389 389
                             "audience_ids" => array(
390
-                              1234,
391
-                              1212,
392
-                              1432
390
+                                1234,
391
+                                1212,
392
+                                1432
393 393
                             ),
394 394
                             "campaign_id" => 2000,
395 395
                             "changes" => array(
396
-                              array(
396
+                                array(
397 397
                                 "type" => "custom_code",
398 398
                                 "allow_additional_redirect" => true,
399 399
                                 "async" => true,
400 400
                                 "selector" => "a[href*=\"optimizely\"]",
401 401
                                 "dependencies" => array(
402
-                                  24,
403
-                                  26
402
+                                    24,
403
+                                    26
404 404
                                 ),
405 405
                                 "destination" => "https://app.optimizely.com/",
406 406
                                 "extension_id" => 1234,
@@ -408,39 +408,39 @@  discard block
 block discarded – undo
408 408
                                 "src" => 524,
409 409
                                 "value" => "window.someGlobalFunction();",
410 410
                                 "id" => "string"
411
-                              )
411
+                                )
412 412
                             ),
413 413
                             "description" => "string",
414 414
                             "holdback" => 5000,
415 415
                             "key" => "home_page_experiment",
416 416
                             "metrics" => array(
417
-                              array(
417
+                                array(
418 418
                                 "aggregator" => "unique",
419 419
                                 "event_id" => 0,
420 420
                                 "field" => "revenue",
421 421
                                 "scope" => "session"
422
-                              )
422
+                                )
423 423
                             ),
424 424
                             "name" => "Blue Button Experiment",
425 425
                             "schedule" => array(
426
-                              "start_time" => "2016-10-17T07:05:00.099Z",
427
-                              "stop_time" => "2016-10-17T07:05:00.099Z",
428
-                              "time_zone" => "UTC"
426
+                                "start_time" => "2016-10-17T07:05:00.099Z",
427
+                                "stop_time" => "2016-10-17T07:05:00.099Z",
428
+                                "time_zone" => "UTC"
429 429
                             ),
430 430
                             "status" => "active",
431 431
                             "variations" => array(
432
-                              array(
432
+                                array(
433 433
                                 "actions" => array(
434
-                                  array(
434
+                                    array(
435 435
                                     "changes" => array(
436
-                                      array(
436
+                                        array(
437 437
                                         "type" => "custom_code",
438 438
                                         "allow_additional_redirect" => true,
439 439
                                         "async" => true,
440 440
                                         "selector" => "a[href*=\"optimizely\"]",
441 441
                                         "dependencies" => array(
442
-                                          24,
443
-                                          26
442
+                                            24,
443
+                                            26
444 444
                                         ),
445 445
                                         "destination" => "https://app.optimizely.com/",
446 446
                                         "extension_id" => 1234,
@@ -448,17 +448,17 @@  discard block
 block discarded – undo
448 448
                                         "src" => 524,
449 449
                                         "value" => "window.someGlobalFunction();",
450 450
                                         "id" => "string"
451
-                                      )
451
+                                        )
452 452
                                     ),
453 453
                                     "page_id" => 0
454
-                                  )
454
+                                    )
455 455
                                 ),
456 456
                                 "archived" => true,
457 457
                                 "key" => "blue_button_variation",
458 458
                                 "name" => "Blue Button",
459 459
                                 "variation_id" => 0,
460 460
                                 "weight" => 0
461
-                              )
461
+                                )
462 462
                             ),
463 463
                             "created" => "2016-10-17T07:05:00.099Z",
464 464
                             "id" => 3000,
@@ -474,76 +474,76 @@  discard block
 block discarded – undo
474 474
         $experiment = new Experiment(array(
475 475
             "project_id" => 1000,
476 476
             "audience_ids" => array(
477
-              1234,
478
-              1212,
479
-              1432
477
+                1234,
478
+                1212,
479
+                1432
480 480
             ),
481 481
             "campaign_id" => 2000,
482 482
             "changes" => array(
483
-              array(
483
+                array(
484 484
                 "type" => "custom_code",
485 485
                 "allow_additional_redirect" => true,
486 486
                 "async" => true,
487 487
                 "selector" => "a[href*=\"optimizely\"]",
488 488
                 "dependencies" => array(
489
-                  24,
490
-                  26
489
+                    24,
490
+                    26
491 491
                 ),
492 492
                 "destination" => "https://app.optimizely.com/",
493 493
                 "extension_id" => 1234,
494 494
                 "preserve_parameters" => true,
495 495
                 "src" => 524,
496 496
                 "value" => "window.someGlobalFunction();"
497
-              )
497
+                )
498 498
             ),
499 499
             "description" => "string",
500 500
             "holdback" => 5000,
501 501
             "key" => "home_page_experiment",
502 502
             "metrics" => array(
503
-              array(
503
+                array(
504 504
                 "aggregator" => "unique",
505 505
                 "event_id" => 0,
506 506
                 "field" => "revenue",
507 507
                 "scope" => "session"
508
-              )
508
+                )
509 509
             ),
510 510
             "name" => "Blue Button Experiment",
511 511
             "schedule" => array(
512
-              "start_time" => "2016-10-17T07:04:59.724Z",
513
-              "stop_time" => "2016-10-17T07:04:59.724Z",
514
-              "time_zone" => "UTC"
512
+                "start_time" => "2016-10-17T07:04:59.724Z",
513
+                "stop_time" => "2016-10-17T07:04:59.724Z",
514
+                "time_zone" => "UTC"
515 515
             ),
516 516
             "status" => "active",
517 517
             "variations" => array(
518
-              array(
518
+                array(
519 519
                 "actions" => array(
520
-                  array(
520
+                    array(
521 521
                     "changes" => array(
522
-                      array(
522
+                        array(
523 523
                         "type" => "custom_code",
524 524
                         "allow_additional_redirect" => true,
525 525
                         "async" => true,
526 526
                         "selector" => "a[href*=\"optimizely\"]",
527 527
                         "dependencies" => array(
528
-                          24,
529
-                          26
528
+                            24,
529
+                            26
530 530
                         ),
531 531
                         "destination" => "https://app.optimizely.com/",
532 532
                         "extension_id" => 1234,
533 533
                         "preserve_parameters" => true,
534 534
                         "src" => 524,
535 535
                         "value" => "window.someGlobalFunction();"
536
-                      )
536
+                        )
537 537
                     ),
538 538
                     "page_id" => 0
539
-                  )
539
+                    )
540 540
                 ),
541 541
                 "archived" => true,
542 542
                 "key" => "blue_button_variation",
543 543
                 "name" => "Blue Button",
544 544
                 "variation_id" => 0,
545 545
                 "weight" => 0
546
-              )
546
+                )
547 547
             )
548 548
         ));
549 549
         
@@ -564,20 +564,20 @@  discard block
 block discarded – undo
564 564
         $result = new Result(array(
565 565
                         "project_id" => 1000,
566 566
                         "audience_ids" => array(
567
-                          1234,
568
-                          1212,
569
-                          1432
567
+                            1234,
568
+                            1212,
569
+                            1432
570 570
                         ),
571 571
                         "campaign_id" => 2000,
572 572
                         "changes" => array(
573
-                          array(
573
+                            array(
574 574
                             "type" => "custom_code",
575 575
                             "allow_additional_redirect" => true,
576 576
                             "async" => true,
577 577
                             "selector" => "a[href*=\"optimizely\"]",
578 578
                             "dependencies" => array(
579
-                              24,
580
-                              26
579
+                                24,
580
+                                26
581 581
                             ),
582 582
                             "destination" => "https://app.optimizely.com/",
583 583
                             "extension_id" => 1234,
@@ -585,39 +585,39 @@  discard block
 block discarded – undo
585 585
                             "src" => 524,
586 586
                             "value" => "window.someGlobalFunction();",
587 587
                             "id" => "string"
588
-                          )
588
+                            )
589 589
                         ),
590 590
                         "description" => "string",
591 591
                         "holdback" => 5000,
592 592
                         "key" => "home_page_experiment",
593 593
                         "metrics" => array(
594
-                          array(
594
+                            array(
595 595
                             "aggregator" => "unique",
596 596
                             "event_id" => 0,
597 597
                             "field" => "revenue",
598 598
                             "scope" => "session"
599
-                          )
599
+                            )
600 600
                         ),
601 601
                         "name" => "Blue Button Experiment",
602 602
                         "schedule" => array(
603
-                          "start_time" => "2016-10-17T07:05:00.109Z",
604
-                          "stop_time" => "2016-10-17T07:05:00.109Z",
605
-                          "time_zone" => "UTC"
603
+                            "start_time" => "2016-10-17T07:05:00.109Z",
604
+                            "stop_time" => "2016-10-17T07:05:00.109Z",
605
+                            "time_zone" => "UTC"
606 606
                         ),
607 607
                         "status" => "active",
608 608
                         "variations" => array(
609
-                          array(
609
+                            array(
610 610
                             "actions" => array(
611
-                              array(
611
+                                array(
612 612
                                 "changes" => array(
613
-                                  array(
613
+                                    array(
614 614
                                     "type" => "custom_code",
615 615
                                     "allow_additional_redirect" => true,
616 616
                                     "async" => true,
617 617
                                     "selector" => "a[href*=\"optimizely\"]",
618 618
                                     "dependencies" => array(
619
-                                      24,
620
-                                      26
619
+                                        24,
620
+                                        26
621 621
                                     ),
622 622
                                     "destination" => "https://app.optimizely.com/",
623 623
                                     "extension_id" => 1234,
@@ -625,17 +625,17 @@  discard block
 block discarded – undo
625 625
                                     "src" => 524,
626 626
                                     "value" => "window.someGlobalFunction();",
627 627
                                     "id" => "string"
628
-                                  )
628
+                                    )
629 629
                                 ),
630 630
                                 "page_id" => 0
631
-                              )
631
+                                )
632 632
                             ),
633 633
                             "archived" => true,
634 634
                             "key" => "blue_button_variation",
635 635
                             "name" => "Blue Button",
636 636
                             "variation_id" => 0,
637 637
                             "weight" => 0
638
-                          )
638
+                            )
639 639
                         ),
640 640
                         "created" => "2016-10-17T07:05:00.109Z",
641 641
                         "id" => 3000,
@@ -649,75 +649,75 @@  discard block
 block discarded – undo
649 649
         $experimentsService = new Experiments($optimizelyApiClientMock);
650 650
         
651 651
         $experiment = new Experiment(array(
652
-              "audience_ids" => array(
652
+                "audience_ids" => array(
653 653
                 0
654
-              ),
655
-              "changes" => array(
654
+                ),
655
+                "changes" => array(
656 656
                 array(
657
-                  "type" => "custom_code",
658
-                  "allow_additional_redirect" => true,
659
-                  "async" => true,
660
-                  "selector" => "a[href*=\"optimizely\"]",
661
-                  "dependencies" => array(
657
+                    "type" => "custom_code",
658
+                    "allow_additional_redirect" => true,
659
+                    "async" => true,
660
+                    "selector" => "a[href*=\"optimizely\"]",
661
+                    "dependencies" => array(
662 662
                     24,
663 663
                     26
664
-                  ),
665
-                  "destination" => "https://app.optimizely.com/",
666
-                  "extension_id" => 1234,
667
-                  "preserve_parameters" => true,
668
-                  "src" => 524,
669
-                  "value" => "window.someGlobalFunction();"
664
+                    ),
665
+                    "destination" => "https://app.optimizely.com/",
666
+                    "extension_id" => 1234,
667
+                    "preserve_parameters" => true,
668
+                    "src" => 524,
669
+                    "value" => "window.someGlobalFunction();"
670 670
                 )
671
-              ),
672
-              "description" => "AB Test to see if the Blue Button converts more visitors",
673
-              "holdback" => 0,
674
-              "key" => "home_page_experiment",
675
-              "metrics" => array(
671
+                ),
672
+                "description" => "AB Test to see if the Blue Button converts more visitors",
673
+                "holdback" => 0,
674
+                "key" => "home_page_experiment",
675
+                "metrics" => array(
676 676
                 array(
677
-                  "aggregator" => "unique",
678
-                  "event_id" => 0,
679
-                  "field" => "revenue",
680
-                  "scope" => "session"
677
+                    "aggregator" => "unique",
678
+                    "event_id" => 0,
679
+                    "field" => "revenue",
680
+                    "scope" => "session"
681 681
                 )
682
-              ),
683
-              "name" => "Blue Button Experiment",
684
-              "schedule" => array(
682
+                ),
683
+                "name" => "Blue Button Experiment",
684
+                "schedule" => array(
685 685
                 "start_time" => "2016-10-17T07:04:59.731Z",
686 686
                 "stop_time" => "2016-10-17T07:04:59.731Z",
687 687
                 "time_zone" => "UTC"
688
-              ),
689
-              "status" => "active",
690
-              "variations" => array(
688
+                ),
689
+                "status" => "active",
690
+                "variations" => array(
691 691
                 array(
692
-                  "actions" => array(
692
+                    "actions" => array(
693 693
                     array(
694
-                      "changes" => array(
694
+                        "changes" => array(
695 695
                         array(
696
-                          "type" => "custom_code",
697
-                          "allow_additional_redirect" => true,
698
-                          "async" => true,
699
-                          "selector" => "a[href*=\"optimizely\"]",
700
-                          "dependencies" => array(
696
+                            "type" => "custom_code",
697
+                            "allow_additional_redirect" => true,
698
+                            "async" => true,
699
+                            "selector" => "a[href*=\"optimizely\"]",
700
+                            "dependencies" => array(
701 701
                             24,
702 702
                             26
703
-                          ),
704
-                          "destination" => "https://app.optimizely.com/",
705
-                          "extension_id" => 1234,
706
-                          "preserve_parameters" => true,
707
-                          "src" => 524,
708
-                          "value" => "window.someGlobalFunction();"
703
+                            ),
704
+                            "destination" => "https://app.optimizely.com/",
705
+                            "extension_id" => 1234,
706
+                            "preserve_parameters" => true,
707
+                            "src" => 524,
708
+                            "value" => "window.someGlobalFunction();"
709 709
                         )
710
-                      ),
711
-                      "page_id" => 0
710
+                        ),
711
+                        "page_id" => 0
712 712
                     )
713
-                  ),
714
-                  "archived" => true,
715
-                  "key" => "blue_button_variation",
716
-                  "name" => "Blue Button",
717
-                  "variation_id" => 0,
718
-                  "weight" => 0
713
+                    ),
714
+                    "archived" => true,
715
+                    "key" => "blue_button_variation",
716
+                    "name" => "Blue Button",
717
+                    "variation_id" => 0,
718
+                    "weight" => 0
719
+                )
719 720
                 )
720
-              )
721 721
         ));
722 722
         
723 723
         $result = $experimentsService->update(1000, $experiment, 'start');
@@ -765,14 +765,14 @@  discard block
 block discarded – undo
765 765
             "platform" => "web",
766 766
             "status" => "active",
767 767
             "web_snippet" => array(
768
-              "enable_force_variation" => false,
769
-              "exclude_disabled_experiments" => false,
770
-              "exclude_names" => true,
771
-              "include_jquery" => true,
772
-              "ip_anonymization" => false,
773
-              "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
774
-              "library" => "jquery-1.11.3-trim",
775
-              "project_javascript" => "alert(\"Active Experiment\")"
768
+                "enable_force_variation" => false,
769
+                "exclude_disabled_experiments" => false,
770
+                "exclude_names" => true,
771
+                "include_jquery" => true,
772
+                "ip_anonymization" => false,
773
+                "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
774
+                "library" => "jquery-1.11.3-trim",
775
+                "project_javascript" => "alert(\"Active Experiment\")"
776 776
             )
777 777
         ));
778 778
         
@@ -783,12 +783,12 @@  discard block
 block discarded – undo
783 783
         $experiment = new Experiment(array(
784 784
             "project_id" => $createdProject->getId(),
785 785
             "variations" => array(
786
-              array(
786
+                array(
787 787
                 "weight" => 0,
788 788
                 "actions" => array(
789
-                  array(
789
+                    array(
790 790
                     "changes" => array(
791
-                      /*array(
791
+                        /*array(
792 792
                         "type" => "attribute",
793 793
                         "allow_additional_redirect" => true,
794 794
                         "async" => true,
@@ -830,17 +830,17 @@  discard block
 block discarded – undo
830 830
                       )*/
831 831
                     ),
832 832
                     "page_id" => 0
833
-                  )
833
+                    )
834 834
                 ),
835 835
                 "archived" => true,
836 836
                 "key" => "blue_button_variation",
837 837
                 "name" => "Blue Button"
838
-              )
838
+                )
839 839
             ),
840 840
             "audience_conditions" => "[\"and\", {\"audience_id\": 7000}, {\"audience_id\":7001}]",
841 841
             //"campaign_id" => 2000,
842 842
             "changes" => array(
843
-              /*array(
843
+                /*array(
844 844
                 "type" => "attribute",
845 845
                 "allow_additional_redirect" => true,
846 846
                 "async" => true,
@@ -885,18 +885,18 @@  discard block
 block discarded – undo
885 885
             "holdback" => 5000,
886 886
             "key" => "home_page_experiment",
887 887
             "metrics" => array(
888
-              array(
888
+                array(
889 889
                 "aggregator" => "unique",
890 890
                 "event_id" => 0,
891 891
                 "field" => "revenue",
892 892
                 "scope" => "session"
893
-              )
893
+                )
894 894
             ),
895 895
             "name" => "Blue Button Experiment",
896 896
             "schedule" => array(
897
-              "start_time" => "string",
898
-              "stop_time" => "string",
899
-              "time_zone" => "GMT-01:00"
897
+                "start_time" => "string",
898
+                "stop_time" => "string",
899
+                "time_zone" => "GMT-01:00"
900 900
             ),
901 901
             "type" => "a/b"    
902 902
         ));
Please login to merge, or discard this patch.