@@ -39,17 +39,17 @@ discard block |
||
39 | 39 | * @return Result |
40 | 40 | * @throws Exception |
41 | 41 | */ |
42 | - public function listAll($projectId, $campaignId=null, $includeClassic=false, $page=1, $perPage=25) |
|
42 | + public function listAll($projectId, $campaignId = null, $includeClassic = false, $page = 1, $perPage = 25) |
|
43 | 43 | { |
44 | - if ($projectId==null && $campaignId==null) { |
|
44 | + if ($projectId == null && $campaignId == null) { |
|
45 | 45 | throw new Exception('Project ID or Campaign ID must be non-null'); |
46 | 46 | } |
47 | 47 | |
48 | - if ($page<0) { |
|
48 | + if ($page < 0) { |
|
49 | 49 | throw new Exception('Invalid page number passed'); |
50 | 50 | } |
51 | 51 | |
52 | - if ($perPage<0 || $perPage>100) { |
|
52 | + if ($perPage < 0 || $perPage > 100) { |
|
53 | 53 | throw new Exception('Invalid page size passed'); |
54 | 54 | } |
55 | 55 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | Exception::CODE_INVALID_ARG); |
86 | 86 | } |
87 | 87 | |
88 | - if ($experimentId<0) { |
|
88 | + if ($experimentId < 0) { |
|
89 | 89 | throw new Exception("A positive experiment ID expected"); |
90 | 90 | } |
91 | 91 | |
@@ -140,13 +140,13 @@ discard block |
||
140 | 140 | Exception::CODE_INVALID_ARG); |
141 | 141 | } |
142 | 142 | |
143 | - if ($action!=null && !is_string($action)) { |
|
143 | + if ($action != null && !is_string($action)) { |
|
144 | 144 | throw new Exception("Expected string or null action argument", |
145 | 145 | Exception::CODE_INVALID_ARG); |
146 | 146 | } |
147 | 147 | |
148 | 148 | $queryParams = array(); |
149 | - if ($action!=null) $queryParams['action'] = $action; |
|
149 | + if ($action != null) $queryParams['action'] = $action; |
|
150 | 150 | |
151 | 151 | $postData = $experiment->toArray(); |
152 | 152 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | throw new Exception("Expected argument of type Experiment"); |
175 | 175 | } |
176 | 176 | |
177 | - if ($experimentId<0) { |
|
177 | + if ($experimentId < 0) { |
|
178 | 178 | throw new Exception("Expected positive experiment ID argument"); |
179 | 179 | } |
180 | 180 |
@@ -146,7 +146,9 @@ |
||
146 | 146 | } |
147 | 147 | |
148 | 148 | $queryParams = array(); |
149 | - if ($action!=null) $queryParams['action'] = $action; |
|
149 | + if ($action!=null) { |
|
150 | + $queryParams['action'] = $action; |
|
151 | + } |
|
150 | 152 | |
151 | 153 | $postData = $experiment->toArray(); |
152 | 154 |
@@ -36,13 +36,13 @@ |
||
36 | 36 | * @return Result |
37 | 37 | * @throws Exception |
38 | 38 | */ |
39 | - public function listAll($projectId, $page=1, $perPage=25) |
|
39 | + public function listAll($projectId, $page = 1, $perPage = 25) |
|
40 | 40 | { |
41 | - if ($page<0) { |
|
41 | + if ($page < 0) { |
|
42 | 42 | throw new Exception('Invalid page number passed'); |
43 | 43 | } |
44 | 44 | |
45 | - if ($perPage<0 || $perPage>100) { |
|
45 | + if ($perPage < 0 || $perPage > 100) { |
|
46 | 46 | throw new Exception('Invalid page size passed'); |
47 | 47 | } |
48 | 48 |
@@ -61,41 +61,41 @@ discard block |
||
61 | 61 | $options = array( |
62 | 62 | "project_id" => 1000, |
63 | 63 | "changes" => array( |
64 | - array( |
|
64 | + array( |
|
65 | 65 | "type" => "custom_code", |
66 | 66 | "allow_additional_redirect" => true, |
67 | 67 | "async" => true, |
68 | 68 | "selector" => "a[href*=\"optimizely\"]", |
69 | 69 | "dependencies" => array( |
70 | - 24, |
|
71 | - 26 |
|
70 | + 24, |
|
71 | + 26 |
|
72 | 72 | ), |
73 | 73 | "destination" => "https://app.optimizely.com/", |
74 | 74 | "extension_id" => 1234, |
75 | 75 | "preserve_parameters" => true, |
76 | 76 | "src" => 524, |
77 | 77 | "value" => "window.someGlobalFunction();" |
78 | - ) |
|
78 | + ) |
|
79 | 79 | ), |
80 | 80 | "created" => "2016-10-14T05:08:42.822Z", |
81 | 81 | "earliest" => "2016-10-14T05:08:42.822Z", |
82 | 82 | "experiment_ids" => array( |
83 | - 0 |
|
83 | + 0 |
|
84 | 84 | ), |
85 | 85 | "holdback" => 0, |
86 | 86 | "last_modified" => "2016-10-14T05:08:42.822Z", |
87 | 87 | "latest" => "2016-10-14T05:08:42.822Z", |
88 | 88 | "metrics" => array( |
89 | - array( |
|
89 | + array( |
|
90 | 90 | "aggregator" => "unique", |
91 | 91 | "event_id" => 0, |
92 | 92 | "field" => "revenue", |
93 | 93 | "scope" => "session" |
94 | - ) |
|
94 | + ) |
|
95 | 95 | ), |
96 | 96 | "name" => "Landing Page Optimization", |
97 | 97 | "page_ids" => array( |
98 | - 0 |
|
98 | + 0 |
|
99 | 99 | ), |
100 | 100 | "status" => "active", |
101 | 101 | "type" => "a/b" |
@@ -117,41 +117,41 @@ discard block |
||
117 | 117 | $options = array( |
118 | 118 | "project_id" => 1000, |
119 | 119 | "changes" => array( |
120 | - array( |
|
120 | + array( |
|
121 | 121 | "type" => "custom_code", |
122 | 122 | "allow_additional_redirect" => true, |
123 | 123 | "async" => true, |
124 | 124 | "selector" => "a[href*=\"optimizely\"]", |
125 | 125 | "dependencies" => array( |
126 | - 24, |
|
127 | - 26 |
|
126 | + 24, |
|
127 | + 26 |
|
128 | 128 | ), |
129 | 129 | "destination" => "https://app.optimizely.com/", |
130 | 130 | "extension_id" => 1234, |
131 | 131 | "preserve_parameters" => true, |
132 | 132 | "src" => 524, |
133 | 133 | "value" => "window.someGlobalFunction();" |
134 | - ) |
|
134 | + ) |
|
135 | 135 | ), |
136 | 136 | "created" => "2016-10-14T05:08:42.822Z", |
137 | 137 | "earliest" => "2016-10-14T05:08:42.822Z", |
138 | 138 | "experiment_ids" => array( |
139 | - 0 |
|
139 | + 0 |
|
140 | 140 | ), |
141 | 141 | "holdback" => 0, |
142 | 142 | "last_modified" => "2016-10-14T05:08:42.822Z", |
143 | 143 | "latest" => "2016-10-14T05:08:42.822Z", |
144 | 144 | "metrics" => array( |
145 | - array( |
|
145 | + array( |
|
146 | 146 | "aggregator" => "unique", |
147 | 147 | "event_id" => 0, |
148 | 148 | "field" => "revenue", |
149 | 149 | "scope" => "session" |
150 | - ) |
|
150 | + ) |
|
151 | 151 | ), |
152 | 152 | "name" => "Landing Page Optimization", |
153 | 153 | "page_ids" => array( |
154 | - 0 |
|
154 | + 0 |
|
155 | 155 | ), |
156 | 156 | "status" => "active", |
157 | 157 | "type" => "a/b" |
@@ -113,14 +113,14 @@ discard block |
||
113 | 113 | $options = array( |
114 | 114 | "project_id" => 1000, |
115 | 115 | "audience_ids" => array( |
116 | - 1234, |
|
117 | - 1212, |
|
118 | - 1432 |
|
116 | + 1234, |
|
117 | + 1212, |
|
118 | + 1432 |
|
119 | 119 | ), |
120 | 120 | "campaign_id" => 2000, |
121 | 121 | "audience_conditions" => "[\"and\", {\"audience_id\": 7000}, {\"audience_id\":7001}]", |
122 | 122 | "changes" => array( |
123 | - array( |
|
123 | + array( |
|
124 | 124 | "type" => "custom_code", |
125 | 125 | "allow_additional_redirect" => true, |
126 | 126 | "async" => true, |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | "text" => "Some nice message" |
136 | 136 | ), |
137 | 137 | "dependencies" => array( |
138 | - 24, |
|
139 | - 26 |
|
138 | + 24, |
|
139 | + 26 |
|
140 | 140 | ), |
141 | 141 | "destination" => "https://app.optimizely.com/", |
142 | 142 | "extension_id" => 1234, |
@@ -145,57 +145,57 @@ discard block |
||
145 | 145 | "selector" => "a[href*=\"optimizely\"]", |
146 | 146 | "src" => 524, |
147 | 147 | "value" => "window.someGlobalFunction();" |
148 | - ) |
|
148 | + ) |
|
149 | 149 | ), |
150 | 150 | "type" => "a/b", |
151 | 151 | "description" => "string", |
152 | 152 | "holdback" => 5000, |
153 | 153 | "key" => "home_page_experiment", |
154 | 154 | "metrics" => array( |
155 | - array( |
|
155 | + array( |
|
156 | 156 | "aggregator" => "unique", |
157 | 157 | "event_id" => 0, |
158 | 158 | "field" => "revenue", |
159 | 159 | "scope" => "session" |
160 | - ) |
|
160 | + ) |
|
161 | 161 | ), |
162 | 162 | "name" => "Blue Button Experiment", |
163 | 163 | "schedule" => array( |
164 | - "start_time" => "2016-10-14T05:08:42.850Z", |
|
165 | - "stop_time" => "2016-10-14T05:08:42.850Z", |
|
166 | - "time_zone" => "UTC" |
|
164 | + "start_time" => "2016-10-14T05:08:42.850Z", |
|
165 | + "stop_time" => "2016-10-14T05:08:42.850Z", |
|
166 | + "time_zone" => "UTC" |
|
167 | 167 | ), |
168 | 168 | "status" => "active", |
169 | 169 | "variations" => array( |
170 | - array( |
|
170 | + array( |
|
171 | 171 | "actions" => array( |
172 | - array( |
|
172 | + array( |
|
173 | 173 | "changes" => array( |
174 | - array( |
|
174 | + array( |
|
175 | 175 | "type" => "custom_code", |
176 | 176 | "allow_additional_redirect" => true, |
177 | 177 | "async" => true, |
178 | 178 | "selector" => "a[href*=\"optimizely\"]", |
179 | 179 | "dependencies" => array( |
180 | - 24, |
|
181 | - 26 |
|
180 | + 24, |
|
181 | + 26 |
|
182 | 182 | ), |
183 | 183 | "destination" => "https://app.optimizely.com/", |
184 | 184 | "extension_id" => 1234, |
185 | 185 | "preserve_parameters" => true, |
186 | 186 | "src" => 524, |
187 | 187 | "value" => "window.someGlobalFunction();" |
188 | - ) |
|
188 | + ) |
|
189 | 189 | ), |
190 | 190 | "page_id" => 0 |
191 | - ) |
|
191 | + ) |
|
192 | 192 | ), |
193 | 193 | "archived" => true, |
194 | 194 | "key" => "blue_button_variation", |
195 | 195 | "name" => "Blue Button", |
196 | 196 | "variation_id" => 0, |
197 | 197 | "weight" => 0, |
198 | - ) |
|
198 | + ) |
|
199 | 199 | ) |
200 | 200 | ); |
201 | 201 | |
@@ -210,13 +210,13 @@ discard block |
||
210 | 210 | $options = array( |
211 | 211 | "project_id" => 1000, |
212 | 212 | "audience_ids" => array( |
213 | - 1234, |
|
214 | - 1212, |
|
215 | - 1432 |
|
213 | + 1234, |
|
214 | + 1212, |
|
215 | + 1432 |
|
216 | 216 | ), |
217 | 217 | "campaign_id" => 2000, |
218 | 218 | "changes" => array( |
219 | - array( |
|
219 | + array( |
|
220 | 220 | "type" => "custom_code", |
221 | 221 | "allow_additional_redirect" => true, |
222 | 222 | "async" => true, |
@@ -232,64 +232,64 @@ discard block |
||
232 | 232 | ), |
233 | 233 | "selector" => "a[href*=\"optimizely\"]", |
234 | 234 | "dependencies" => array( |
235 | - 24, |
|
236 | - 26 |
|
235 | + 24, |
|
236 | + 26 |
|
237 | 237 | ), |
238 | 238 | "destination" => "https://app.optimizely.com/", |
239 | 239 | "extension_id" => 1234, |
240 | 240 | "preserve_parameters" => true, |
241 | 241 | "src" => 524, |
242 | 242 | "value" => "window.someGlobalFunction();" |
243 | - ) |
|
243 | + ) |
|
244 | 244 | ), |
245 | 245 | "description" => "string", |
246 | 246 | "holdback" => 5000, |
247 | 247 | "key" => "home_page_experiment", |
248 | 248 | "metrics" => array( |
249 | - array( |
|
249 | + array( |
|
250 | 250 | "aggregator" => "unique", |
251 | 251 | "event_id" => 0, |
252 | 252 | "field" => "revenue", |
253 | 253 | "scope" => "session" |
254 | - ) |
|
254 | + ) |
|
255 | 255 | ), |
256 | 256 | "name" => "Blue Button Experiment", |
257 | 257 | "schedule" => array( |
258 | - "start_time" => "2016-10-14T05:08:42.850Z", |
|
259 | - "stop_time" => "2016-10-14T05:08:42.850Z", |
|
260 | - "time_zone" => "UTC" |
|
258 | + "start_time" => "2016-10-14T05:08:42.850Z", |
|
259 | + "stop_time" => "2016-10-14T05:08:42.850Z", |
|
260 | + "time_zone" => "UTC" |
|
261 | 261 | ), |
262 | 262 | "status" => "active", |
263 | 263 | "variations" => array( |
264 | - array( |
|
264 | + array( |
|
265 | 265 | "actions" => array( |
266 | - array( |
|
266 | + array( |
|
267 | 267 | "changes" => array( |
268 | - array( |
|
268 | + array( |
|
269 | 269 | "type" => "custom_code", |
270 | 270 | "allow_additional_redirect" => true, |
271 | 271 | "async" => true, |
272 | 272 | "selector" => "a[href*=\"optimizely\"]", |
273 | 273 | "dependencies" => array( |
274 | - 24, |
|
275 | - 26 |
|
274 | + 24, |
|
275 | + 26 |
|
276 | 276 | ), |
277 | 277 | "destination" => "https://app.optimizely.com/", |
278 | 278 | "extension_id" => 1234, |
279 | 279 | "preserve_parameters" => true, |
280 | 280 | "src" => 524, |
281 | 281 | "value" => "window.someGlobalFunction();" |
282 | - ) |
|
282 | + ) |
|
283 | 283 | ), |
284 | 284 | "page_id" => 0 |
285 | - ) |
|
285 | + ) |
|
286 | 286 | ), |
287 | 287 | "archived" => true, |
288 | 288 | "key" => "blue_button_variation", |
289 | 289 | "name" => "Blue Button", |
290 | 290 | "variation_id" => 0, |
291 | 291 | "weight" => 0 |
292 | - ) |
|
292 | + ) |
|
293 | 293 | ) |
294 | 294 | ); |
295 | 295 |
@@ -86,15 +86,15 @@ discard block |
||
86 | 86 | "project_id" => 1000, |
87 | 87 | "archived" => false, |
88 | 88 | "conditions" => array( |
89 | - "and", |
|
90 | - array( |
|
89 | + "and", |
|
90 | + array( |
|
91 | 91 | "type" => "language", |
92 | 92 | "value" => "es" |
93 | - ), |
|
94 | - array( |
|
93 | + ), |
|
94 | + array( |
|
95 | 95 | "type" => "location", |
96 | 96 | "value" => "US-CA-SANFRANCISCO" |
97 | - ) |
|
97 | + ) |
|
98 | 98 | ), |
99 | 99 | "description" => "People that speak spanish and are in San Francisco", |
100 | 100 | "name" => "Spanish speaking San Franciscans", |
@@ -127,15 +127,15 @@ discard block |
||
127 | 127 | "project_id" => 1000, |
128 | 128 | "archived" => false, |
129 | 129 | "conditions" => array( |
130 | - "and", |
|
131 | - array( |
|
130 | + "and", |
|
131 | + array( |
|
132 | 132 | "type" => "language", |
133 | 133 | "value" => "es" |
134 | - ), |
|
135 | - array( |
|
134 | + ), |
|
135 | + array( |
|
136 | 136 | "type" => "location", |
137 | 137 | "value" => "US-CA-SANFRANCISCO" |
138 | - ) |
|
138 | + ) |
|
139 | 139 | ), |
140 | 140 | "description" => "People that speak spanish and are in San Francisco", |
141 | 141 | "name" => "Spanish speaking San Franciscans", |
@@ -154,15 +154,15 @@ discard block |
||
154 | 154 | "project_id" => 1000, |
155 | 155 | "archived" => false, |
156 | 156 | "conditions" => array( |
157 | - "and", |
|
158 | - array( |
|
157 | + "and", |
|
158 | + array( |
|
159 | 159 | "type" => "language", |
160 | 160 | "value" => "es" |
161 | - ), |
|
162 | - array( |
|
161 | + ), |
|
162 | + array( |
|
163 | 163 | "type" => "location", |
164 | 164 | "value" => "US-CA-SANFRANCISCO" |
165 | - ) |
|
165 | + ) |
|
166 | 166 | ), |
167 | 167 | "description" => "People that speak spanish and are in San Francisco", |
168 | 168 | "name" => "Spanish speaking San Franciscans", |
@@ -187,15 +187,15 @@ discard block |
||
187 | 187 | "project_id" => 1000, |
188 | 188 | "archived" => false, |
189 | 189 | "conditions" => array( |
190 | - "and", |
|
191 | - array( |
|
190 | + "and", |
|
191 | + array( |
|
192 | 192 | "type" => "language", |
193 | 193 | "value" => "es" |
194 | - ), |
|
195 | - array( |
|
194 | + ), |
|
195 | + array( |
|
196 | 196 | "type" => "location", |
197 | 197 | "value" => "US-CA-SANFRANCISCO" |
198 | - ) |
|
198 | + ) |
|
199 | 199 | ), |
200 | 200 | "description" => "People that speak spanish and are in San Francisco", |
201 | 201 | "name" => "Spanish speaking San Franciscans", |
@@ -214,15 +214,15 @@ discard block |
||
214 | 214 | "project_id" => 1000, |
215 | 215 | "archived" => false, |
216 | 216 | "conditions" => array( |
217 | - "and", |
|
218 | - array( |
|
217 | + "and", |
|
218 | + array( |
|
219 | 219 | "type" => "language", |
220 | 220 | "value" => "es" |
221 | - ), |
|
222 | - array( |
|
221 | + ), |
|
222 | + array( |
|
223 | 223 | "type" => "location", |
224 | 224 | "value" => "US-CA-SANFRANCISCO" |
225 | - ) |
|
225 | + ) |
|
226 | 226 | ), |
227 | 227 | "description" => "People that speak spanish and are in San Francisco", |
228 | 228 | "name" => "Spanish speaking San Franciscans", |
@@ -255,14 +255,14 @@ discard block |
||
255 | 255 | "platform" => "web", |
256 | 256 | "status" => "active", |
257 | 257 | "web_snippet" => array( |
258 | - "enable_force_variation" => false, |
|
259 | - "exclude_disabled_experiments" => false, |
|
260 | - "exclude_names" => true, |
|
261 | - "include_jquery" => true, |
|
262 | - "ip_anonymization" => false, |
|
263 | - "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
264 | - "library" => "jquery-1.11.3-trim", |
|
265 | - "project_javascript" => "alert(\"Active Experiment\")" |
|
258 | + "enable_force_variation" => false, |
|
259 | + "exclude_disabled_experiments" => false, |
|
260 | + "exclude_names" => true, |
|
261 | + "include_jquery" => true, |
|
262 | + "ip_anonymization" => false, |
|
263 | + "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
264 | + "library" => "jquery-1.11.3-trim", |
|
265 | + "project_javascript" => "alert(\"Active Experiment\")" |
|
266 | 266 | ) |
267 | 267 | )); |
268 | 268 |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | $result = $audiencesService->listAll(1000); |
41 | 41 | $audiences = $result->getPayload(); |
42 | 42 | |
43 | - $this->assertTrue(count($audiences)==1); |
|
43 | + $this->assertTrue(count($audiences) == 1); |
|
44 | 44 | $this->assertTrue($audiences[0] instanceOf Audience); |
45 | - $this->assertTrue($audiences[0]->getName()=='Spanish speaking San Franciscans'); |
|
45 | + $this->assertTrue($audiences[0]->getName() == 'Spanish speaking San Franciscans'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $audience = $result->getPayload(); |
114 | 114 | |
115 | 115 | $this->assertTrue($audience instanceOf Audience); |
116 | - $this->assertTrue($audience->getName()=='Spanish speaking San Franciscans'); |
|
116 | + $this->assertTrue($audience->getName() == 'Spanish speaking San Franciscans'); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | public function testCreate() |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $createdAudience = $result->getPayload(); |
174 | 174 | |
175 | 175 | $this->assertTrue($createdAudience instanceOf Audience); |
176 | - $this->assertTrue($createdAudience->getName()=='Spanish speaking San Franciscans'); |
|
176 | + $this->assertTrue($createdAudience->getName() == 'Spanish speaking San Franciscans'); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | public function testUpdate() |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $createdAudience = $result->getPayload(); |
234 | 234 | |
235 | 235 | $this->assertTrue($createdAudience instanceOf Audience); |
236 | - $this->assertTrue($createdAudience->getName()=='Spanish speaking San Franciscans'); |
|
236 | + $this->assertTrue($createdAudience->getName() == 'Spanish speaking San Franciscans'); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | public function testIntegration() |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $credentials = $this->loadCredentialsFromFile(); |
245 | 245 | |
246 | 246 | $optimizelyClient = new OptimizelyApiClient($credentials, 'v2'); |
247 | - $this->assertTrue($optimizelyClient!=null); |
|
247 | + $this->assertTrue($optimizelyClient != null); |
|
248 | 248 | |
249 | 249 | // Create new project |
250 | 250 | $curDate = date('Y-m-d H:i:s'); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | $createdAudience = $result->getPayload(); |
284 | 284 | |
285 | 285 | $this->assertTrue($createdAudience instanceOf Audience); |
286 | - $this->assertTrue($createdAudience->getName()=='Spanish speaking San Franciscans'); |
|
286 | + $this->assertTrue($createdAudience->getName() == 'Spanish speaking San Franciscans'); |
|
287 | 287 | |
288 | 288 | // List all existing audiences and try to find the created audience |
289 | 289 | $audienceFound = false; |
@@ -295,16 +295,16 @@ discard block |
||
295 | 295 | $audiences = $result->getPayload(); |
296 | 296 | |
297 | 297 | foreach ($audiences as $audience) { |
298 | - if ($audience->getName()=="Spanish speaking San Franciscans") { |
|
298 | + if ($audience->getName() == "Spanish speaking San Franciscans") { |
|
299 | 299 | $audienceFound = true; |
300 | 300 | break; |
301 | 301 | } |
302 | 302 | } |
303 | 303 | |
304 | - if ($result->getNextPage()==null) |
|
304 | + if ($result->getNextPage() == null) |
|
305 | 305 | break; |
306 | 306 | |
307 | - $page ++; |
|
307 | + $page++; |
|
308 | 308 | } |
309 | 309 | } |
310 | 310 | catch (Exception $e) { |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | $updatedAudience = $result->getPayload(); |
325 | 325 | |
326 | 326 | $this->assertTrue($updatedAudience instanceOf Audience); |
327 | - $this->assertTrue($updatedAudience->getName()=='Some new audience name'); |
|
327 | + $this->assertTrue($updatedAudience->getName() == 'Some new audience name'); |
|
328 | 328 | |
329 | 329 | // Make project archived |
330 | 330 |
@@ -238,8 +238,9 @@ discard block |
||
238 | 238 | |
239 | 239 | public function testIntegration() |
240 | 240 | { |
241 | - if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) |
|
242 | - $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
241 | + if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) { |
|
242 | + $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
243 | + } |
|
243 | 244 | |
244 | 245 | $credentials = $this->loadCredentialsFromFile(); |
245 | 246 | |
@@ -301,13 +302,13 @@ discard block |
||
301 | 302 | } |
302 | 303 | } |
303 | 304 | |
304 | - if ($result->getNextPage()==null) |
|
305 | - break; |
|
305 | + if ($result->getNextPage()==null) { |
|
306 | + break; |
|
307 | + } |
|
306 | 308 | |
307 | 309 | $page ++; |
308 | 310 | } |
309 | - } |
|
310 | - catch (Exception $e) { |
|
311 | + } catch (Exception $e) { |
|
311 | 312 | // Handle error. |
312 | 313 | $code = $e->getCode(); |
313 | 314 | $httpCode = $e->getHttpCode(); |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | array( |
24 | 24 | "project_id" => 1000, |
25 | 25 | "changes" => array( |
26 | - array( |
|
26 | + array( |
|
27 | 27 | "type" => "custom_code", |
28 | 28 | "allow_additional_redirect" => true, |
29 | 29 | "async" => true, |
30 | 30 | "selector" => "a[href*=\"optimizely\"]", |
31 | 31 | "dependencies" => array( |
32 | - 24, |
|
33 | - 26 |
|
32 | + 24, |
|
33 | + 26 |
|
34 | 34 | ), |
35 | 35 | "destination" => "https://app.optimizely.com/", |
36 | 36 | "extension_id" => 1234, |
@@ -38,32 +38,32 @@ discard block |
||
38 | 38 | "src" => 524, |
39 | 39 | "value" => "window.someGlobalFunction();", |
40 | 40 | "id" => "string" |
41 | - ) |
|
41 | + ) |
|
42 | 42 | ), |
43 | 43 | "created" => "2016-10-18T03:27:04.123Z", |
44 | 44 | "earliest" => "2016-10-18T03:27:04.123Z", |
45 | 45 | "experiment_ids" => array( |
46 | - 0 |
|
46 | + 0 |
|
47 | 47 | ), |
48 | 48 | "holdback" => 0, |
49 | 49 | "last_modified" => "2016-10-18T03:27:04.123Z", |
50 | 50 | "latest" => "2016-10-18T03:27:04.123Z", |
51 | 51 | "metrics" => array( |
52 | - array( |
|
52 | + array( |
|
53 | 53 | "aggregator" => "unique", |
54 | 54 | "event_id" => 0, |
55 | 55 | "field" => "revenue", |
56 | 56 | "scope" => "session" |
57 | - ) |
|
57 | + ) |
|
58 | 58 | ), |
59 | 59 | "name" => "Landing Page Optimization", |
60 | 60 | "page_ids" => array( |
61 | - 0 |
|
61 | + 0 |
|
62 | 62 | ), |
63 | 63 | "status" => "active", |
64 | 64 | "type" => "a/b", |
65 | 65 | "id" => 2000 |
66 | - ) |
|
66 | + ) |
|
67 | 67 | ), 200); |
68 | 68 | |
69 | 69 | $optimizelyApiClientMock->method('sendApiRequest') |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | $result = new Result(array( |
120 | 120 | "project_id" => 1000, |
121 | 121 | "changes" => array( |
122 | - array( |
|
122 | + array( |
|
123 | 123 | "type" => "custom_code", |
124 | 124 | "allow_additional_redirect" => true, |
125 | 125 | "async" => true, |
126 | 126 | "selector" => "a[href*=\"optimizely\"]", |
127 | 127 | "dependencies" => array( |
128 | - 24, |
|
129 | - 26 |
|
128 | + 24, |
|
129 | + 26 |
|
130 | 130 | ), |
131 | 131 | "destination" => "https://app.optimizely.com/", |
132 | 132 | "extension_id" => 1234, |
@@ -134,27 +134,27 @@ discard block |
||
134 | 134 | "src" => 524, |
135 | 135 | "value" => "window.someGlobalFunction();", |
136 | 136 | "id" => "string" |
137 | - ) |
|
137 | + ) |
|
138 | 138 | ), |
139 | 139 | "created" => "2016-10-18T03:27:04.139Z", |
140 | 140 | "earliest" => "2016-10-18T03:27:04.139Z", |
141 | 141 | "experiment_ids" => array( |
142 | - 0 |
|
142 | + 0 |
|
143 | 143 | ), |
144 | 144 | "holdback" => 0, |
145 | 145 | "last_modified" => "2016-10-18T03:27:04.139Z", |
146 | 146 | "latest" => "2016-10-18T03:27:04.139Z", |
147 | 147 | "metrics" => array( |
148 | - array( |
|
148 | + array( |
|
149 | 149 | "aggregator" => "unique", |
150 | 150 | "event_id" => 0, |
151 | 151 | "field" => "revenue", |
152 | 152 | "scope" => "session" |
153 | - ) |
|
153 | + ) |
|
154 | 154 | ), |
155 | 155 | "name" => "Landing Page Optimization", |
156 | 156 | "page_ids" => array( |
157 | - 0 |
|
157 | + 0 |
|
158 | 158 | ), |
159 | 159 | "status" => "active", |
160 | 160 | "type" => "a/b", |
@@ -185,47 +185,47 @@ discard block |
||
185 | 185 | "confidence_threshold" => 0, |
186 | 186 | "end_time" => "2016-10-18T03:27:04.147Z", |
187 | 187 | "metrics" => array( |
188 | - array( |
|
188 | + array( |
|
189 | 189 | "event" => "string", |
190 | 190 | "event_name" => "string", |
191 | 191 | "measure" => "conversions", |
192 | 192 | "metric_id" => "string", |
193 | 193 | "priority" => 0, |
194 | 194 | "results" => array( |
195 | - "campaign" => array( |
|
195 | + "campaign" => array( |
|
196 | 196 | "experiment_id" => 0, |
197 | 197 | "is_baseline" => true, |
198 | 198 | "lift" => array( |
199 | - "confidence_interval" => array( |
|
199 | + "confidence_interval" => array( |
|
200 | 200 | 0.010399560300730457, |
201 | 201 | 0.0850821459929161 |
202 | - ), |
|
203 | - "is_most_conclusive" => true, |
|
204 | - "is_significant" => true, |
|
205 | - "significance" => 0, |
|
206 | - "value" => 0, |
|
207 | - "visitors_remaining" => 0 |
|
202 | + ), |
|
203 | + "is_most_conclusive" => true, |
|
204 | + "is_significant" => true, |
|
205 | + "significance" => 0, |
|
206 | + "value" => 0, |
|
207 | + "visitors_remaining" => 0 |
|
208 | 208 | ), |
209 | 209 | "name" => "Blue Button", |
210 | 210 | "rate" => 0, |
211 | 211 | "scope" => "variation", |
212 | 212 | "total_increase" => array( |
213 | - "confidence_interval" => array( |
|
213 | + "confidence_interval" => array( |
|
214 | 214 | 0.010399560300730457, |
215 | 215 | 0.0850821459929161 |
216 | - ), |
|
217 | - "is_most_conclusive" => true, |
|
218 | - "is_significant" => true, |
|
219 | - "significance" => 0, |
|
220 | - "value" => 0, |
|
221 | - "visitors_remaining" => 0 |
|
216 | + ), |
|
217 | + "is_most_conclusive" => true, |
|
218 | + "is_significant" => true, |
|
219 | + "significance" => 0, |
|
220 | + "value" => 0, |
|
221 | + "visitors_remaining" => 0 |
|
222 | 222 | ), |
223 | 223 | "value" => 0, |
224 | 224 | "variation_id" => "string" |
225 | - ) |
|
225 | + ) |
|
226 | 226 | ), |
227 | 227 | "unit" => "session" |
228 | - ) |
|
228 | + ) |
|
229 | 229 | ), |
230 | 230 | "start_time" => "2016-10-18T03:27:04.148Z" |
231 | 231 | ), 200); |
@@ -253,14 +253,14 @@ discard block |
||
253 | 253 | $result = new Result(array( |
254 | 254 | "project_id" => 1000, |
255 | 255 | "changes" => array( |
256 | - array( |
|
256 | + array( |
|
257 | 257 | "type" => "custom_code", |
258 | 258 | "allow_additional_redirect" => true, |
259 | 259 | "async" => true, |
260 | 260 | "selector" => "a[href*=\"optimizely\"]", |
261 | 261 | "dependencies" => array( |
262 | - 24, |
|
263 | - 26 |
|
262 | + 24, |
|
263 | + 26 |
|
264 | 264 | ), |
265 | 265 | "destination" => "https://app.optimizely.com/", |
266 | 266 | "extension_id" => 1234, |
@@ -268,27 +268,27 @@ discard block |
||
268 | 268 | "src" => 524, |
269 | 269 | "value" => "window.someGlobalFunction();", |
270 | 270 | "id" => "string" |
271 | - ) |
|
271 | + ) |
|
272 | 272 | ), |
273 | 273 | "created" => "2016-10-18T03:27:04.155Z", |
274 | 274 | "earliest" => "2016-10-18T03:27:04.155Z", |
275 | 275 | "experiment_ids" => array( |
276 | - 0 |
|
276 | + 0 |
|
277 | 277 | ), |
278 | 278 | "holdback" => 0, |
279 | 279 | "last_modified" => "2016-10-18T03:27:04.155Z", |
280 | 280 | "latest" => "2016-10-18T03:27:04.155Z", |
281 | 281 | "metrics" => array( |
282 | - array( |
|
282 | + array( |
|
283 | 283 | "aggregator" => "unique", |
284 | 284 | "event_id" => 0, |
285 | 285 | "field" => "revenue", |
286 | 286 | "scope" => "session" |
287 | - ) |
|
287 | + ) |
|
288 | 288 | ), |
289 | 289 | "name" => "Landing Page Optimization", |
290 | 290 | "page_ids" => array( |
291 | - 0 |
|
291 | + 0 |
|
292 | 292 | ), |
293 | 293 | "status" => "active", |
294 | 294 | "type" => "a/b", |
@@ -303,41 +303,41 @@ discard block |
||
303 | 303 | $campaign = new Campaign(array( |
304 | 304 | "project_id" => 1000, |
305 | 305 | "changes" => array( |
306 | - array( |
|
306 | + array( |
|
307 | 307 | "type" => "custom_code", |
308 | 308 | "allow_additional_redirect" => true, |
309 | 309 | "async" => true, |
310 | 310 | "selector" => "a[href*=\"optimizely\"]", |
311 | 311 | "dependencies" => array( |
312 | - 24, |
|
313 | - 26 |
|
312 | + 24, |
|
313 | + 26 |
|
314 | 314 | ), |
315 | 315 | "destination" => "https://app.optimizely.com/", |
316 | 316 | "extension_id" => 1234, |
317 | 317 | "preserve_parameters" => true, |
318 | 318 | "src" => 524, |
319 | 319 | "value" => "window.someGlobalFunction();" |
320 | - ) |
|
320 | + ) |
|
321 | 321 | ), |
322 | 322 | "created" => "2016-10-18T03:27:04.067Z", |
323 | 323 | "earliest" => "2016-10-18T03:27:04.067Z", |
324 | 324 | "experiment_ids" => array( |
325 | - 0 |
|
325 | + 0 |
|
326 | 326 | ), |
327 | 327 | "holdback" => 0, |
328 | 328 | "last_modified" => "2016-10-18T03:27:04.067Z", |
329 | 329 | "latest" => "2016-10-18T03:27:04.067Z", |
330 | 330 | "metrics" => array( |
331 | - array( |
|
331 | + array( |
|
332 | 332 | "aggregator" => "unique", |
333 | 333 | "event_id" => 0, |
334 | 334 | "field" => "revenue", |
335 | 335 | "scope" => "session" |
336 | - ) |
|
336 | + ) |
|
337 | 337 | ), |
338 | 338 | "name" => "Landing Page Optimization", |
339 | 339 | "page_ids" => array( |
340 | - 0 |
|
340 | + 0 |
|
341 | 341 | ), |
342 | 342 | "status" => "active", |
343 | 343 | "type" => "a/b" |
@@ -360,14 +360,14 @@ discard block |
||
360 | 360 | $result = new Result(array( |
361 | 361 | "project_id" => 1000, |
362 | 362 | "changes" => array( |
363 | - array( |
|
363 | + array( |
|
364 | 364 | "type" => "custom_code", |
365 | 365 | "allow_additional_redirect" => true, |
366 | 366 | "async" => true, |
367 | 367 | "selector" => "a[href*=\"optimizely\"]", |
368 | 368 | "dependencies" => array( |
369 | - 24, |
|
370 | - 26 |
|
369 | + 24, |
|
370 | + 26 |
|
371 | 371 | ), |
372 | 372 | "destination" => "https://app.optimizely.com/", |
373 | 373 | "extension_id" => 1234, |
@@ -375,27 +375,27 @@ discard block |
||
375 | 375 | "src" => 524, |
376 | 376 | "value" => "window.someGlobalFunction();", |
377 | 377 | "id" => "string" |
378 | - ) |
|
378 | + ) |
|
379 | 379 | ), |
380 | 380 | "created" => "2016-10-18T03:27:04.155Z", |
381 | 381 | "earliest" => "2016-10-18T03:27:04.155Z", |
382 | 382 | "experiment_ids" => array( |
383 | - 0 |
|
383 | + 0 |
|
384 | 384 | ), |
385 | 385 | "holdback" => 0, |
386 | 386 | "last_modified" => "2016-10-18T03:27:04.155Z", |
387 | 387 | "latest" => "2016-10-18T03:27:04.155Z", |
388 | 388 | "metrics" => array( |
389 | - array( |
|
389 | + array( |
|
390 | 390 | "aggregator" => "unique", |
391 | 391 | "event_id" => 0, |
392 | 392 | "field" => "revenue", |
393 | 393 | "scope" => "session" |
394 | - ) |
|
394 | + ) |
|
395 | 395 | ), |
396 | 396 | "name" => "Landing Page Optimization", |
397 | 397 | "page_ids" => array( |
398 | - 0 |
|
398 | + 0 |
|
399 | 399 | ), |
400 | 400 | "status" => "active", |
401 | 401 | "type" => "a/b", |
@@ -410,41 +410,41 @@ discard block |
||
410 | 410 | $campaign = new Campaign(array( |
411 | 411 | "project_id" => 1000, |
412 | 412 | "changes" => array( |
413 | - array( |
|
413 | + array( |
|
414 | 414 | "type" => "custom_code", |
415 | 415 | "allow_additional_redirect" => true, |
416 | 416 | "async" => true, |
417 | 417 | "selector" => "a[href*=\"optimizely\"]", |
418 | 418 | "dependencies" => array( |
419 | - 24, |
|
420 | - 26 |
|
419 | + 24, |
|
420 | + 26 |
|
421 | 421 | ), |
422 | 422 | "destination" => "https://app.optimizely.com/", |
423 | 423 | "extension_id" => 1234, |
424 | 424 | "preserve_parameters" => true, |
425 | 425 | "src" => 524, |
426 | 426 | "value" => "window.someGlobalFunction();" |
427 | - ) |
|
427 | + ) |
|
428 | 428 | ), |
429 | 429 | "created" => "2016-10-18T03:27:04.067Z", |
430 | 430 | "earliest" => "2016-10-18T03:27:04.067Z", |
431 | 431 | "experiment_ids" => array( |
432 | - 0 |
|
432 | + 0 |
|
433 | 433 | ), |
434 | 434 | "holdback" => 0, |
435 | 435 | "last_modified" => "2016-10-18T03:27:04.067Z", |
436 | 436 | "latest" => "2016-10-18T03:27:04.067Z", |
437 | 437 | "metrics" => array( |
438 | - array( |
|
438 | + array( |
|
439 | 439 | "aggregator" => "unique", |
440 | 440 | "event_id" => 0, |
441 | 441 | "field" => "revenue", |
442 | 442 | "scope" => "session" |
443 | - ) |
|
443 | + ) |
|
444 | 444 | ), |
445 | 445 | "name" => "Landing Page Optimization", |
446 | 446 | "page_ids" => array( |
447 | - 0 |
|
447 | + 0 |
|
448 | 448 | ), |
449 | 449 | "status" => "active", |
450 | 450 | "type" => "a/b" |
@@ -496,14 +496,14 @@ discard block |
||
496 | 496 | "platform" => "web", |
497 | 497 | "status" => "active", |
498 | 498 | "web_snippet" => array( |
499 | - "enable_force_variation" => false, |
|
500 | - "exclude_disabled_experiments" => false, |
|
501 | - "exclude_names" => true, |
|
502 | - "include_jquery" => true, |
|
503 | - "ip_anonymization" => false, |
|
504 | - "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
505 | - "library" => "jquery-1.11.3-trim", |
|
506 | - "project_javascript" => "alert(\"Active Experiment\")" |
|
499 | + "enable_force_variation" => false, |
|
500 | + "exclude_disabled_experiments" => false, |
|
501 | + "exclude_names" => true, |
|
502 | + "include_jquery" => true, |
|
503 | + "ip_anonymization" => false, |
|
504 | + "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
505 | + "library" => "jquery-1.11.3-trim", |
|
506 | + "project_javascript" => "alert(\"Active Experiment\")" |
|
507 | 507 | ) |
508 | 508 | )); |
509 | 509 | |
@@ -514,30 +514,30 @@ discard block |
||
514 | 514 | $campaign = new Campaign(array( |
515 | 515 | "project_id" => $createdProject->getId(), |
516 | 516 | "changes" => array( |
517 | - array( |
|
517 | + array( |
|
518 | 518 | "type" => "custom_code", |
519 | 519 | "value" => "window.someGlobalFunction();" |
520 | - ) |
|
520 | + ) |
|
521 | 521 | ), |
522 | 522 | "created" => "2016-10-18T03:27:04.067Z", |
523 | 523 | "earliest" => "2016-10-18T03:27:04.067Z", |
524 | 524 | "experiment_ids" => array( |
525 | - 0 |
|
525 | + 0 |
|
526 | 526 | ), |
527 | 527 | "holdback" => 0, |
528 | 528 | "last_modified" => "2016-10-18T03:27:04.067Z", |
529 | 529 | "latest" => "2016-10-18T03:27:04.067Z", |
530 | 530 | "metrics" => array( |
531 | - array( |
|
531 | + array( |
|
532 | 532 | "aggregator" => "unique", |
533 | 533 | "event_id" => 0, |
534 | 534 | "field" => "revenue", |
535 | 535 | "scope" => "session" |
536 | - ) |
|
536 | + ) |
|
537 | 537 | ), |
538 | 538 | "name" => "Landing Page Optimization", |
539 | 539 | "page_ids" => array( |
540 | - 0 |
|
540 | + 0 |
|
541 | 541 | ), |
542 | 542 | "status" => "not_started", |
543 | 543 | "type" => "a/b" |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | $result = $campaignsService->listAll(1000); |
75 | 75 | $campaigns = $result->getPayload(); |
76 | 76 | |
77 | - $this->assertTrue(count($campaigns)==1); |
|
77 | + $this->assertTrue(count($campaigns) == 1); |
|
78 | 78 | $this->assertTrue($campaigns[0] instanceOf Campaign); |
79 | - $this->assertTrue($campaigns[0]->getName()=='Landing Page Optimization'); |
|
79 | + $this->assertTrue($campaigns[0]->getName() == 'Landing Page Optimization'); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $campaign = $result->getPayload(); |
171 | 171 | |
172 | 172 | $this->assertTrue($campaign instanceOf Campaign); |
173 | - $this->assertTrue($campaign->getName()=='Landing Page Optimization'); |
|
173 | + $this->assertTrue($campaign->getName() == 'Landing Page Optimization'); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | public function testGetResults() |
@@ -239,8 +239,8 @@ discard block |
||
239 | 239 | $campaignResults = $result->getPayload(); |
240 | 240 | |
241 | 241 | $this->assertTrue($campaignResults instanceOf CampaignResults); |
242 | - $this->assertTrue($campaignResults->getConfidenceThreshold()==0); |
|
243 | - $this->assertTrue($campaignResults->getStartTime()=="2016-10-18T03:27:04.148Z"); |
|
242 | + $this->assertTrue($campaignResults->getConfidenceThreshold() == 0); |
|
243 | + $this->assertTrue($campaignResults->getStartTime() == "2016-10-18T03:27:04.148Z"); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | public function testCreate() |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $createdCampaign = $result->getPayload(); |
348 | 348 | |
349 | 349 | $this->assertTrue($createdCampaign instanceOf Campaign); |
350 | - $this->assertTrue($createdCampaign->getName()=='Landing Page Optimization'); |
|
350 | + $this->assertTrue($createdCampaign->getName() == 'Landing Page Optimization'); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | public function testUpdate() |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | $updatedCampaign = $result->getPayload(); |
455 | 455 | |
456 | 456 | $this->assertTrue($updatedCampaign instanceOf Campaign); |
457 | - $this->assertTrue($updatedCampaign->getName()=='Landing Page Optimization'); |
|
457 | + $this->assertTrue($updatedCampaign->getName() == 'Landing Page Optimization'); |
|
458 | 458 | } |
459 | 459 | |
460 | 460 | public function testDelete() |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | $credentials = $this->loadCredentialsFromFile(); |
486 | 486 | |
487 | 487 | $optimizelyClient = new OptimizelyApiClient($credentials, 'v2'); |
488 | - $this->assertTrue($optimizelyClient!=null); |
|
488 | + $this->assertTrue($optimizelyClient != null); |
|
489 | 489 | |
490 | 490 | // Create new project |
491 | 491 | $curDate = date('Y-m-d H:i:s'); |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $createdCampaign = $result->getPayload(); |
548 | 548 | |
549 | 549 | $this->assertTrue($createdCampaign instanceOf Campaign); |
550 | - $this->assertTrue($createdCampaign->getName()=='Landing Page Optimization'); |
|
550 | + $this->assertTrue($createdCampaign->getName() == 'Landing Page Optimization'); |
|
551 | 551 | |
552 | 552 | // Update campaign |
553 | 553 | $createdCampaign->setName('Some new campaign name'); |
@@ -26,8 +26,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | $result = $eventsService->listAll(1000, true); |
50 | 50 | $events = $result->getPayload(); |
51 | 51 | |
52 | - $this->assertTrue(count($events)==1); |
|
52 | + $this->assertTrue(count($events) == 1); |
|
53 | 53 | $this->assertTrue($events[0] instanceOf Event); |
54 | - $this->assertTrue($events[0]->getName()=='Add to Cart'); |
|
54 | + $this->assertTrue($events[0]->getName() == 'Add to Cart'); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | public function testGet() |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $event = $result->getPayload(); |
90 | 90 | |
91 | 91 | $this->assertTrue($event instanceOf Event); |
92 | - $this->assertTrue($event->getName()=='Add to Cart'); |
|
92 | + $this->assertTrue($event->getName() == 'Add to Cart'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | public function testCreateClickEvent() |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $createdEvent = $result->getPayload(); |
141 | 141 | |
142 | 142 | $this->assertTrue($createdEvent instanceOf ClickEvent); |
143 | - $this->assertTrue($createdEvent->getName()=='Add to Cart'); |
|
143 | + $this->assertTrue($createdEvent->getName() == 'Add to Cart'); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | public function testCreateCustomEvent() |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $createdEvent = $result->getPayload(); |
184 | 184 | |
185 | 185 | $this->assertTrue($createdEvent instanceOf CustomEvent); |
186 | - $this->assertTrue($createdEvent->getName()=='Loaded New App'); |
|
186 | + $this->assertTrue($createdEvent->getName() == 'Loaded New App'); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | public function testUpdateClickEvent() |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $updatedEvent = $result->getPayload(); |
235 | 235 | |
236 | 236 | $this->assertTrue($updatedEvent instanceOf ClickEvent); |
237 | - $this->assertTrue($updatedEvent->getName()=='Add to Cart'); |
|
237 | + $this->assertTrue($updatedEvent->getName() == 'Add to Cart'); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | public function testUpdateCustomEvent() |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | $updatedEvent = $result->getPayload(); |
278 | 278 | |
279 | 279 | $this->assertTrue($updatedEvent instanceOf CustomEvent); |
280 | - $this->assertTrue($updatedEvent->getName()=='Loaded New App'); |
|
280 | + $this->assertTrue($updatedEvent->getName() == 'Loaded New App'); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | public function testIntegration() |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $credentials = $this->loadCredentialsFromFile(); |
289 | 289 | |
290 | 290 | $optimizelyClient = new OptimizelyApiClient($credentials, 'v2'); |
291 | - $this->assertTrue($optimizelyClient!=null); |
|
291 | + $this->assertTrue($optimizelyClient != null); |
|
292 | 292 | |
293 | 293 | // Create new project |
294 | 294 | $curDate = date('Y-m-d H:i:s'); |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | $createdPage = $result->getPayload(); |
335 | 335 | |
336 | 336 | $this->assertTrue($createdPage instanceOf Page); |
337 | - $this->assertTrue($createdPage->getName()=='Home Page'); |
|
337 | + $this->assertTrue($createdPage->getName() == 'Home Page'); |
|
338 | 338 | |
339 | 339 | // Create new event in the project |
340 | 340 | $event = new ClickEvent(array( |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $createdEvent = $result->getPayload(); |
361 | 361 | |
362 | 362 | $this->assertTrue($createdEvent instanceOf ClickEvent); |
363 | - $this->assertTrue($createdEvent->getName()=='Add to Cart'); |
|
363 | + $this->assertTrue($createdEvent->getName() == 'Add to Cart'); |
|
364 | 364 | |
365 | 365 | // List all existing events and try to find the created event |
366 | 366 | $eventFound = false; |
@@ -372,16 +372,16 @@ discard block |
||
372 | 372 | $events = $result->getPayload(); |
373 | 373 | |
374 | 374 | foreach ($events as $event) { |
375 | - if ($event->getName()=="Add to Cart") { |
|
375 | + if ($event->getName() == "Add to Cart") { |
|
376 | 376 | $eventFound = true; |
377 | 377 | break; |
378 | 378 | } |
379 | 379 | } |
380 | 380 | |
381 | - if ($result->getNextPage()==null) |
|
381 | + if ($result->getNextPage() == null) |
|
382 | 382 | break; |
383 | 383 | |
384 | - $page ++; |
|
384 | + $page++; |
|
385 | 385 | } |
386 | 386 | } |
387 | 387 | catch (Exception $e) { |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | $updatedEvent = $result->getPayload(); |
402 | 402 | |
403 | 403 | $this->assertTrue($updatedEvent instanceOf Event); |
404 | - $this->assertTrue($updatedEvent->getName()=='Add to Cart 2'); |
|
404 | + $this->assertTrue($updatedEvent->getName() == 'Add to Cart 2'); |
|
405 | 405 | |
406 | 406 | // Make project archived |
407 | 407 |
@@ -282,8 +282,9 @@ discard block |
||
282 | 282 | |
283 | 283 | public function testIntegration() |
284 | 284 | { |
285 | - if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) |
|
286 | - $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
285 | + if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) { |
|
286 | + $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
287 | + } |
|
287 | 288 | |
288 | 289 | $credentials = $this->loadCredentialsFromFile(); |
289 | 290 | |
@@ -378,13 +379,13 @@ discard block |
||
378 | 379 | } |
379 | 380 | } |
380 | 381 | |
381 | - if ($result->getNextPage()==null) |
|
382 | - break; |
|
382 | + if ($result->getNextPage()==null) { |
|
383 | + break; |
|
384 | + } |
|
383 | 385 | |
384 | 386 | $page ++; |
385 | 387 | } |
386 | - } |
|
387 | - catch (Exception $e) { |
|
388 | + } catch (Exception $e) { |
|
388 | 389 | // Handle error. |
389 | 390 | $code = $e->getCode(); |
390 | 391 | $httpCode = $e->getHttpCode(); |
@@ -205,14 +205,14 @@ |
||
205 | 205 | "platform" => "web", |
206 | 206 | "status" => "active", |
207 | 207 | "web_snippet" => array( |
208 | - "enable_force_variation" => false, |
|
209 | - "exclude_disabled_experiments" => false, |
|
210 | - "exclude_names" => true, |
|
211 | - "include_jquery" => true, |
|
212 | - "ip_anonymization" => false, |
|
213 | - "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
214 | - "library" => "jquery-1.11.3-trim", |
|
215 | - "project_javascript" => "alert(\"Active Experiment\")" |
|
208 | + "enable_force_variation" => false, |
|
209 | + "exclude_disabled_experiments" => false, |
|
210 | + "exclude_names" => true, |
|
211 | + "include_jquery" => true, |
|
212 | + "ip_anonymization" => false, |
|
213 | + "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
214 | + "library" => "jquery-1.11.3-trim", |
|
215 | + "project_javascript" => "alert(\"Active Experiment\")" |
|
216 | 216 | ) |
217 | 217 | )); |
218 | 218 |
@@ -39,9 +39,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
247 | 247 | $attributes = $result->getPayload(); |
248 | 248 | |
249 | 249 | foreach ($attributes as $attribute) { |
250 | - if ($audience->getName()=="Subscriber Status") { |
|
250 | + if ($audience->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 |
||
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 |
@@ -188,8 +188,9 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testIntegration() |
190 | 190 | { |
191 | - if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) |
|
192 | - $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
191 | + if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) { |
|
192 | + $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
193 | + } |
|
193 | 194 | |
194 | 195 | $credentials = $this->loadCredentialsFromFile(); |
195 | 196 | |
@@ -253,13 +254,13 @@ discard block |
||
253 | 254 | } |
254 | 255 | } |
255 | 256 | |
256 | - if ($result->getNextPage()==null) |
|
257 | - break; |
|
257 | + if ($result->getNextPage()==null) { |
|
258 | + break; |
|
259 | + } |
|
258 | 260 | |
259 | 261 | $page ++; |
260 | 262 | } |
261 | - } |
|
262 | - catch (Exception $e) { |
|
263 | + } catch (Exception $e) { |
|
263 | 264 | // Handle error. |
264 | 265 | $code = $e->getCode(); |
265 | 266 | $httpCode = $e->getHttpCode(); |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | $result = $projectsService->listAll(); |
52 | 52 | $projects = $result->getPayload(); |
53 | 53 | |
54 | - $this->assertTrue(count($projects)==1); |
|
54 | + $this->assertTrue(count($projects) == 1); |
|
55 | 55 | $this->assertTrue($projects[0] instanceOf Project); |
56 | - $this->assertTrue($projects[0]->getName()=='Some Optimizely Project'); |
|
56 | + $this->assertTrue($projects[0]->getName() == 'Some Optimizely Project'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $project = $result->getPayload(); |
127 | 127 | |
128 | 128 | $this->assertTrue($project instanceOf Project); |
129 | - $this->assertTrue($project->getName()=='Some Optimizely Project'); |
|
129 | + $this->assertTrue($project->getName() == 'Some Optimizely Project'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | $createdProject = $result->getPayload(); |
207 | 207 | |
208 | 208 | $this->assertTrue($createdProject instanceOf Project); |
209 | - $this->assertTrue($createdProject->getName()=='Test Project'); |
|
210 | - $this->assertTrue($createdProject->getAccountId()==12345); |
|
209 | + $this->assertTrue($createdProject->getName() == 'Test Project'); |
|
210 | + $this->assertTrue($createdProject->getAccountId() == 12345); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -286,8 +286,8 @@ discard block |
||
286 | 286 | $updatedProject = $result->getPayload(); |
287 | 287 | |
288 | 288 | $this->assertTrue($updatedProject instanceOf Project); |
289 | - $this->assertTrue($updatedProject->getName()=='Test Project'); |
|
290 | - $this->assertTrue($updatedProject->getAccountId()==12345); |
|
289 | + $this->assertTrue($updatedProject->getName() == 'Test Project'); |
|
290 | + $this->assertTrue($updatedProject->getAccountId() == 12345); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | $credentials = $this->loadCredentialsFromFile(); |
331 | 331 | |
332 | 332 | $optimizelyClient = new OptimizelyApiClient($credentials, 'v2'); |
333 | - $this->assertTrue($optimizelyClient!=null); |
|
333 | + $this->assertTrue($optimizelyClient != null); |
|
334 | 334 | |
335 | 335 | // Create new project |
336 | 336 | $curDate = date('Y-m-d H:i:s'); |
@@ -381,18 +381,18 @@ discard block |
||
381 | 381 | $projects = $result->getPayload(); |
382 | 382 | |
383 | 383 | foreach ($projects as $project) { |
384 | - echo "Name: " . $project->getName() . "\n"; |
|
385 | - if ($project->getName()=="Test Project $curDate") { |
|
384 | + echo "Name: ".$project->getName()."\n"; |
|
385 | + if ($project->getName() == "Test Project $curDate") { |
|
386 | 386 | $projectId = $project->getId(); |
387 | 387 | $projectFound = true; |
388 | 388 | break; |
389 | 389 | } |
390 | 390 | } |
391 | 391 | |
392 | - if ($result->getNextPage()==null) |
|
392 | + if ($result->getNextPage() == null) |
|
393 | 393 | break; |
394 | 394 | |
395 | - $page ++; |
|
395 | + $page++; |
|
396 | 396 | } |
397 | 397 | } |
398 | 398 | catch (Exception $e) { |
@@ -410,11 +410,11 @@ discard block |
||
410 | 410 | try { |
411 | 411 | $result = $optimizelyClient->projects()->get(12345678); |
412 | 412 | } |
413 | - catch(Exception $e) { |
|
413 | + catch (Exception $e) { |
|
414 | 414 | //print_r($optimizelyClient->getDiagnosticsInfo()); |
415 | 415 | $this->assertEquals(Exception::CODE_API_ERROR, $e->getCode()); |
416 | 416 | $this->assertEquals('not_found', $e->getHttpCode()); |
417 | - $this->assertTrue(strlen($e->getUuid())!=0); |
|
417 | + $this->assertTrue(strlen($e->getUuid()) != 0); |
|
418 | 418 | //$this->assertTrue($e->getRateLimit()>0); |
419 | 419 | //$this->assertTrue($e->getRateLimitRemaining()>0); |
420 | 420 | //$this->assertTrue($e->getRateLimitReset()>0); |