@@ -91,8 +91,9 @@ |
||
| 91 | 91 | // Remove options with empty values |
| 92 | 92 | $cleanedOptions = array(); |
| 93 | 93 | foreach ($options as $name=>$value) { |
| 94 | - if ($value!==null) |
|
| 95 | - $cleanedOptions[$name] = $value; |
|
| 94 | + if ($value!==null) { |
|
| 95 | + $cleanedOptions[$name] = $value; |
|
| 96 | + } |
|
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | return $cleanedOptions; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | case 'start_time': $this->setStartTime($value); break; |
| 69 | 69 | default: |
| 70 | - throw new Exception('Unknown option: ' . $name); |
|
| 70 | + throw new Exception('Unknown option: '.$name); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | // Remove options with empty values |
| 93 | 93 | $cleanedOptions = array(); |
| 94 | 94 | foreach ($options as $name=>$value) { |
| 95 | - if ($value!==null) |
|
| 95 | + if ($value !== null) |
|
| 96 | 96 | $cleanedOptions[$name] = $value; |
| 97 | 97 | } |
| 98 | 98 | |
@@ -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", |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | $result = $audiencesService->listAll(1000); |
| 50 | 50 | $audiences = $result->getPayload(); |
| 51 | 51 | |
| 52 | - $this->assertTrue(count($audiences)==1); |
|
| 52 | + $this->assertTrue(count($audiences) == 1); |
|
| 53 | 53 | $this->assertTrue($audiences[0] instanceOf Audience); |
| 54 | - $this->assertTrue($audiences[0]->getName()=='Spanish speaking San Franciscans'); |
|
| 54 | + $this->assertTrue($audiences[0]->getName() == 'Spanish speaking San Franciscans'); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $audience = $result->getPayload(); |
| 123 | 123 | |
| 124 | 124 | $this->assertTrue($audience instanceOf Audience); |
| 125 | - $this->assertTrue($audience->getName()=='Spanish speaking San Franciscans'); |
|
| 125 | + $this->assertTrue($audience->getName() == 'Spanish speaking San Franciscans'); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | public function testCreate() |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $createdAudience = $result->getPayload(); |
| 183 | 183 | |
| 184 | 184 | $this->assertTrue($createdAudience instanceOf Audience); |
| 185 | - $this->assertTrue($createdAudience->getName()=='Spanish speaking San Franciscans'); |
|
| 185 | + $this->assertTrue($createdAudience->getName() == 'Spanish speaking San Franciscans'); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | public function testUpdate() |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | $createdAudience = $result->getPayload(); |
| 243 | 243 | |
| 244 | 244 | $this->assertTrue($createdAudience instanceOf Audience); |
| 245 | - $this->assertTrue($createdAudience->getName()=='Spanish speaking San Franciscans'); |
|
| 245 | + $this->assertTrue($createdAudience->getName() == 'Spanish speaking San Franciscans'); |
|
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | |
@@ -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)) { |
@@ -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 | |
@@ -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'); |
@@ -355,9 +355,9 @@ discard block |
||
| 355 | 355 | $result = $optimizelyClient->projects()->create($newProject); |
| 356 | 356 | |
| 357 | 357 | $this->assertEquals(201, $result->getHttpCode()); |
| 358 | - $this->assertTrue($result->getRateLimit()>0); |
|
| 359 | - $this->assertTrue($result->getRateLimitRemaining()>0); |
|
| 360 | - $this->assertTrue($result->getRateLimitReset()>0); |
|
| 358 | + $this->assertTrue($result->getRateLimit() > 0); |
|
| 359 | + $this->assertTrue($result->getRateLimitRemaining() > 0); |
|
| 360 | + $this->assertTrue($result->getRateLimitReset() > 0); |
|
| 361 | 361 | |
| 362 | 362 | $createdProject = $result->getPayload(); |
| 363 | 363 | |
@@ -379,18 +379,18 @@ discard block |
||
| 379 | 379 | $projects = $result->getPayload(); |
| 380 | 380 | |
| 381 | 381 | foreach ($projects as $project) { |
| 382 | - echo "Name: " . $project->getName() . "\n"; |
|
| 383 | - if ($project->getName()=="Test Project $curDate") { |
|
| 382 | + echo "Name: ".$project->getName()."\n"; |
|
| 383 | + if ($project->getName() == "Test Project $curDate") { |
|
| 384 | 384 | $projectId = $project->getId(); |
| 385 | 385 | $projectFound = true; |
| 386 | 386 | break; |
| 387 | 387 | } |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | - if ($result->getNextPage()==null) |
|
| 390 | + if ($result->getNextPage() == null) |
|
| 391 | 391 | break; |
| 392 | 392 | |
| 393 | - $page ++; |
|
| 393 | + $page++; |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | catch (Exception $e) { |
@@ -408,14 +408,14 @@ discard block |
||
| 408 | 408 | try { |
| 409 | 409 | $result = $optimizelyClient->projects()->get(12345678); |
| 410 | 410 | } |
| 411 | - catch(Exception $e) { |
|
| 411 | + catch (Exception $e) { |
|
| 412 | 412 | //print_r($optimizelyClient->getDiagnosticsInfo()); |
| 413 | 413 | $this->assertEquals(Exception::CODE_API_ERROR, $e->getCode()); |
| 414 | 414 | $this->assertEquals('not_found', $e->getHttpCode()); |
| 415 | - $this->assertTrue(strlen($e->getUuid())!=0); |
|
| 416 | - $this->assertTrue($e->getRateLimit()>0); |
|
| 417 | - $this->assertTrue($e->getRateLimitRemaining()>0); |
|
| 418 | - $this->assertTrue($e->getRateLimitReset()>0); |
|
| 415 | + $this->assertTrue(strlen($e->getUuid()) != 0); |
|
| 416 | + $this->assertTrue($e->getRateLimit() > 0); |
|
| 417 | + $this->assertTrue($e->getRateLimitRemaining() > 0); |
|
| 418 | + $this->assertTrue($e->getRateLimitReset() > 0); |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | // Retrieve existing project by ID |
@@ -324,8 +324,9 @@ discard block |
||
| 324 | 324 | |
| 325 | 325 | public function testIntegration() |
| 326 | 326 | { |
| 327 | - if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) |
|
| 328 | - $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
| 327 | + if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) { |
|
| 328 | + $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
| 329 | + } |
|
| 329 | 330 | |
| 330 | 331 | $credentials = $this->loadCredentialsFromFile(); |
| 331 | 332 | |
@@ -387,13 +388,13 @@ discard block |
||
| 387 | 388 | } |
| 388 | 389 | } |
| 389 | 390 | |
| 390 | - if ($result->getNextPage()==null) |
|
| 391 | - break; |
|
| 391 | + if ($result->getNextPage()==null) { |
|
| 392 | + break; |
|
| 393 | + } |
|
| 392 | 394 | |
| 393 | 395 | $page ++; |
| 394 | 396 | } |
| 395 | - } |
|
| 396 | - catch (Exception $e) { |
|
| 397 | + } catch (Exception $e) { |
|
| 397 | 398 | // Handle error. |
| 398 | 399 | $code = $e->getCode(); |
| 399 | 400 | $httpCode = $e->getHttpCode(); |
@@ -407,8 +408,7 @@ discard block |
||
| 407 | 408 | // Try a non-existing project by ID - assume failure |
| 408 | 409 | try { |
| 409 | 410 | $result = $optimizelyClient->projects()->get(12345678); |
| 410 | - } |
|
| 411 | - catch(Exception $e) { |
|
| 411 | + } catch(Exception $e) { |
|
| 412 | 412 | //print_r($optimizelyClient->getDiagnosticsInfo()); |
| 413 | 413 | $this->assertEquals(Exception::CODE_API_ERROR, $e->getCode()); |
| 414 | 414 | $this->assertEquals('not_found', $e->getHttpCode()); |
@@ -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", |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | "end_time" => "2016-10-14T05:08:43.031Z", |
| 14 | 14 | "experiment_id" => 3000, |
| 15 | 15 | "metrics" => array( |
| 16 | - array( |
|
| 16 | + array( |
|
| 17 | 17 | "event" => "string", |
| 18 | 18 | "event_name" => "string", |
| 19 | 19 | "measure" => "conversions", |
@@ -21,54 +21,54 @@ discard block |
||
| 21 | 21 | "priority" => 1, |
| 22 | 22 | "unit" => "session", |
| 23 | 23 | "variation_results" => array( |
| 24 | - "9000" => array( |
|
| 24 | + "9000" => array( |
|
| 25 | 25 | "experiment_id" => 0, |
| 26 | 26 | "is_baseline" => true, |
| 27 | 27 | "lift" => array( |
| 28 | - "confidence_interval" => array( |
|
| 28 | + "confidence_interval" => array( |
|
| 29 | 29 | 0.010399560300730457, |
| 30 | 30 | 0.0850821459929161 |
| 31 | - ), |
|
| 32 | - "is_most_conclusive" => true, |
|
| 33 | - "is_significant" => true, |
|
| 34 | - "significance" => 0, |
|
| 35 | - "value" => 0, |
|
| 36 | - "visitors_remaining" => 0 |
|
| 31 | + ), |
|
| 32 | + "is_most_conclusive" => true, |
|
| 33 | + "is_significant" => true, |
|
| 34 | + "significance" => 0, |
|
| 35 | + "value" => 0, |
|
| 36 | + "visitors_remaining" => 0 |
|
| 37 | 37 | ), |
| 38 | 38 | "name" => "Blue Button", |
| 39 | 39 | "rate" => 0, |
| 40 | 40 | "scope" => "variation", |
| 41 | 41 | "total_increase" => array( |
| 42 | - "confidence_interval" => array( |
|
| 42 | + "confidence_interval" => array( |
|
| 43 | 43 | 0.010399560300730457, |
| 44 | 44 | 0.0850821459929161 |
| 45 | - ), |
|
| 46 | - "is_most_conclusive" => true, |
|
| 47 | - "is_significant" => true, |
|
| 48 | - "significance" => 0, |
|
| 49 | - "value" => 0, |
|
| 50 | - "visitors_remaining" => 0 |
|
| 45 | + ), |
|
| 46 | + "is_most_conclusive" => true, |
|
| 47 | + "is_significant" => true, |
|
| 48 | + "significance" => 0, |
|
| 49 | + "value" => 0, |
|
| 50 | + "visitors_remaining" => 0 |
|
| 51 | 51 | ), |
| 52 | 52 | "value" => 0, |
| 53 | 53 | "variation_id" => "string" |
| 54 | - ) |
|
| 54 | + ) |
|
| 55 | + ) |
|
| 55 | 56 | ) |
| 56 | - ) |
|
| 57 | 57 | ), |
| 58 | 58 | "reach" => array( |
| 59 | - "baseline_count" => 0, |
|
| 60 | - "baseline_reach" => 0, |
|
| 61 | - "total_count" => 0, |
|
| 62 | - "treatment_count" => 0, |
|
| 63 | - "treatment_reach" => 0, |
|
| 64 | - "variations" => array( |
|
| 59 | + "baseline_count" => 0, |
|
| 60 | + "baseline_reach" => 0, |
|
| 61 | + "total_count" => 0, |
|
| 62 | + "treatment_count" => 0, |
|
| 63 | + "treatment_reach" => 0, |
|
| 64 | + "variations" => array( |
|
| 65 | 65 | "9000" => array( |
| 66 | - "count" => 0, |
|
| 67 | - "name" => "Blue Button", |
|
| 68 | - "variation_id" => "string", |
|
| 69 | - "variation_reach" => 0 |
|
| 66 | + "count" => 0, |
|
| 67 | + "name" => "Blue Button", |
|
| 68 | + "variation_id" => "string", |
|
| 69 | + "variation_reach" => 0 |
|
| 70 | + ) |
|
| 70 | 71 | ) |
| 71 | - ) |
|
| 72 | 72 | ), |
| 73 | 73 | "start_time" => "2016-10-14T05:08:43.032Z" |
| 74 | 74 | ); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | "end_time" => "2016-10-14T05:08:43.031Z", |
| 87 | 87 | "experiment_id" => 3000, |
| 88 | 88 | "metrics" => array( |
| 89 | - array( |
|
| 89 | + array( |
|
| 90 | 90 | "event" => "string", |
| 91 | 91 | "event_name" => "string", |
| 92 | 92 | "measure" => "conversions", |
@@ -94,54 +94,54 @@ discard block |
||
| 94 | 94 | "priority" => 1, |
| 95 | 95 | "unit" => "session", |
| 96 | 96 | "variation_results" => array( |
| 97 | - "9000" => array( |
|
| 97 | + "9000" => array( |
|
| 98 | 98 | "experiment_id" => 0, |
| 99 | 99 | "is_baseline" => true, |
| 100 | 100 | "lift" => array( |
| 101 | - "confidence_interval" => array( |
|
| 101 | + "confidence_interval" => array( |
|
| 102 | 102 | 0.010399560300730457, |
| 103 | 103 | 0.0850821459929161 |
| 104 | - ), |
|
| 105 | - "is_most_conclusive" => true, |
|
| 106 | - "is_significant" => true, |
|
| 107 | - "significance" => 0, |
|
| 108 | - "value" => 0, |
|
| 109 | - "visitors_remaining" => 0 |
|
| 104 | + ), |
|
| 105 | + "is_most_conclusive" => true, |
|
| 106 | + "is_significant" => true, |
|
| 107 | + "significance" => 0, |
|
| 108 | + "value" => 0, |
|
| 109 | + "visitors_remaining" => 0 |
|
| 110 | 110 | ), |
| 111 | 111 | "name" => "Blue Button", |
| 112 | 112 | "rate" => 0, |
| 113 | 113 | "scope" => "variation", |
| 114 | 114 | "total_increase" => array( |
| 115 | - "confidence_interval" => array( |
|
| 115 | + "confidence_interval" => array( |
|
| 116 | 116 | 0.010399560300730457, |
| 117 | 117 | 0.0850821459929161 |
| 118 | - ), |
|
| 119 | - "is_most_conclusive" => true, |
|
| 120 | - "is_significant" => true, |
|
| 121 | - "significance" => 0, |
|
| 122 | - "value" => 0, |
|
| 123 | - "visitors_remaining" => 0 |
|
| 118 | + ), |
|
| 119 | + "is_most_conclusive" => true, |
|
| 120 | + "is_significant" => true, |
|
| 121 | + "significance" => 0, |
|
| 122 | + "value" => 0, |
|
| 123 | + "visitors_remaining" => 0 |
|
| 124 | 124 | ), |
| 125 | 125 | "value" => 0, |
| 126 | 126 | "variation_id" => "string" |
| 127 | - ) |
|
| 127 | + ) |
|
| 128 | + ) |
|
| 128 | 129 | ) |
| 129 | - ) |
|
| 130 | 130 | ), |
| 131 | 131 | "reach" => array( |
| 132 | - "baseline_count" => 0, |
|
| 133 | - "baseline_reach" => 0, |
|
| 134 | - "total_count" => 0, |
|
| 135 | - "treatment_count" => 0, |
|
| 136 | - "treatment_reach" => 0, |
|
| 137 | - "variations" => array( |
|
| 132 | + "baseline_count" => 0, |
|
| 133 | + "baseline_reach" => 0, |
|
| 134 | + "total_count" => 0, |
|
| 135 | + "treatment_count" => 0, |
|
| 136 | + "treatment_reach" => 0, |
|
| 137 | + "variations" => array( |
|
| 138 | 138 | "9000" => array( |
| 139 | - "count" => 0, |
|
| 140 | - "name" => "Blue Button", |
|
| 141 | - "variation_id" => "string", |
|
| 142 | - "variation_reach" => 0 |
|
| 139 | + "count" => 0, |
|
| 140 | + "name" => "Blue Button", |
|
| 141 | + "variation_id" => "string", |
|
| 142 | + "variation_reach" => 0 |
|
| 143 | + ) |
|
| 143 | 144 | ) |
| 144 | - ) |
|
| 145 | 145 | ), |
| 146 | 146 | "start_time" => "2016-10-14T05:08:43.032Z" |
| 147 | 147 | ); |
@@ -92,73 +92,73 @@ discard block |
||
| 92 | 92 | $options = array( |
| 93 | 93 | "project_id" => 1000, |
| 94 | 94 | "audience_ids" => array( |
| 95 | - 1234, |
|
| 96 | - 1212, |
|
| 97 | - 1432 |
|
| 95 | + 1234, |
|
| 96 | + 1212, |
|
| 97 | + 1432 |
|
| 98 | 98 | ), |
| 99 | 99 | "campaign_id" => 2000, |
| 100 | 100 | "changes" => array( |
| 101 | - array( |
|
| 101 | + array( |
|
| 102 | 102 | "type" => "custom_code", |
| 103 | 103 | "allow_additional_redirect" => true, |
| 104 | 104 | "async" => true, |
| 105 | 105 | "css_selector" => "a[href*=\"optimizely\"]", |
| 106 | 106 | "dependencies" => array( |
| 107 | - 24, |
|
| 108 | - 26 |
|
| 107 | + 24, |
|
| 108 | + 26 |
|
| 109 | 109 | ), |
| 110 | 110 | "destination" => "https://app.optimizely.com/", |
| 111 | 111 | "extension_id" => 1234, |
| 112 | 112 | "preserve_parameters" => true, |
| 113 | 113 | "src" => 524, |
| 114 | 114 | "value" => "window.someGlobalFunction();" |
| 115 | - ) |
|
| 115 | + ) |
|
| 116 | 116 | ), |
| 117 | 117 | "description" => "string", |
| 118 | 118 | "holdback" => 5000, |
| 119 | 119 | "key" => "home_page_experiment", |
| 120 | 120 | "metrics" => array( |
| 121 | - array( |
|
| 121 | + array( |
|
| 122 | 122 | "kind" => "string" |
| 123 | - ) |
|
| 123 | + ) |
|
| 124 | 124 | ), |
| 125 | 125 | "name" => "Blue Button Experiment", |
| 126 | 126 | "schedule" => array( |
| 127 | - "start_time" => "2016-10-14T05:08:42.850Z", |
|
| 128 | - "stop_time" => "2016-10-14T05:08:42.850Z", |
|
| 129 | - "time_zone" => "UTC" |
|
| 127 | + "start_time" => "2016-10-14T05:08:42.850Z", |
|
| 128 | + "stop_time" => "2016-10-14T05:08:42.850Z", |
|
| 129 | + "time_zone" => "UTC" |
|
| 130 | 130 | ), |
| 131 | 131 | "status" => "active", |
| 132 | 132 | "variations" => array( |
| 133 | - array( |
|
| 133 | + array( |
|
| 134 | 134 | "actions" => array( |
| 135 | - array( |
|
| 135 | + array( |
|
| 136 | 136 | "changes" => array( |
| 137 | - array( |
|
| 137 | + array( |
|
| 138 | 138 | "type" => "custom_code", |
| 139 | 139 | "allow_additional_redirect" => true, |
| 140 | 140 | "async" => true, |
| 141 | 141 | "css_selector" => "a[href*=\"optimizely\"]", |
| 142 | 142 | "dependencies" => array( |
| 143 | - 24, |
|
| 144 | - 26 |
|
| 143 | + 24, |
|
| 144 | + 26 |
|
| 145 | 145 | ), |
| 146 | 146 | "destination" => "https://app.optimizely.com/", |
| 147 | 147 | "extension_id" => 1234, |
| 148 | 148 | "preserve_parameters" => true, |
| 149 | 149 | "src" => 524, |
| 150 | 150 | "value" => "window.someGlobalFunction();" |
| 151 | - ) |
|
| 151 | + ) |
|
| 152 | 152 | ), |
| 153 | 153 | "page_id" => 0 |
| 154 | - ) |
|
| 154 | + ) |
|
| 155 | 155 | ), |
| 156 | 156 | "archived" => true, |
| 157 | 157 | "key" => "blue_button_variation", |
| 158 | 158 | "name" => "Blue Button", |
| 159 | 159 | "variation_id" => 0, |
| 160 | 160 | "weight" => 0 |
| 161 | - ) |
|
| 161 | + ) |
|
| 162 | 162 | ) |
| 163 | 163 | ); |
| 164 | 164 | |
@@ -173,73 +173,73 @@ discard block |
||
| 173 | 173 | $options = array( |
| 174 | 174 | "project_id" => 1000, |
| 175 | 175 | "audience_ids" => array( |
| 176 | - 1234, |
|
| 177 | - 1212, |
|
| 178 | - 1432 |
|
| 176 | + 1234, |
|
| 177 | + 1212, |
|
| 178 | + 1432 |
|
| 179 | 179 | ), |
| 180 | 180 | "campaign_id" => 2000, |
| 181 | 181 | "changes" => array( |
| 182 | - array( |
|
| 182 | + array( |
|
| 183 | 183 | "type" => "custom_code", |
| 184 | 184 | "allow_additional_redirect" => true, |
| 185 | 185 | "async" => true, |
| 186 | 186 | "css_selector" => "a[href*=\"optimizely\"]", |
| 187 | 187 | "dependencies" => array( |
| 188 | - 24, |
|
| 189 | - 26 |
|
| 188 | + 24, |
|
| 189 | + 26 |
|
| 190 | 190 | ), |
| 191 | 191 | "destination" => "https://app.optimizely.com/", |
| 192 | 192 | "extension_id" => 1234, |
| 193 | 193 | "preserve_parameters" => true, |
| 194 | 194 | "src" => 524, |
| 195 | 195 | "value" => "window.someGlobalFunction();" |
| 196 | - ) |
|
| 196 | + ) |
|
| 197 | 197 | ), |
| 198 | 198 | "description" => "string", |
| 199 | 199 | "holdback" => 5000, |
| 200 | 200 | "key" => "home_page_experiment", |
| 201 | 201 | "metrics" => array( |
| 202 | - array( |
|
| 202 | + array( |
|
| 203 | 203 | "kind" => "string" |
| 204 | - ) |
|
| 204 | + ) |
|
| 205 | 205 | ), |
| 206 | 206 | "name" => "Blue Button Experiment", |
| 207 | 207 | "schedule" => array( |
| 208 | - "start_time" => "2016-10-14T05:08:42.850Z", |
|
| 209 | - "stop_time" => "2016-10-14T05:08:42.850Z", |
|
| 210 | - "time_zone" => "UTC" |
|
| 208 | + "start_time" => "2016-10-14T05:08:42.850Z", |
|
| 209 | + "stop_time" => "2016-10-14T05:08:42.850Z", |
|
| 210 | + "time_zone" => "UTC" |
|
| 211 | 211 | ), |
| 212 | 212 | "status" => "active", |
| 213 | 213 | "variations" => array( |
| 214 | - array( |
|
| 214 | + array( |
|
| 215 | 215 | "actions" => array( |
| 216 | - array( |
|
| 216 | + array( |
|
| 217 | 217 | "changes" => array( |
| 218 | - array( |
|
| 218 | + array( |
|
| 219 | 219 | "type" => "custom_code", |
| 220 | 220 | "allow_additional_redirect" => true, |
| 221 | 221 | "async" => true, |
| 222 | 222 | "css_selector" => "a[href*=\"optimizely\"]", |
| 223 | 223 | "dependencies" => array( |
| 224 | - 24, |
|
| 225 | - 26 |
|
| 224 | + 24, |
|
| 225 | + 26 |
|
| 226 | 226 | ), |
| 227 | 227 | "destination" => "https://app.optimizely.com/", |
| 228 | 228 | "extension_id" => 1234, |
| 229 | 229 | "preserve_parameters" => true, |
| 230 | 230 | "src" => 524, |
| 231 | 231 | "value" => "window.someGlobalFunction();" |
| 232 | - ) |
|
| 232 | + ) |
|
| 233 | 233 | ), |
| 234 | 234 | "page_id" => 0 |
| 235 | - ) |
|
| 235 | + ) |
|
| 236 | 236 | ), |
| 237 | 237 | "archived" => true, |
| 238 | 238 | "key" => "blue_button_variation", |
| 239 | 239 | "name" => "Blue Button", |
| 240 | 240 | "variation_id" => 0, |
| 241 | 241 | "weight" => 0 |
| 242 | - ) |
|
| 242 | + ) |
|
| 243 | 243 | ) |
| 244 | 244 | ); |
| 245 | 245 | |