@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | "project_id" => 1000, |
22 | 22 | "archived" => false, |
23 | 23 | "conditions" => array( |
24 | - "and", |
|
25 | - array( |
|
24 | + "and", |
|
25 | + array( |
|
26 | 26 | "type" => "language", |
27 | 27 | "value" => "es" |
28 | - ), |
|
29 | - array( |
|
28 | + ), |
|
29 | + array( |
|
30 | 30 | "type" => "location", |
31 | 31 | "value" => "US-CA-SANFRANCISCO" |
32 | - ) |
|
32 | + ) |
|
33 | 33 | ), |
34 | 34 | "description" => "People that speak spanish and are in San Francisco", |
35 | 35 | "name" => "Spanish speaking San Franciscans", |
@@ -61,15 +61,15 @@ discard block |
||
61 | 61 | "project_id" => 1000, |
62 | 62 | "archived" => false, |
63 | 63 | "conditions" => array( |
64 | - "and", |
|
65 | - array( |
|
64 | + "and", |
|
65 | + array( |
|
66 | 66 | "type" => "language", |
67 | 67 | "value" => "es" |
68 | - ), |
|
69 | - array( |
|
68 | + ), |
|
69 | + array( |
|
70 | 70 | "type" => "location", |
71 | 71 | "value" => "US-CA-SANFRANCISCO" |
72 | - ) |
|
72 | + ) |
|
73 | 73 | ), |
74 | 74 | "description" => "People that speak spanish and are in San Francisco", |
75 | 75 | "name" => "Spanish speaking San Franciscans", |
@@ -99,15 +99,15 @@ discard block |
||
99 | 99 | "project_id" => 1000, |
100 | 100 | "archived" => false, |
101 | 101 | "conditions" => array( |
102 | - "and", |
|
103 | - array( |
|
102 | + "and", |
|
103 | + array( |
|
104 | 104 | "type" => "language", |
105 | 105 | "value" => "es" |
106 | - ), |
|
107 | - array( |
|
106 | + ), |
|
107 | + array( |
|
108 | 108 | "type" => "location", |
109 | 109 | "value" => "US-CA-SANFRANCISCO" |
110 | - ) |
|
110 | + ) |
|
111 | 111 | ), |
112 | 112 | "description" => "People that speak spanish and are in San Francisco", |
113 | 113 | "name" => "Spanish speaking San Franciscans", |
@@ -123,15 +123,15 @@ discard block |
||
123 | 123 | "project_id" => 1000, |
124 | 124 | "archived" => false, |
125 | 125 | "conditions" => array( |
126 | - "and", |
|
127 | - array( |
|
126 | + "and", |
|
127 | + array( |
|
128 | 128 | "type" => "language", |
129 | 129 | "value" => "es" |
130 | - ), |
|
131 | - array( |
|
130 | + ), |
|
131 | + array( |
|
132 | 132 | "type" => "location", |
133 | 133 | "value" => "US-CA-SANFRANCISCO" |
134 | - ) |
|
134 | + ) |
|
135 | 135 | ), |
136 | 136 | "description" => "People that speak spanish and are in San Francisco", |
137 | 137 | "name" => "Spanish speaking San Franciscans", |
@@ -156,15 +156,15 @@ discard block |
||
156 | 156 | "project_id" => 1000, |
157 | 157 | "archived" => false, |
158 | 158 | "conditions" => array( |
159 | - "and", |
|
160 | - array( |
|
159 | + "and", |
|
160 | + array( |
|
161 | 161 | "type" => "language", |
162 | 162 | "value" => "es" |
163 | - ), |
|
164 | - array( |
|
163 | + ), |
|
164 | + array( |
|
165 | 165 | "type" => "location", |
166 | 166 | "value" => "US-CA-SANFRANCISCO" |
167 | - ) |
|
167 | + ) |
|
168 | 168 | ), |
169 | 169 | "description" => "People that speak spanish and are in San Francisco", |
170 | 170 | "name" => "Spanish speaking San Franciscans", |
@@ -180,15 +180,15 @@ discard block |
||
180 | 180 | "project_id" => 1000, |
181 | 181 | "archived" => false, |
182 | 182 | "conditions" => array( |
183 | - "and", |
|
184 | - array( |
|
183 | + "and", |
|
184 | + array( |
|
185 | 185 | "type" => "language", |
186 | 186 | "value" => "es" |
187 | - ), |
|
188 | - array( |
|
187 | + ), |
|
188 | + array( |
|
189 | 189 | "type" => "location", |
190 | 190 | "value" => "US-CA-SANFRANCISCO" |
191 | - ) |
|
191 | + ) |
|
192 | 192 | ), |
193 | 193 | "description" => "People that speak spanish and are in San Francisco", |
194 | 194 | "name" => "Spanish speaking San Franciscans", |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | |
45 | 45 | $audiences = $audiencesService->listAll(1000); |
46 | 46 | |
47 | - $this->assertTrue(count($audiences)==1); |
|
47 | + $this->assertTrue(count($audiences) == 1); |
|
48 | 48 | $this->assertTrue($audiences[0] instanceOf Audience); |
49 | - $this->assertTrue($audiences[0]->getName()=='Spanish speaking San Franciscans'); |
|
49 | + $this->assertTrue($audiences[0]->getName() == 'Spanish speaking San Franciscans'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | public function testGet() |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $audience = $audiencesService->get(5000); |
85 | 85 | |
86 | 86 | $this->assertTrue($audience instanceOf Audience); |
87 | - $this->assertTrue($audience->getName()=='Spanish speaking San Franciscans'); |
|
87 | + $this->assertTrue($audience->getName() == 'Spanish speaking San Franciscans'); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | public function testCreate() |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $createdAudience = $audiencesService->create($audience); |
142 | 142 | |
143 | 143 | $this->assertTrue($createdAudience instanceOf Audience); |
144 | - $this->assertTrue($createdAudience->getName()=='Spanish speaking San Franciscans'); |
|
144 | + $this->assertTrue($createdAudience->getName() == 'Spanish speaking San Franciscans'); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | public function testUpdate() |
@@ -198,6 +198,6 @@ discard block |
||
198 | 198 | $createdAudience = $audiencesService->update(5000, $audience); |
199 | 199 | |
200 | 200 | $this->assertTrue($createdAudience instanceOf Audience); |
201 | - $this->assertTrue($createdAudience->getName()=='Spanish speaking San Franciscans'); |
|
201 | + $this->assertTrue($createdAudience->getName() == 'Spanish speaking San Franciscans'); |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | \ No newline at end of file |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | |
39 | 39 | $pages = $pagesService->listAll(1000); |
40 | 40 | |
41 | - $this->assertTrue(count($pages)==1); |
|
41 | + $this->assertTrue(count($pages) == 1); |
|
42 | 42 | $this->assertTrue($pages[0] instanceOf Page); |
43 | - $this->assertTrue($pages[0]->getName()=='Home Page'); |
|
43 | + $this->assertTrue($pages[0]->getName() == 'Home Page'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | public function testGet() |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $page = $pagesService->get(5000); |
73 | 73 | |
74 | 74 | $this->assertTrue($page instanceOf Page); |
75 | - $this->assertTrue($page->getName()=='Home Page'); |
|
75 | + $this->assertTrue($page->getName() == 'Home Page'); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | public function testCreate() |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $createdPage = $pagesService->create($page); |
118 | 118 | |
119 | 119 | $this->assertTrue($createdPage instanceOf Page); |
120 | - $this->assertTrue($createdPage->getName()=='Home Page'); |
|
120 | + $this->assertTrue($createdPage->getName() == 'Home Page'); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | public function testUpdate() |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $updatedPage = $pagesService->update(1000, $page); |
163 | 163 | |
164 | 164 | $this->assertTrue($updatedPage instanceOf Page); |
165 | - $this->assertTrue($updatedPage->getName()=='Home Page'); |
|
165 | + $this->assertTrue($updatedPage->getName() == 'Home Page'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | public function testDelete() |
@@ -23,20 +23,20 @@ discard block |
||
23 | 23 | array( |
24 | 24 | "project_id" => 1000, |
25 | 25 | "audience_ids" => array( |
26 | - 1234, |
|
27 | - 1212, |
|
28 | - 1432 |
|
26 | + 1234, |
|
27 | + 1212, |
|
28 | + 1432 |
|
29 | 29 | ), |
30 | 30 | "campaign_id" => 2000, |
31 | 31 | "changes" => array( |
32 | - array( |
|
32 | + array( |
|
33 | 33 | "type" => "custom_code", |
34 | 34 | "allow_additional_redirect" => true, |
35 | 35 | "async" => true, |
36 | 36 | "css_selector" => "a[href*=\"optimizely\"]", |
37 | 37 | "dependencies" => array( |
38 | - 24, |
|
39 | - 26 |
|
38 | + 24, |
|
39 | + 26 |
|
40 | 40 | ), |
41 | 41 | "destination" => "https://app.optimizely.com/", |
42 | 42 | "extension_id" => 1234, |
@@ -44,37 +44,37 @@ discard block |
||
44 | 44 | "src" => 524, |
45 | 45 | "value" => "window.someGlobalFunction();", |
46 | 46 | "id" => "string" |
47 | - ) |
|
47 | + ) |
|
48 | 48 | ), |
49 | 49 | "description" => "string", |
50 | 50 | "holdback" => 5000, |
51 | 51 | "key" => "home_page_experiment", |
52 | 52 | "metrics" => array( |
53 | - array( |
|
53 | + array( |
|
54 | 54 | "kind" => "string", |
55 | 55 | "id" => 0 |
56 | - ) |
|
56 | + ) |
|
57 | 57 | ), |
58 | 58 | "name" => "Blue Button Experiment", |
59 | 59 | "schedule" => array( |
60 | - "start_time" => "2016-10-17T07:05:00.070Z", |
|
61 | - "stop_time" => "2016-10-17T07:05:00.070Z", |
|
62 | - "time_zone" => "UTC" |
|
60 | + "start_time" => "2016-10-17T07:05:00.070Z", |
|
61 | + "stop_time" => "2016-10-17T07:05:00.070Z", |
|
62 | + "time_zone" => "UTC" |
|
63 | 63 | ), |
64 | 64 | "status" => "active", |
65 | 65 | "variations" => array( |
66 | - array( |
|
66 | + array( |
|
67 | 67 | "actions" => array( |
68 | - array( |
|
68 | + array( |
|
69 | 69 | "changes" => array( |
70 | - array( |
|
70 | + array( |
|
71 | 71 | "type" => "custom_code", |
72 | 72 | "allow_additional_redirect" => true, |
73 | 73 | "async" => true, |
74 | 74 | "css_selector" => "a[href*=\"optimizely\"]", |
75 | 75 | "dependencies" => array( |
76 | - 24, |
|
77 | - 26 |
|
76 | + 24, |
|
77 | + 26 |
|
78 | 78 | ), |
79 | 79 | "destination" => "https://app.optimizely.com/", |
80 | 80 | "extension_id" => 1234, |
@@ -82,23 +82,23 @@ discard block |
||
82 | 82 | "src" => 524, |
83 | 83 | "value" => "window.someGlobalFunction();", |
84 | 84 | "id" => "string" |
85 | - ) |
|
85 | + ) |
|
86 | 86 | ), |
87 | 87 | "page_id" => 0 |
88 | - ) |
|
88 | + ) |
|
89 | 89 | ), |
90 | 90 | "archived"=> true, |
91 | 91 | "key" => "blue_button_variation", |
92 | 92 | "name" => "Blue Button", |
93 | 93 | "variation_id" => 0, |
94 | 94 | "weight" => 0 |
95 | - ) |
|
95 | + ) |
|
96 | 96 | ), |
97 | 97 | "created" => "2016-10-17T07:05:00.070Z", |
98 | 98 | "id" => 3000, |
99 | 99 | "is_classic" => false, |
100 | 100 | "last_modified" => "2016-10-17T07:05:00.070Z" |
101 | - ) |
|
101 | + ) |
|
102 | 102 | ) |
103 | 103 | ); |
104 | 104 | |
@@ -122,20 +122,20 @@ discard block |
||
122 | 122 | ->willReturn(array( |
123 | 123 | "project_id" => 1000, |
124 | 124 | "audience_ids" => array( |
125 | - 1234, |
|
126 | - 1212, |
|
127 | - 1432 |
|
125 | + 1234, |
|
126 | + 1212, |
|
127 | + 1432 |
|
128 | 128 | ), |
129 | 129 | "campaign_id" => 2000, |
130 | 130 | "changes" => array( |
131 | - array( |
|
131 | + array( |
|
132 | 132 | "type" => "custom_code", |
133 | 133 | "allow_additional_redirect" => true, |
134 | 134 | "async" => true, |
135 | 135 | "css_selector" => "a[href*=\"optimizely\"]", |
136 | 136 | "dependencies" => array( |
137 | - 24, |
|
138 | - 26 |
|
137 | + 24, |
|
138 | + 26 |
|
139 | 139 | ), |
140 | 140 | "destination" => "https://app.optimizely.com/", |
141 | 141 | "extension_id" => 1234, |
@@ -143,37 +143,37 @@ discard block |
||
143 | 143 | "src" => 524, |
144 | 144 | "value" => "window.someGlobalFunction();", |
145 | 145 | "id" => "string" |
146 | - ) |
|
146 | + ) |
|
147 | 147 | ), |
148 | 148 | "description" => "string", |
149 | 149 | "holdback" => 5000, |
150 | 150 | "key" => "home_page_experiment", |
151 | 151 | "metrics" => array( |
152 | - array( |
|
152 | + array( |
|
153 | 153 | "kind" => "string", |
154 | 154 | "id" => 0 |
155 | - ) |
|
155 | + ) |
|
156 | 156 | ), |
157 | 157 | "name" => "Blue Button Experiment", |
158 | 158 | "schedule" => array( |
159 | - "start_time" => "2016-10-17T07:05:00.070Z", |
|
160 | - "stop_time" => "2016-10-17T07:05:00.070Z", |
|
161 | - "time_zone" => "UTC" |
|
159 | + "start_time" => "2016-10-17T07:05:00.070Z", |
|
160 | + "stop_time" => "2016-10-17T07:05:00.070Z", |
|
161 | + "time_zone" => "UTC" |
|
162 | 162 | ), |
163 | 163 | "status" => "active", |
164 | 164 | "variations" => array( |
165 | - array( |
|
165 | + array( |
|
166 | 166 | "actions" => array( |
167 | - array( |
|
167 | + array( |
|
168 | 168 | "changes" => array( |
169 | - array( |
|
169 | + array( |
|
170 | 170 | "type" => "custom_code", |
171 | 171 | "allow_additional_redirect" => true, |
172 | 172 | "async" => true, |
173 | 173 | "css_selector" => "a[href*=\"optimizely\"]", |
174 | 174 | "dependencies" => array( |
175 | - 24, |
|
176 | - 26 |
|
175 | + 24, |
|
176 | + 26 |
|
177 | 177 | ), |
178 | 178 | "destination" => "https://app.optimizely.com/", |
179 | 179 | "extension_id" => 1234, |
@@ -181,23 +181,23 @@ discard block |
||
181 | 181 | "src" => 524, |
182 | 182 | "value" => "window.someGlobalFunction();", |
183 | 183 | "id" => "string" |
184 | - ) |
|
184 | + ) |
|
185 | 185 | ), |
186 | 186 | "page_id" => 0 |
187 | - ) |
|
187 | + ) |
|
188 | 188 | ), |
189 | 189 | "archived"=> true, |
190 | 190 | "key" => "blue_button_variation", |
191 | 191 | "name" => "Blue Button", |
192 | 192 | "variation_id" => 0, |
193 | 193 | "weight" => 0 |
194 | - ) |
|
194 | + ) |
|
195 | 195 | ), |
196 | 196 | "created" => "2016-10-17T07:05:00.070Z", |
197 | 197 | "id" => 3000, |
198 | 198 | "is_classic" => false, |
199 | 199 | "last_modified" => "2016-10-17T07:05:00.070Z" |
200 | - ) |
|
200 | + ) |
|
201 | 201 | ); |
202 | 202 | |
203 | 203 | $experimentsService = new Experiments($optimizelyApiClientMock); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | "end_time" => "2016-10-17T07:05:00.089Z", |
222 | 222 | "experiment_id" => 3000, |
223 | 223 | "metrics" => array( |
224 | - array( |
|
224 | + array( |
|
225 | 225 | "event" => "string", |
226 | 226 | "event_name" => "string", |
227 | 227 | "measure" => "conversions", |
@@ -229,54 +229,54 @@ discard block |
||
229 | 229 | "priority" => 1, |
230 | 230 | "unit" => "session", |
231 | 231 | "variation_results" => array( |
232 | - "9000" => array( |
|
232 | + "9000" => array( |
|
233 | 233 | "experiment_id" => 0, |
234 | 234 | "is_baseline" => true, |
235 | 235 | "lift" => array( |
236 | - "confidence_interval" => array( |
|
236 | + "confidence_interval" => array( |
|
237 | 237 | 0.010399560300730457, |
238 | 238 | 0.0850821459929161 |
239 | - ), |
|
240 | - "is_most_conclusive" => true, |
|
241 | - "is_significant" => true, |
|
242 | - "significance" => 0, |
|
243 | - "value" => 0, |
|
244 | - "visitors_remaining" => 0 |
|
239 | + ), |
|
240 | + "is_most_conclusive" => true, |
|
241 | + "is_significant" => true, |
|
242 | + "significance" => 0, |
|
243 | + "value" => 0, |
|
244 | + "visitors_remaining" => 0 |
|
245 | 245 | ), |
246 | 246 | "name" => "Blue Button", |
247 | 247 | "rate" => 0, |
248 | 248 | "scope" => "variation", |
249 | 249 | "total_increase" => array( |
250 | - "confidence_interval" => array( |
|
250 | + "confidence_interval" => array( |
|
251 | 251 | 0.010399560300730457, |
252 | 252 | 0.0850821459929161 |
253 | - ), |
|
254 | - "is_most_conclusive" => true, |
|
255 | - "is_significant" => true, |
|
256 | - "significance" => 0, |
|
257 | - "value" => 0, |
|
258 | - "visitors_remaining" => 0 |
|
253 | + ), |
|
254 | + "is_most_conclusive" => true, |
|
255 | + "is_significant" => true, |
|
256 | + "significance" => 0, |
|
257 | + "value" => 0, |
|
258 | + "visitors_remaining" => 0 |
|
259 | 259 | ), |
260 | 260 | "value" => 0, |
261 | 261 | "variation_id" => "string" |
262 | - ) |
|
262 | + ) |
|
263 | + ) |
|
263 | 264 | ) |
264 | - ) |
|
265 | 265 | ), |
266 | 266 | "reach" => array( |
267 | - "baseline_count" => 0, |
|
268 | - "baseline_reach" => 0, |
|
269 | - "total_count" => 0, |
|
270 | - "treatment_count" => 0, |
|
271 | - "treatment_reach" => 0, |
|
272 | - "variations" => array( |
|
267 | + "baseline_count" => 0, |
|
268 | + "baseline_reach" => 0, |
|
269 | + "total_count" => 0, |
|
270 | + "treatment_count" => 0, |
|
271 | + "treatment_reach" => 0, |
|
272 | + "variations" => array( |
|
273 | 273 | "9000" => array( |
274 | - "count" => 0, |
|
275 | - "name" => "Blue Button", |
|
276 | - "variation_id" => "string", |
|
277 | - "variation_reach" => 0 |
|
274 | + "count" => 0, |
|
275 | + "name" => "Blue Button", |
|
276 | + "variation_id" => "string", |
|
277 | + "variation_reach" => 0 |
|
278 | + ) |
|
278 | 279 | ) |
279 | - ) |
|
280 | 280 | ), |
281 | 281 | "start_time" => "2016-10-17T07:05:00.090Z" |
282 | 282 | )); |
@@ -300,20 +300,20 @@ discard block |
||
300 | 300 | ->willReturn(array( |
301 | 301 | "project_id" => 1000, |
302 | 302 | "audience_ids" => array( |
303 | - 1234, |
|
304 | - 1212, |
|
305 | - 1432 |
|
303 | + 1234, |
|
304 | + 1212, |
|
305 | + 1432 |
|
306 | 306 | ), |
307 | 307 | "campaign_id" => 2000, |
308 | 308 | "changes" => array( |
309 | - array( |
|
309 | + array( |
|
310 | 310 | "type" => "custom_code", |
311 | 311 | "allow_additional_redirect" => true, |
312 | 312 | "async" => true, |
313 | 313 | "css_selector" => "a[href*=\"optimizely\"]", |
314 | 314 | "dependencies" => array( |
315 | - 24, |
|
316 | - 26 |
|
315 | + 24, |
|
316 | + 26 |
|
317 | 317 | ), |
318 | 318 | "destination" => "https://app.optimizely.com/", |
319 | 319 | "extension_id" => 1234, |
@@ -321,37 +321,37 @@ discard block |
||
321 | 321 | "src" => 524, |
322 | 322 | "value" => "window.someGlobalFunction();", |
323 | 323 | "id" => "string" |
324 | - ) |
|
324 | + ) |
|
325 | 325 | ), |
326 | 326 | "description" => "string", |
327 | 327 | "holdback" => 5000, |
328 | 328 | "key" => "home_page_experiment", |
329 | 329 | "metrics" => array( |
330 | - array( |
|
330 | + array( |
|
331 | 331 | "kind" => "string", |
332 | 332 | "id" => 0 |
333 | - ) |
|
333 | + ) |
|
334 | 334 | ), |
335 | 335 | "name" => "Blue Button Experiment", |
336 | 336 | "schedule" => array( |
337 | - "start_time" => "2016-10-17T07:05:00.099Z", |
|
338 | - "stop_time" => "2016-10-17T07:05:00.099Z", |
|
339 | - "time_zone" => "UTC" |
|
337 | + "start_time" => "2016-10-17T07:05:00.099Z", |
|
338 | + "stop_time" => "2016-10-17T07:05:00.099Z", |
|
339 | + "time_zone" => "UTC" |
|
340 | 340 | ), |
341 | 341 | "status" => "active", |
342 | 342 | "variations" => array( |
343 | - array( |
|
343 | + array( |
|
344 | 344 | "actions" => array( |
345 | - array( |
|
345 | + array( |
|
346 | 346 | "changes" => array( |
347 | - array( |
|
347 | + array( |
|
348 | 348 | "type" => "custom_code", |
349 | 349 | "allow_additional_redirect" => true, |
350 | 350 | "async" => true, |
351 | 351 | "css_selector" => "a[href*=\"optimizely\"]", |
352 | 352 | "dependencies" => array( |
353 | - 24, |
|
354 | - 26 |
|
353 | + 24, |
|
354 | + 26 |
|
355 | 355 | ), |
356 | 356 | "destination" => "https://app.optimizely.com/", |
357 | 357 | "extension_id" => 1234, |
@@ -359,17 +359,17 @@ discard block |
||
359 | 359 | "src" => 524, |
360 | 360 | "value" => "window.someGlobalFunction();", |
361 | 361 | "id" => "string" |
362 | - ) |
|
362 | + ) |
|
363 | 363 | ), |
364 | 364 | "page_id" => 0 |
365 | - ) |
|
365 | + ) |
|
366 | 366 | ), |
367 | 367 | "archived" => true, |
368 | 368 | "key" => "blue_button_variation", |
369 | 369 | "name" => "Blue Button", |
370 | 370 | "variation_id" => 0, |
371 | 371 | "weight" => 0 |
372 | - ) |
|
372 | + ) |
|
373 | 373 | ), |
374 | 374 | "created" => "2016-10-17T07:05:00.099Z", |
375 | 375 | "id" => 3000, |
@@ -382,73 +382,73 @@ discard block |
||
382 | 382 | $experiment = new Experiment(array( |
383 | 383 | "project_id" => 1000, |
384 | 384 | "audience_ids" => array( |
385 | - 1234, |
|
386 | - 1212, |
|
387 | - 1432 |
|
385 | + 1234, |
|
386 | + 1212, |
|
387 | + 1432 |
|
388 | 388 | ), |
389 | 389 | "campaign_id" => 2000, |
390 | 390 | "changes" => array( |
391 | - array( |
|
391 | + array( |
|
392 | 392 | "type" => "custom_code", |
393 | 393 | "allow_additional_redirect" => true, |
394 | 394 | "async" => true, |
395 | 395 | "css_selector" => "a[href*=\"optimizely\"]", |
396 | 396 | "dependencies" => array( |
397 | - 24, |
|
398 | - 26 |
|
397 | + 24, |
|
398 | + 26 |
|
399 | 399 | ), |
400 | 400 | "destination" => "https://app.optimizely.com/", |
401 | 401 | "extension_id" => 1234, |
402 | 402 | "preserve_parameters" => true, |
403 | 403 | "src" => 524, |
404 | 404 | "value" => "window.someGlobalFunction();" |
405 | - ) |
|
405 | + ) |
|
406 | 406 | ), |
407 | 407 | "description" => "string", |
408 | 408 | "holdback" => 5000, |
409 | 409 | "key" => "home_page_experiment", |
410 | 410 | "metrics" => array( |
411 | - array( |
|
411 | + array( |
|
412 | 412 | "kind" => "string" |
413 | - ) |
|
413 | + ) |
|
414 | 414 | ), |
415 | 415 | "name" => "Blue Button Experiment", |
416 | 416 | "schedule" => array( |
417 | - "start_time" => "2016-10-17T07:04:59.724Z", |
|
418 | - "stop_time" => "2016-10-17T07:04:59.724Z", |
|
419 | - "time_zone" => "UTC" |
|
417 | + "start_time" => "2016-10-17T07:04:59.724Z", |
|
418 | + "stop_time" => "2016-10-17T07:04:59.724Z", |
|
419 | + "time_zone" => "UTC" |
|
420 | 420 | ), |
421 | 421 | "status" => "active", |
422 | 422 | "variations" => array( |
423 | - array( |
|
423 | + array( |
|
424 | 424 | "actions" => array( |
425 | - array( |
|
425 | + array( |
|
426 | 426 | "changes" => array( |
427 | - array( |
|
427 | + array( |
|
428 | 428 | "type" => "custom_code", |
429 | 429 | "allow_additional_redirect" => true, |
430 | 430 | "async" => true, |
431 | 431 | "css_selector" => "a[href*=\"optimizely\"]", |
432 | 432 | "dependencies" => array( |
433 | - 24, |
|
434 | - 26 |
|
433 | + 24, |
|
434 | + 26 |
|
435 | 435 | ), |
436 | 436 | "destination" => "https://app.optimizely.com/", |
437 | 437 | "extension_id" => 1234, |
438 | 438 | "preserve_parameters" => true, |
439 | 439 | "src" => 524, |
440 | 440 | "value" => "window.someGlobalFunction();" |
441 | - ) |
|
441 | + ) |
|
442 | 442 | ), |
443 | 443 | "page_id" => 0 |
444 | - ) |
|
444 | + ) |
|
445 | 445 | ), |
446 | 446 | "archived" => true, |
447 | 447 | "key" => "blue_button_variation", |
448 | 448 | "name" => "Blue Button", |
449 | 449 | "variation_id" => 0, |
450 | 450 | "weight" => 0 |
451 | - ) |
|
451 | + ) |
|
452 | 452 | ) |
453 | 453 | )); |
454 | 454 | |
@@ -469,20 +469,20 @@ discard block |
||
469 | 469 | ->willReturn(array( |
470 | 470 | "project_id" => 1000, |
471 | 471 | "audience_ids" => array( |
472 | - 1234, |
|
473 | - 1212, |
|
474 | - 1432 |
|
472 | + 1234, |
|
473 | + 1212, |
|
474 | + 1432 |
|
475 | 475 | ), |
476 | 476 | "campaign_id" => 2000, |
477 | 477 | "changes" => array( |
478 | - array( |
|
478 | + array( |
|
479 | 479 | "type" => "custom_code", |
480 | 480 | "allow_additional_redirect" => true, |
481 | 481 | "async" => true, |
482 | 482 | "css_selector" => "a[href*=\"optimizely\"]", |
483 | 483 | "dependencies" => array( |
484 | - 24, |
|
485 | - 26 |
|
484 | + 24, |
|
485 | + 26 |
|
486 | 486 | ), |
487 | 487 | "destination" => "https://app.optimizely.com/", |
488 | 488 | "extension_id" => 1234, |
@@ -490,37 +490,37 @@ discard block |
||
490 | 490 | "src" => 524, |
491 | 491 | "value" => "window.someGlobalFunction();", |
492 | 492 | "id" => "string" |
493 | - ) |
|
493 | + ) |
|
494 | 494 | ), |
495 | 495 | "description" => "string", |
496 | 496 | "holdback" => 5000, |
497 | 497 | "key" => "home_page_experiment", |
498 | 498 | "metrics" => array( |
499 | - array( |
|
499 | + array( |
|
500 | 500 | "kind" => "string", |
501 | 501 | "id" => 0 |
502 | - ) |
|
502 | + ) |
|
503 | 503 | ), |
504 | 504 | "name" => "Blue Button Experiment", |
505 | 505 | "schedule" => array( |
506 | - "start_time" => "2016-10-17T07:05:00.109Z", |
|
507 | - "stop_time" => "2016-10-17T07:05:00.109Z", |
|
508 | - "time_zone" => "UTC" |
|
506 | + "start_time" => "2016-10-17T07:05:00.109Z", |
|
507 | + "stop_time" => "2016-10-17T07:05:00.109Z", |
|
508 | + "time_zone" => "UTC" |
|
509 | 509 | ), |
510 | 510 | "status" => "active", |
511 | 511 | "variations" => array( |
512 | - array( |
|
512 | + array( |
|
513 | 513 | "actions" => array( |
514 | - array( |
|
514 | + array( |
|
515 | 515 | "changes" => array( |
516 | - array( |
|
516 | + array( |
|
517 | 517 | "type" => "custom_code", |
518 | 518 | "allow_additional_redirect" => true, |
519 | 519 | "async" => true, |
520 | 520 | "css_selector" => "a[href*=\"optimizely\"]", |
521 | 521 | "dependencies" => array( |
522 | - 24, |
|
523 | - 26 |
|
522 | + 24, |
|
523 | + 26 |
|
524 | 524 | ), |
525 | 525 | "destination" => "https://app.optimizely.com/", |
526 | 526 | "extension_id" => 1234, |
@@ -528,17 +528,17 @@ discard block |
||
528 | 528 | "src" => 524, |
529 | 529 | "value" => "window.someGlobalFunction();", |
530 | 530 | "id" => "string" |
531 | - ) |
|
531 | + ) |
|
532 | 532 | ), |
533 | 533 | "page_id" => 0 |
534 | - ) |
|
534 | + ) |
|
535 | 535 | ), |
536 | 536 | "archived" => true, |
537 | 537 | "key" => "blue_button_variation", |
538 | 538 | "name" => "Blue Button", |
539 | 539 | "variation_id" => 0, |
540 | 540 | "weight" => 0 |
541 | - ) |
|
541 | + ) |
|
542 | 542 | ), |
543 | 543 | "created" => "2016-10-17T07:05:00.109Z", |
544 | 544 | "id" => 3000, |
@@ -549,72 +549,72 @@ discard block |
||
549 | 549 | $experimentsService = new Experiments($optimizelyApiClientMock); |
550 | 550 | |
551 | 551 | $experiment = new Experiment(array( |
552 | - "audience_ids" => array( |
|
552 | + "audience_ids" => array( |
|
553 | 553 | 0 |
554 | - ), |
|
555 | - "changes" => array( |
|
554 | + ), |
|
555 | + "changes" => array( |
|
556 | 556 | array( |
557 | - "type" => "custom_code", |
|
558 | - "allow_additional_redirect" => true, |
|
559 | - "async" => true, |
|
560 | - "css_selector" => "a[href*=\"optimizely\"]", |
|
561 | - "dependencies" => array( |
|
557 | + "type" => "custom_code", |
|
558 | + "allow_additional_redirect" => true, |
|
559 | + "async" => true, |
|
560 | + "css_selector" => "a[href*=\"optimizely\"]", |
|
561 | + "dependencies" => array( |
|
562 | 562 | 24, |
563 | 563 | 26 |
564 | - ), |
|
565 | - "destination" => "https://app.optimizely.com/", |
|
566 | - "extension_id" => 1234, |
|
567 | - "preserve_parameters" => true, |
|
568 | - "src" => 524, |
|
569 | - "value" => "window.someGlobalFunction();" |
|
564 | + ), |
|
565 | + "destination" => "https://app.optimizely.com/", |
|
566 | + "extension_id" => 1234, |
|
567 | + "preserve_parameters" => true, |
|
568 | + "src" => 524, |
|
569 | + "value" => "window.someGlobalFunction();" |
|
570 | 570 | ) |
571 | - ), |
|
572 | - "description" => "AB Test to see if the Blue Button converts more visitors", |
|
573 | - "holdback" => 0, |
|
574 | - "key" => "home_page_experiment", |
|
575 | - "metrics" => array( |
|
571 | + ), |
|
572 | + "description" => "AB Test to see if the Blue Button converts more visitors", |
|
573 | + "holdback" => 0, |
|
574 | + "key" => "home_page_experiment", |
|
575 | + "metrics" => array( |
|
576 | 576 | array( |
577 | - "kind" => "string" |
|
577 | + "kind" => "string" |
|
578 | 578 | ) |
579 | - ), |
|
580 | - "name" => "Blue Button Experiment", |
|
581 | - "schedule" => array( |
|
579 | + ), |
|
580 | + "name" => "Blue Button Experiment", |
|
581 | + "schedule" => array( |
|
582 | 582 | "start_time" => "2016-10-17T07:04:59.731Z", |
583 | 583 | "stop_time" => "2016-10-17T07:04:59.731Z", |
584 | 584 | "time_zone" => "UTC" |
585 | - ), |
|
586 | - "status" => "active", |
|
587 | - "variations" => array( |
|
585 | + ), |
|
586 | + "status" => "active", |
|
587 | + "variations" => array( |
|
588 | 588 | array( |
589 | - "actions" => array( |
|
589 | + "actions" => array( |
|
590 | 590 | array( |
591 | - "changes" => array( |
|
591 | + "changes" => array( |
|
592 | 592 | array( |
593 | - "type" => "custom_code", |
|
594 | - "allow_additional_redirect" => true, |
|
595 | - "async" => true, |
|
596 | - "css_selector" => "a[href*=\"optimizely\"]", |
|
597 | - "dependencies" => array( |
|
593 | + "type" => "custom_code", |
|
594 | + "allow_additional_redirect" => true, |
|
595 | + "async" => true, |
|
596 | + "css_selector" => "a[href*=\"optimizely\"]", |
|
597 | + "dependencies" => array( |
|
598 | 598 | 24, |
599 | 599 | 26 |
600 | - ), |
|
601 | - "destination" => "https://app.optimizely.com/", |
|
602 | - "extension_id" => 1234, |
|
603 | - "preserve_parameters" => true, |
|
604 | - "src" => 524, |
|
605 | - "value" => "window.someGlobalFunction();" |
|
600 | + ), |
|
601 | + "destination" => "https://app.optimizely.com/", |
|
602 | + "extension_id" => 1234, |
|
603 | + "preserve_parameters" => true, |
|
604 | + "src" => 524, |
|
605 | + "value" => "window.someGlobalFunction();" |
|
606 | 606 | ) |
607 | - ), |
|
608 | - "page_id" => 0 |
|
607 | + ), |
|
608 | + "page_id" => 0 |
|
609 | 609 | ) |
610 | - ), |
|
611 | - "archived" => true, |
|
612 | - "key" => "blue_button_variation", |
|
613 | - "name" => "Blue Button", |
|
614 | - "variation_id" => 0, |
|
615 | - "weight" => 0 |
|
610 | + ), |
|
611 | + "archived" => true, |
|
612 | + "key" => "blue_button_variation", |
|
613 | + "name" => "Blue Button", |
|
614 | + "variation_id" => 0, |
|
615 | + "weight" => 0 |
|
616 | + ) |
|
616 | 617 | ) |
617 | - ) |
|
618 | 618 | )); |
619 | 619 | |
620 | 620 | $updatedExperiment = $experimentsService->update(1000, $experiment, true, true); |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | |
107 | 107 | $experiments = $experimentsService->listAll(1000); |
108 | 108 | |
109 | - $this->assertTrue(count($experiments)==1); |
|
109 | + $this->assertTrue(count($experiments) == 1); |
|
110 | 110 | $this->assertTrue($experiments[0] instanceOf Experiment); |
111 | - $this->assertTrue($experiments[0]->getName()=='Blue Button Experiment'); |
|
111 | + $this->assertTrue($experiments[0]->getName() == 'Blue Button Experiment'); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | public function testGet() |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $experiment = $experimentsService->get(3000); |
206 | 206 | |
207 | 207 | $this->assertTrue($experiment instanceOf Experiment); |
208 | - $this->assertTrue($experiment->getName()=='Blue Button Experiment'); |
|
208 | + $this->assertTrue($experiment->getName() == 'Blue Button Experiment'); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | public function testGetResults() |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | $experimentResults = $experimentsService->getResults(3000); |
287 | 287 | |
288 | 288 | $this->assertTrue($experimentResults instanceOf ExperimentResults); |
289 | - $this->assertTrue($experimentResults->getConfidenceThreshold()==0.9); |
|
289 | + $this->assertTrue($experimentResults->getConfidenceThreshold() == 0.9); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | public function testCreate() |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | $createdExperiment = $experimentsService->create($experiment, true); |
456 | 456 | |
457 | 457 | $this->assertTrue($createdExperiment instanceOf Experiment); |
458 | - $this->assertTrue($createdExperiment->getName()=='Blue Button Experiment'); |
|
458 | + $this->assertTrue($createdExperiment->getName() == 'Blue Button Experiment'); |
|
459 | 459 | } |
460 | 460 | |
461 | 461 | public function testUpdate() |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | $updatedExperiment = $experimentsService->update(1000, $experiment, true, true); |
621 | 621 | |
622 | 622 | $this->assertTrue($updatedExperiment instanceOf Experiment); |
623 | - $this->assertTrue($updatedExperiment->getName()=='Blue Button Experiment'); |
|
623 | + $this->assertTrue($updatedExperiment->getName() == 'Blue Button Experiment'); |
|
624 | 624 | } |
625 | 625 | |
626 | 626 | public function testDelete() |
@@ -11,7 +11,7 @@ |
||
11 | 11 | $credentials = file_get_contents(dirname(__FILE__) . '/../../../auth_credentials.json'); |
12 | 12 | if ($credentials===false) { |
13 | 13 | $this->fail("Couldn't read OAuth credentials from auth_credentials.json. Make sure " . |
14 | - "the file exists (if not, copy from auth_credentials.json.dist)."); |
|
14 | + "the file exists (if not, copy from auth_credentials.json.dist)."); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | $credentials = json_decode($credentials, true); |
@@ -8,9 +8,9 @@ discard block |
||
8 | 8 | public function loadCredentialsFromFile() |
9 | 9 | { |
10 | 10 | // Get OAuth 2.0 credentials from auth_credentials.json file. |
11 | - $credentials = file_get_contents(dirname(__FILE__) . '/../../../auth_credentials.json'); |
|
12 | - if ($credentials===false) { |
|
13 | - $this->fail("Couldn't read OAuth credentials from auth_credentials.json. Make sure " . |
|
11 | + $credentials = file_get_contents(dirname(__FILE__).'/../../../auth_credentials.json'); |
|
12 | + if ($credentials === false) { |
|
13 | + $this->fail("Couldn't read OAuth credentials from auth_credentials.json. Make sure ". |
|
14 | 14 | "the file exists (if not, copy from auth_credentials.json.dist)."); |
15 | 15 | } |
16 | 16 | |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | // Try to read access_token.json and merge it with the rest of credentials. |
23 | - if (is_readable(dirname(__FILE__) . '/../../../access_token.json')) { |
|
24 | - $accessToken = file_get_contents(dirname(__FILE__) . '/access_token.json'); |
|
23 | + if (is_readable(dirname(__FILE__).'/../../../access_token.json')) { |
|
24 | + $accessToken = file_get_contents(dirname(__FILE__).'/access_token.json'); |
|
25 | 25 | |
26 | 26 | $accessToken = json_decode($accessToken, true); |
27 | 27 | if (!is_array($accessToken)) { |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | array( |
22 | 22 | "project_id" => 1000, |
23 | 23 | "changes" => array( |
24 | - array( |
|
24 | + array( |
|
25 | 25 | "type" => "custom_code", |
26 | 26 | "allow_additional_redirect" => true, |
27 | 27 | "async" => true, |
28 | 28 | "css_selector" => "a[href*=\"optimizely\"]", |
29 | 29 | "dependencies" => array( |
30 | - 24, |
|
31 | - 26 |
|
30 | + 24, |
|
31 | + 26 |
|
32 | 32 | ), |
33 | 33 | "destination" => "https://app.optimizely.com/", |
34 | 34 | "extension_id" => 1234, |
@@ -36,30 +36,30 @@ discard block |
||
36 | 36 | "src" => 524, |
37 | 37 | "value" => "window.someGlobalFunction();", |
38 | 38 | "id" => "string" |
39 | - ) |
|
39 | + ) |
|
40 | 40 | ), |
41 | 41 | "created" => "2016-10-18T03:27:04.123Z", |
42 | 42 | "earliest" => "2016-10-18T03:27:04.123Z", |
43 | 43 | "experiment_ids" => array( |
44 | - 0 |
|
44 | + 0 |
|
45 | 45 | ), |
46 | 46 | "holdback" => 0, |
47 | 47 | "last_modified" => "2016-10-18T03:27:04.123Z", |
48 | 48 | "latest" => "2016-10-18T03:27:04.123Z", |
49 | 49 | "metrics" => array( |
50 | - array( |
|
50 | + array( |
|
51 | 51 | "kind" => "string", |
52 | 52 | "id" => 0 |
53 | - ) |
|
53 | + ) |
|
54 | 54 | ), |
55 | 55 | "name" => "Landing Page Optimization", |
56 | 56 | "page_ids" => array( |
57 | - 0 |
|
57 | + 0 |
|
58 | 58 | ), |
59 | 59 | "status" => "active", |
60 | 60 | "type" => "a/b", |
61 | 61 | "id" => 2000 |
62 | - ) |
|
62 | + ) |
|
63 | 63 | ) |
64 | 64 | ); |
65 | 65 | |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | ->willReturn(array( |
84 | 84 | "project_id" => 1000, |
85 | 85 | "changes" => array( |
86 | - array( |
|
86 | + array( |
|
87 | 87 | "type" => "custom_code", |
88 | 88 | "allow_additional_redirect" => true, |
89 | 89 | "async" => true, |
90 | 90 | "css_selector" => "a[href*=\"optimizely\"]", |
91 | 91 | "dependencies" => array( |
92 | - 24, |
|
93 | - 26 |
|
92 | + 24, |
|
93 | + 26 |
|
94 | 94 | ), |
95 | 95 | "destination" => "https://app.optimizely.com/", |
96 | 96 | "extension_id" => 1234, |
@@ -98,25 +98,25 @@ discard block |
||
98 | 98 | "src" => 524, |
99 | 99 | "value" => "window.someGlobalFunction();", |
100 | 100 | "id" => "string" |
101 | - ) |
|
101 | + ) |
|
102 | 102 | ), |
103 | 103 | "created" => "2016-10-18T03:27:04.139Z", |
104 | 104 | "earliest" => "2016-10-18T03:27:04.139Z", |
105 | 105 | "experiment_ids" => array( |
106 | - 0 |
|
106 | + 0 |
|
107 | 107 | ), |
108 | 108 | "holdback" => 0, |
109 | 109 | "last_modified" => "2016-10-18T03:27:04.139Z", |
110 | 110 | "latest" => "2016-10-18T03:27:04.139Z", |
111 | 111 | "metrics" => array( |
112 | - array( |
|
112 | + array( |
|
113 | 113 | "kind" => "string", |
114 | 114 | "id" => 0 |
115 | - ) |
|
115 | + ) |
|
116 | 116 | ), |
117 | 117 | "name" => "Landing Page Optimization", |
118 | 118 | "page_ids" => array( |
119 | - 0 |
|
119 | + 0 |
|
120 | 120 | ), |
121 | 121 | "status" => "active", |
122 | 122 | "type" => "a/b", |
@@ -144,47 +144,47 @@ discard block |
||
144 | 144 | "confidence_threshold" => 0, |
145 | 145 | "end_time" => "2016-10-18T03:27:04.147Z", |
146 | 146 | "metrics" => array( |
147 | - array( |
|
147 | + array( |
|
148 | 148 | "event" => "string", |
149 | 149 | "event_name" => "string", |
150 | 150 | "measure" => "conversions", |
151 | 151 | "metric_id" => "string", |
152 | 152 | "priority" => 0, |
153 | 153 | "results" => array( |
154 | - "campaign" => array( |
|
154 | + "campaign" => array( |
|
155 | 155 | "experiment_id" => 0, |
156 | 156 | "is_baseline" => true, |
157 | 157 | "lift" => array( |
158 | - "confidence_interval" => array( |
|
158 | + "confidence_interval" => array( |
|
159 | 159 | 0.010399560300730457, |
160 | 160 | 0.0850821459929161 |
161 | - ), |
|
162 | - "is_most_conclusive" => true, |
|
163 | - "is_significant" => true, |
|
164 | - "significance" => 0, |
|
165 | - "value" => 0, |
|
166 | - "visitors_remaining" => 0 |
|
161 | + ), |
|
162 | + "is_most_conclusive" => true, |
|
163 | + "is_significant" => true, |
|
164 | + "significance" => 0, |
|
165 | + "value" => 0, |
|
166 | + "visitors_remaining" => 0 |
|
167 | 167 | ), |
168 | 168 | "name" => "Blue Button", |
169 | 169 | "rate" => 0, |
170 | 170 | "scope" => "variation", |
171 | 171 | "total_increase" => array( |
172 | - "confidence_interval" => array( |
|
172 | + "confidence_interval" => array( |
|
173 | 173 | 0.010399560300730457, |
174 | 174 | 0.0850821459929161 |
175 | - ), |
|
176 | - "is_most_conclusive" => true, |
|
177 | - "is_significant" => true, |
|
178 | - "significance" => 0, |
|
179 | - "value" => 0, |
|
180 | - "visitors_remaining" => 0 |
|
175 | + ), |
|
176 | + "is_most_conclusive" => true, |
|
177 | + "is_significant" => true, |
|
178 | + "significance" => 0, |
|
179 | + "value" => 0, |
|
180 | + "visitors_remaining" => 0 |
|
181 | 181 | ), |
182 | 182 | "value" => 0, |
183 | 183 | "variation_id" => "string" |
184 | - ) |
|
184 | + ) |
|
185 | 185 | ), |
186 | 186 | "unit" => "session" |
187 | - ) |
|
187 | + ) |
|
188 | 188 | ), |
189 | 189 | "start_time" => "2016-10-18T03:27:04.148Z" |
190 | 190 | )); |
@@ -209,14 +209,14 @@ discard block |
||
209 | 209 | ->willReturn(array( |
210 | 210 | "project_id" => 1000, |
211 | 211 | "changes" => array( |
212 | - array( |
|
212 | + array( |
|
213 | 213 | "type" => "custom_code", |
214 | 214 | "allow_additional_redirect" => true, |
215 | 215 | "async" => true, |
216 | 216 | "css_selector" => "a[href*=\"optimizely\"]", |
217 | 217 | "dependencies" => array( |
218 | - 24, |
|
219 | - 26 |
|
218 | + 24, |
|
219 | + 26 |
|
220 | 220 | ), |
221 | 221 | "destination" => "https://app.optimizely.com/", |
222 | 222 | "extension_id" => 1234, |
@@ -224,25 +224,25 @@ discard block |
||
224 | 224 | "src" => 524, |
225 | 225 | "value" => "window.someGlobalFunction();", |
226 | 226 | "id" => "string" |
227 | - ) |
|
227 | + ) |
|
228 | 228 | ), |
229 | 229 | "created" => "2016-10-18T03:27:04.155Z", |
230 | 230 | "earliest" => "2016-10-18T03:27:04.155Z", |
231 | 231 | "experiment_ids" => array( |
232 | - 0 |
|
232 | + 0 |
|
233 | 233 | ), |
234 | 234 | "holdback" => 0, |
235 | 235 | "last_modified" => "2016-10-18T03:27:04.155Z", |
236 | 236 | "latest" => "2016-10-18T03:27:04.155Z", |
237 | 237 | "metrics" => array( |
238 | - array( |
|
238 | + array( |
|
239 | 239 | "kind" => "string", |
240 | 240 | "id" => 0 |
241 | - ) |
|
241 | + ) |
|
242 | 242 | ), |
243 | 243 | "name" => "Landing Page Optimization", |
244 | 244 | "page_ids" => array( |
245 | - 0 |
|
245 | + 0 |
|
246 | 246 | ), |
247 | 247 | "status" => "active", |
248 | 248 | "type" => "a/b", |
@@ -254,38 +254,38 @@ discard block |
||
254 | 254 | $campaign = new Campaign(array( |
255 | 255 | "project_id" => 1000, |
256 | 256 | "changes" => array( |
257 | - array( |
|
257 | + array( |
|
258 | 258 | "type" => "custom_code", |
259 | 259 | "allow_additional_redirect" => true, |
260 | 260 | "async" => true, |
261 | 261 | "css_selector" => "a[href*=\"optimizely\"]", |
262 | 262 | "dependencies" => array( |
263 | - 24, |
|
264 | - 26 |
|
263 | + 24, |
|
264 | + 26 |
|
265 | 265 | ), |
266 | 266 | "destination" => "https://app.optimizely.com/", |
267 | 267 | "extension_id" => 1234, |
268 | 268 | "preserve_parameters" => true, |
269 | 269 | "src" => 524, |
270 | 270 | "value" => "window.someGlobalFunction();" |
271 | - ) |
|
271 | + ) |
|
272 | 272 | ), |
273 | 273 | "created" => "2016-10-18T03:27:04.067Z", |
274 | 274 | "earliest" => "2016-10-18T03:27:04.067Z", |
275 | 275 | "experiment_ids" => array( |
276 | - 0 |
|
276 | + 0 |
|
277 | 277 | ), |
278 | 278 | "holdback" => 0, |
279 | 279 | "last_modified" => "2016-10-18T03:27:04.067Z", |
280 | 280 | "latest" => "2016-10-18T03:27:04.067Z", |
281 | 281 | "metrics" => array( |
282 | - array( |
|
282 | + array( |
|
283 | 283 | "kind" => "string" |
284 | - ) |
|
284 | + ) |
|
285 | 285 | ), |
286 | 286 | "name" => "Landing Page Optimization", |
287 | 287 | "page_ids" => array( |
288 | - 0 |
|
288 | + 0 |
|
289 | 289 | ), |
290 | 290 | "status" => "active", |
291 | 291 | "type" => "a/b" |
@@ -308,14 +308,14 @@ discard block |
||
308 | 308 | ->willReturn(array( |
309 | 309 | "project_id" => 1000, |
310 | 310 | "changes" => array( |
311 | - array( |
|
311 | + array( |
|
312 | 312 | "type" => "custom_code", |
313 | 313 | "allow_additional_redirect" => true, |
314 | 314 | "async" => true, |
315 | 315 | "css_selector" => "a[href*=\"optimizely\"]", |
316 | 316 | "dependencies" => array( |
317 | - 24, |
|
318 | - 26 |
|
317 | + 24, |
|
318 | + 26 |
|
319 | 319 | ), |
320 | 320 | "destination" => "https://app.optimizely.com/", |
321 | 321 | "extension_id" => 1234, |
@@ -323,25 +323,25 @@ discard block |
||
323 | 323 | "src" => 524, |
324 | 324 | "value" => "window.someGlobalFunction();", |
325 | 325 | "id" => "string" |
326 | - ) |
|
326 | + ) |
|
327 | 327 | ), |
328 | 328 | "created" => "2016-10-18T03:27:04.155Z", |
329 | 329 | "earliest" => "2016-10-18T03:27:04.155Z", |
330 | 330 | "experiment_ids" => array( |
331 | - 0 |
|
331 | + 0 |
|
332 | 332 | ), |
333 | 333 | "holdback" => 0, |
334 | 334 | "last_modified" => "2016-10-18T03:27:04.155Z", |
335 | 335 | "latest" => "2016-10-18T03:27:04.155Z", |
336 | 336 | "metrics" => array( |
337 | - array( |
|
337 | + array( |
|
338 | 338 | "kind" => "string", |
339 | 339 | "id" => 0 |
340 | - ) |
|
340 | + ) |
|
341 | 341 | ), |
342 | 342 | "name" => "Landing Page Optimization", |
343 | 343 | "page_ids" => array( |
344 | - 0 |
|
344 | + 0 |
|
345 | 345 | ), |
346 | 346 | "status" => "active", |
347 | 347 | "type" => "a/b", |
@@ -353,38 +353,38 @@ discard block |
||
353 | 353 | $campaign = new Campaign(array( |
354 | 354 | "project_id" => 1000, |
355 | 355 | "changes" => array( |
356 | - array( |
|
356 | + array( |
|
357 | 357 | "type" => "custom_code", |
358 | 358 | "allow_additional_redirect" => true, |
359 | 359 | "async" => true, |
360 | 360 | "css_selector" => "a[href*=\"optimizely\"]", |
361 | 361 | "dependencies" => array( |
362 | - 24, |
|
363 | - 26 |
|
362 | + 24, |
|
363 | + 26 |
|
364 | 364 | ), |
365 | 365 | "destination" => "https://app.optimizely.com/", |
366 | 366 | "extension_id" => 1234, |
367 | 367 | "preserve_parameters" => true, |
368 | 368 | "src" => 524, |
369 | 369 | "value" => "window.someGlobalFunction();" |
370 | - ) |
|
370 | + ) |
|
371 | 371 | ), |
372 | 372 | "created" => "2016-10-18T03:27:04.067Z", |
373 | 373 | "earliest" => "2016-10-18T03:27:04.067Z", |
374 | 374 | "experiment_ids" => array( |
375 | - 0 |
|
375 | + 0 |
|
376 | 376 | ), |
377 | 377 | "holdback" => 0, |
378 | 378 | "last_modified" => "2016-10-18T03:27:04.067Z", |
379 | 379 | "latest" => "2016-10-18T03:27:04.067Z", |
380 | 380 | "metrics" => array( |
381 | - array( |
|
381 | + array( |
|
382 | 382 | "kind" => "string" |
383 | - ) |
|
383 | + ) |
|
384 | 384 | ), |
385 | 385 | "name" => "Landing Page Optimization", |
386 | 386 | "page_ids" => array( |
387 | - 0 |
|
387 | + 0 |
|
388 | 388 | ), |
389 | 389 | "status" => "active", |
390 | 390 | "type" => "a/b" |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | |
68 | 68 | $campaigns = $campaignsService->listAll(1000); |
69 | 69 | |
70 | - $this->assertTrue(count($campaigns)==1); |
|
70 | + $this->assertTrue(count($campaigns) == 1); |
|
71 | 71 | $this->assertTrue($campaigns[0] instanceOf Campaign); |
72 | - $this->assertTrue($campaigns[0]->getName()=='Landing Page Optimization'); |
|
72 | + $this->assertTrue($campaigns[0]->getName() == 'Landing Page Optimization'); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | public function testGet() |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $campaign = $campaignsService->get(2000); |
129 | 129 | |
130 | 130 | $this->assertTrue($campaign instanceOf Campaign); |
131 | - $this->assertTrue($campaign->getName()=='Landing Page Optimization'); |
|
131 | + $this->assertTrue($campaign->getName() == 'Landing Page Optimization'); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | public function testGetResults() |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | $campaignResults = $campaignsService->getResults(3000); |
195 | 195 | |
196 | 196 | $this->assertTrue($campaignResults instanceOf CampaignResults); |
197 | - $this->assertTrue($campaignResults->getConfidenceThreshold()==0); |
|
198 | - $this->assertTrue($campaignResults->getStartTime()=="2016-10-18T03:27:04.148Z"); |
|
197 | + $this->assertTrue($campaignResults->getConfidenceThreshold() == 0); |
|
198 | + $this->assertTrue($campaignResults->getStartTime() == "2016-10-18T03:27:04.148Z"); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | public function testCreate() |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $createdCampaign = $campaignsService->create($campaign); |
295 | 295 | |
296 | 296 | $this->assertTrue($createdCampaign instanceOf Campaign); |
297 | - $this->assertTrue($createdCampaign->getName()=='Landing Page Optimization'); |
|
297 | + $this->assertTrue($createdCampaign->getName() == 'Landing Page Optimization'); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | public function testUpdate() |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | $updatedCampaign = $campaignsService->update(2000, $campaign); |
394 | 394 | |
395 | 395 | $this->assertTrue($updatedCampaign instanceOf Campaign); |
396 | - $this->assertTrue($updatedCampaign->getName()=='Landing Page Optimization'); |
|
396 | + $this->assertTrue($updatedCampaign->getName() == 'Landing Page Optimization'); |
|
397 | 397 | } |
398 | 398 | |
399 | 399 | public function testDelete() |
@@ -109,16 +109,16 @@ discard block |
||
109 | 109 | "platform" => "web", |
110 | 110 | "status" => "active", |
111 | 111 | "web_snippet" => array( |
112 | - "enable_force_variation" => false, |
|
113 | - "exclude_disabled_experiments" => false, |
|
114 | - "exclude_names" => true, |
|
115 | - "include_jquery" => true, |
|
116 | - "ip_anonymization" => false, |
|
117 | - "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
118 | - "library" => "jquery-1.11.3-trim", |
|
119 | - "project_javascript" => "alert(\"Active Experiment\")", |
|
120 | - "code_revision" => 0, |
|
121 | - "js_file_size" => 63495 |
|
112 | + "enable_force_variation" => false, |
|
113 | + "exclude_disabled_experiments" => false, |
|
114 | + "exclude_names" => true, |
|
115 | + "include_jquery" => true, |
|
116 | + "ip_anonymization" => false, |
|
117 | + "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
118 | + "library" => "jquery-1.11.3-trim", |
|
119 | + "project_javascript" => "alert(\"Active Experiment\")", |
|
120 | + "code_revision" => 0, |
|
121 | + "js_file_size" => 63495 |
|
122 | 122 | ), |
123 | 123 | "created" => "2016-10-17T07:04:59.991Z", |
124 | 124 | "id" => 1000, |
@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | "platform" => "web", |
138 | 138 | "status" => "active", |
139 | 139 | "web_snippet" => array( |
140 | - "enable_force_variation" => false, |
|
141 | - "exclude_disabled_experiments" => false, |
|
142 | - "exclude_names" => true, |
|
143 | - "include_jquery" => true, |
|
144 | - "ip_anonymization" => false, |
|
145 | - "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
146 | - "library" => "jquery-1.11.3-trim", |
|
147 | - "project_javascript" => "alert(\"Active Experiment\")" |
|
140 | + "enable_force_variation" => false, |
|
141 | + "exclude_disabled_experiments" => false, |
|
142 | + "exclude_names" => true, |
|
143 | + "include_jquery" => true, |
|
144 | + "ip_anonymization" => false, |
|
145 | + "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
146 | + "library" => "jquery-1.11.3-trim", |
|
147 | + "project_javascript" => "alert(\"Active Experiment\")" |
|
148 | 148 | ) |
149 | 149 | )); |
150 | 150 | |
@@ -173,16 +173,16 @@ discard block |
||
173 | 173 | "platform" => "web", |
174 | 174 | "status" => "active", |
175 | 175 | "web_snippet" => array( |
176 | - "enable_force_variation" => false, |
|
177 | - "exclude_disabled_experiments" => false, |
|
178 | - "exclude_names" => true, |
|
179 | - "include_jquery" => true, |
|
180 | - "ip_anonymization" => false, |
|
181 | - "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
182 | - "library" => "jquery-1.11.3-trim", |
|
183 | - "project_javascript" => "alert(\"Active Experiment\")", |
|
184 | - "code_revision" => 0, |
|
185 | - "js_file_size" => 63495 |
|
176 | + "enable_force_variation" => false, |
|
177 | + "exclude_disabled_experiments" => false, |
|
178 | + "exclude_names" => true, |
|
179 | + "include_jquery" => true, |
|
180 | + "ip_anonymization" => false, |
|
181 | + "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
182 | + "library" => "jquery-1.11.3-trim", |
|
183 | + "project_javascript" => "alert(\"Active Experiment\")", |
|
184 | + "code_revision" => 0, |
|
185 | + "js_file_size" => 63495 |
|
186 | 186 | ), |
187 | 187 | "created" => "2016-10-17T07:04:59.999Z", |
188 | 188 | "id" => 1000, |
@@ -199,14 +199,14 @@ discard block |
||
199 | 199 | "name" => "Test Project", |
200 | 200 | "status" => "active", |
201 | 201 | "web_snippet" => array( |
202 | - "enable_force_variation" => false, |
|
203 | - "exclude_disabled_experiments" => false, |
|
204 | - "exclude_names" => true, |
|
205 | - "include_jquery" => true, |
|
206 | - "ip_anonymization" => false, |
|
207 | - "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
208 | - "library" => "jquery-1.11.3-trim", |
|
209 | - "project_javascript" => "alert(\"Active Experiment\")" |
|
202 | + "enable_force_variation" => false, |
|
203 | + "exclude_disabled_experiments" => false, |
|
204 | + "exclude_names" => true, |
|
205 | + "include_jquery" => true, |
|
206 | + "ip_anonymization" => false, |
|
207 | + "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
208 | + "library" => "jquery-1.11.3-trim", |
|
209 | + "project_javascript" => "alert(\"Active Experiment\")" |
|
210 | 210 | ) |
211 | 211 | )); |
212 | 212 | |
@@ -236,14 +236,14 @@ discard block |
||
236 | 236 | "platform" => "web", |
237 | 237 | "status" => "active", |
238 | 238 | "web_snippet" => array( |
239 | - "enable_force_variation" => false, |
|
240 | - "exclude_disabled_experiments" => false, |
|
241 | - "exclude_names" => true, |
|
242 | - "include_jquery" => true, |
|
243 | - "ip_anonymization" => false, |
|
244 | - "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
245 | - "library" => "jquery-1.11.3-trim", |
|
246 | - "project_javascript" => "alert(\"Active Experiment\")" |
|
239 | + "enable_force_variation" => false, |
|
240 | + "exclude_disabled_experiments" => false, |
|
241 | + "exclude_names" => true, |
|
242 | + "include_jquery" => true, |
|
243 | + "ip_anonymization" => false, |
|
244 | + "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
245 | + "library" => "jquery-1.11.3-trim", |
|
246 | + "project_javascript" => "alert(\"Active Experiment\")" |
|
247 | 247 | ) |
248 | 248 | )); |
249 | 249 |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | |
47 | 47 | $projects = $projectsService->listAll(); |
48 | 48 | |
49 | - $this->assertTrue(count($projects)==1); |
|
49 | + $this->assertTrue(count($projects) == 1); |
|
50 | 50 | $this->assertTrue($projects[0] instanceOf Project); |
51 | - $this->assertTrue($projects[0]->getName()=='Some Optimizely Project'); |
|
51 | + $this->assertTrue($projects[0]->getName() == 'Some Optimizely Project'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public function testGet() |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $project = $projectsService->get(1523456); |
89 | 89 | |
90 | 90 | $this->assertTrue($project instanceOf Project); |
91 | - $this->assertTrue($project->getName()=='Some Optimizely Project'); |
|
91 | + $this->assertTrue($project->getName() == 'Some Optimizely Project'); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | public function testCreate() |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | $createdProject = $projectsService->create($project); |
152 | 152 | |
153 | 153 | $this->assertTrue($createdProject instanceOf Project); |
154 | - $this->assertTrue($createdProject->getName()=='Test Project'); |
|
155 | - $this->assertTrue($createdProject->getAccountId()==12345); |
|
154 | + $this->assertTrue($createdProject->getName() == 'Test Project'); |
|
155 | + $this->assertTrue($createdProject->getAccountId() == 12345); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | public function testUpdate() |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | $updatedProject = $projectsService->update(121234, $project); |
214 | 214 | |
215 | 215 | $this->assertTrue($updatedProject instanceOf Project); |
216 | - $this->assertTrue($updatedProject->getName()=='Test Project'); |
|
217 | - $this->assertTrue($updatedProject->getAccountId()==12345); |
|
216 | + $this->assertTrue($updatedProject->getName() == 'Test Project'); |
|
217 | + $this->assertTrue($updatedProject->getAccountId() == 12345); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | public function testIntegration() |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $credentials = $this->loadCredentialsFromFile(); |
226 | 226 | |
227 | 227 | $optimizelyClient = new OptimizelyApiClient($credentials, 'v2'); |
228 | - $this->assertTrue($optimizelyClient!=null); |
|
228 | + $this->assertTrue($optimizelyClient != null); |
|
229 | 229 | |
230 | 230 | // Create new project |
231 | 231 | $curDate = date('Y-m-d H:i:s'); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | try { |
259 | 259 | $projects = $optimizelyClient->projects()->listAll($page); |
260 | 260 | foreach ($projects as $project) { |
261 | - if ($project->getName()=="Test Project $curDate") { |
|
261 | + if ($project->getName() == "Test Project $curDate") { |
|
262 | 262 | $projectId = $project->getId(); |
263 | 263 | $found = true; |
264 | 264 | break; |
@@ -266,11 +266,11 @@ discard block |
||
266 | 266 | } |
267 | 267 | |
268 | 268 | } catch (\Exception $e) { |
269 | - if ($e->getCode()!=502) |
|
269 | + if ($e->getCode() != 502) |
|
270 | 270 | throw $e; |
271 | 271 | break; |
272 | 272 | } |
273 | - $page ++; |
|
273 | + $page++; |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | $this->assertTrue($projectFound); |
@@ -219,8 +219,9 @@ discard block |
||
219 | 219 | |
220 | 220 | public function testIntegration() |
221 | 221 | { |
222 | - if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) |
|
223 | - $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
222 | + if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) { |
|
223 | + $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
224 | + } |
|
224 | 225 | |
225 | 226 | $credentials = $this->loadCredentialsFromFile(); |
226 | 227 | |
@@ -266,8 +267,9 @@ discard block |
||
266 | 267 | } |
267 | 268 | |
268 | 269 | } catch (\Exception $e) { |
269 | - if ($e->getCode()!=502) |
|
270 | - throw $e; |
|
270 | + if ($e->getCode()!=502) { |
|
271 | + throw $e; |
|
272 | + } |
|
271 | 273 | break; |
272 | 274 | } |
273 | 275 | $page ++; |
@@ -13,47 +13,47 @@ discard block |
||
13 | 13 | "confidence_threshold" => 0, |
14 | 14 | "end_time" => "2016-10-14T05:08:42.966Z", |
15 | 15 | "metrics" => array( |
16 | - array( |
|
16 | + array( |
|
17 | 17 | "event" => "string", |
18 | 18 | "event_name" => "string", |
19 | 19 | "measure" => "conversions", |
20 | 20 | "metric_id" => "string", |
21 | 21 | "priority" => 0, |
22 | 22 | "results" => array( |
23 | - "campaign" => array( |
|
23 | + "campaign" => array( |
|
24 | 24 | "experiment_id" => 0, |
25 | 25 | "is_baseline" => true, |
26 | 26 | "lift" => array( |
27 | - "confidence_interval" => array( |
|
27 | + "confidence_interval" => array( |
|
28 | 28 | 0.010399560300730457, |
29 | 29 | 0.0850821459929161 |
30 | - ), |
|
31 | - "is_most_conclusive" => true, |
|
32 | - "is_significant" => true, |
|
33 | - "significance" => 0, |
|
34 | - "value" => 0, |
|
35 | - "visitors_remaining" => 0 |
|
30 | + ), |
|
31 | + "is_most_conclusive" => true, |
|
32 | + "is_significant" => true, |
|
33 | + "significance" => 0, |
|
34 | + "value" => 0, |
|
35 | + "visitors_remaining" => 0 |
|
36 | 36 | ), |
37 | 37 | "name" => "Blue Button", |
38 | 38 | "rate" => 0, |
39 | 39 | "scope" => "variation", |
40 | 40 | "total_increase" => array( |
41 | - "confidence_interval" => array( |
|
41 | + "confidence_interval" => array( |
|
42 | 42 | 0.010399560300730457, |
43 | 43 | 0.0850821459929161 |
44 | - ), |
|
45 | - "is_most_conclusive" => true, |
|
46 | - "is_significant" => true, |
|
47 | - "significance" => 0, |
|
48 | - "value" => 0, |
|
49 | - "visitors_remaining" => 0 |
|
44 | + ), |
|
45 | + "is_most_conclusive" => true, |
|
46 | + "is_significant" => true, |
|
47 | + "significance" => 0, |
|
48 | + "value" => 0, |
|
49 | + "visitors_remaining" => 0 |
|
50 | 50 | ), |
51 | 51 | "value" => 0, |
52 | 52 | "variation_id" => "string" |
53 | - ) |
|
53 | + ) |
|
54 | 54 | ), |
55 | 55 | "unit" => "session" |
56 | - ) |
|
56 | + ) |
|
57 | 57 | ), |
58 | 58 | "start_time" => "2016-10-14T05:08:42.967Z" |
59 | 59 | ); |
@@ -71,47 +71,47 @@ discard block |
||
71 | 71 | "confidence_threshold" => 0, |
72 | 72 | "end_time" => "2016-10-14T05:08:42.966Z", |
73 | 73 | "metrics" => array( |
74 | - array( |
|
74 | + array( |
|
75 | 75 | "event" => "string", |
76 | 76 | "event_name" => "string", |
77 | 77 | "measure" => "conversions", |
78 | 78 | "metric_id" => "string", |
79 | 79 | "priority" => 0, |
80 | 80 | "results" => array( |
81 | - "campaign" => array( |
|
81 | + "campaign" => array( |
|
82 | 82 | "experiment_id" => 0, |
83 | 83 | "is_baseline" => true, |
84 | 84 | "lift" => array( |
85 | - "confidence_interval" => array( |
|
85 | + "confidence_interval" => array( |
|
86 | 86 | 0.010399560300730457, |
87 | 87 | 0.0850821459929161 |
88 | - ), |
|
89 | - "is_most_conclusive" => true, |
|
90 | - "is_significant" => true, |
|
91 | - "significance" => 0, |
|
92 | - "value" => 0, |
|
93 | - "visitors_remaining" => 0 |
|
88 | + ), |
|
89 | + "is_most_conclusive" => true, |
|
90 | + "is_significant" => true, |
|
91 | + "significance" => 0, |
|
92 | + "value" => 0, |
|
93 | + "visitors_remaining" => 0 |
|
94 | 94 | ), |
95 | 95 | "name" => "Blue Button", |
96 | 96 | "rate" => 0, |
97 | 97 | "scope" => "variation", |
98 | 98 | "total_increase" => array( |
99 | - "confidence_interval" => array( |
|
99 | + "confidence_interval" => array( |
|
100 | 100 | 0.010399560300730457, |
101 | 101 | 0.0850821459929161 |
102 | - ), |
|
103 | - "is_most_conclusive" => true, |
|
104 | - "is_significant" => true, |
|
105 | - "significance" => 0, |
|
106 | - "value" => 0, |
|
107 | - "visitors_remaining" => 0 |
|
102 | + ), |
|
103 | + "is_most_conclusive" => true, |
|
104 | + "is_significant" => true, |
|
105 | + "significance" => 0, |
|
106 | + "value" => 0, |
|
107 | + "visitors_remaining" => 0 |
|
108 | 108 | ), |
109 | 109 | "value" => 0, |
110 | 110 | "variation_id" => "string" |
111 | - ) |
|
111 | + ) |
|
112 | 112 | ), |
113 | 113 | "unit" => "session" |
114 | - ) |
|
114 | + ) |
|
115 | 115 | ), |
116 | 116 | "start_time" => "2016-10-14T05:08:42.967Z" |
117 | 117 | ); |
@@ -59,38 +59,38 @@ discard block |
||
59 | 59 | $options = array( |
60 | 60 | "project_id" => 1000, |
61 | 61 | "changes" => array( |
62 | - array( |
|
62 | + array( |
|
63 | 63 | "type" => "custom_code", |
64 | 64 | "allow_additional_redirect" => true, |
65 | 65 | "async" => true, |
66 | 66 | "css_selector" => "a[href*=\"optimizely\"]", |
67 | 67 | "dependencies" => array( |
68 | - 24, |
|
69 | - 26 |
|
68 | + 24, |
|
69 | + 26 |
|
70 | 70 | ), |
71 | 71 | "destination" => "https://app.optimizely.com/", |
72 | 72 | "extension_id" => 1234, |
73 | 73 | "preserve_parameters" => true, |
74 | 74 | "src" => 524, |
75 | 75 | "value" => "window.someGlobalFunction();" |
76 | - ) |
|
76 | + ) |
|
77 | 77 | ), |
78 | 78 | "created" => "2016-10-14T05:08:42.822Z", |
79 | 79 | "earliest" => "2016-10-14T05:08:42.822Z", |
80 | 80 | "experiment_ids" => array( |
81 | - 0 |
|
81 | + 0 |
|
82 | 82 | ), |
83 | 83 | "holdback" => 0, |
84 | 84 | "last_modified" => "2016-10-14T05:08:42.822Z", |
85 | 85 | "latest" => "2016-10-14T05:08:42.822Z", |
86 | 86 | "metrics" => array( |
87 | - array( |
|
87 | + array( |
|
88 | 88 | "kind" => "string" |
89 | - ) |
|
89 | + ) |
|
90 | 90 | ), |
91 | 91 | "name" => "Landing Page Optimization", |
92 | 92 | "page_ids" => array( |
93 | - 0 |
|
93 | + 0 |
|
94 | 94 | ), |
95 | 95 | "status" => "active", |
96 | 96 | "type" => "a/b" |
@@ -112,38 +112,38 @@ discard block |
||
112 | 112 | $options = array( |
113 | 113 | "project_id" => 1000, |
114 | 114 | "changes" => array( |
115 | - array( |
|
115 | + array( |
|
116 | 116 | "type" => "custom_code", |
117 | 117 | "allow_additional_redirect" => true, |
118 | 118 | "async" => true, |
119 | 119 | "css_selector" => "a[href*=\"optimizely\"]", |
120 | 120 | "dependencies" => array( |
121 | - 24, |
|
122 | - 26 |
|
121 | + 24, |
|
122 | + 26 |
|
123 | 123 | ), |
124 | 124 | "destination" => "https://app.optimizely.com/", |
125 | 125 | "extension_id" => 1234, |
126 | 126 | "preserve_parameters" => true, |
127 | 127 | "src" => 524, |
128 | 128 | "value" => "window.someGlobalFunction();" |
129 | - ) |
|
129 | + ) |
|
130 | 130 | ), |
131 | 131 | "created" => "2016-10-14T05:08:42.822Z", |
132 | 132 | "earliest" => "2016-10-14T05:08:42.822Z", |
133 | 133 | "experiment_ids" => array( |
134 | - 0 |
|
134 | + 0 |
|
135 | 135 | ), |
136 | 136 | "holdback" => 0, |
137 | 137 | "last_modified" => "2016-10-14T05:08:42.822Z", |
138 | 138 | "latest" => "2016-10-14T05:08:42.822Z", |
139 | 139 | "metrics" => array( |
140 | - array( |
|
140 | + array( |
|
141 | 141 | "kind" => "string" |
142 | - ) |
|
142 | + ) |
|
143 | 143 | ), |
144 | 144 | "name" => "Landing Page Optimization", |
145 | 145 | "page_ids" => array( |
146 | - 0 |
|
146 | + 0 |
|
147 | 147 | ), |
148 | 148 | "status" => "active", |
149 | 149 | "type" => "a/b" |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | $audience->setConditions(array( |
15 | 15 | "and", |
16 | 16 | array( |
17 | - "value" => "es", |
|
18 | - "type" => "language" |
|
17 | + "value" => "es", |
|
18 | + "type" => "language" |
|
19 | 19 | ), |
20 | 20 | array( |
21 | - "value" => "US-CA-SANFRANCISCO", |
|
22 | - "type" => "location" |
|
21 | + "value" => "US-CA-SANFRANCISCO", |
|
22 | + "type" => "location" |
|
23 | 23 | ) |
24 | 24 | )); |
25 | 25 | $audience->setDescription('People that speak spanish and are in San Francisco'); |
@@ -46,15 +46,15 @@ discard block |
||
46 | 46 | "project_id" => 1000, |
47 | 47 | "archived" => false, |
48 | 48 | "conditions" => array( |
49 | - "and", |
|
50 | - array( |
|
49 | + "and", |
|
50 | + array( |
|
51 | 51 | "value" => "es", |
52 | 52 | "type" => "language" |
53 | - ), |
|
54 | - array( |
|
53 | + ), |
|
54 | + array( |
|
55 | 55 | "value" => "US-CA-SANFRANCISCO", |
56 | 56 | "type" => "location" |
57 | - ) |
|
57 | + ) |
|
58 | 58 | ), |
59 | 59 | "description" => "People that speak spanish and are in San Francisco", |
60 | 60 | "name" => "Spanish speaking San Franciscans", |
@@ -77,15 +77,15 @@ discard block |
||
77 | 77 | "project_id" => 1000, |
78 | 78 | "archived" => false, |
79 | 79 | "conditions" => array( |
80 | - "and", |
|
81 | - array( |
|
80 | + "and", |
|
81 | + array( |
|
82 | 82 | "value" => "es", |
83 | 83 | "type" => "language" |
84 | - ), |
|
85 | - array( |
|
84 | + ), |
|
85 | + array( |
|
86 | 86 | "value" => "US-CA-SANFRANCISCO", |
87 | 87 | "type" => "location" |
88 | - ) |
|
88 | + ) |
|
89 | 89 | ), |
90 | 90 | "description" => "People that speak spanish and are in San Francisco", |
91 | 91 | "name" => "Spanish speaking San Franciscans", |