Changeset 3036264
- Timestamp:
- 02/15/2024 12:19:59 PM (2 years ago)
- Location:
- intercom/trunk
- Files:
-
- 2 added
- 4 edited
-
bootstrap.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
test/IntercomSettingsPageTest.php (added)
-
test/SecureModeCalculatorTest.php (added)
-
test/SnippetSettingsTest.php (modified) (1 diff)
-
test/SnippetTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
intercom/trunk/bootstrap.php
r2623352 r3036264 362 362 $result = array_merge($settings, $identityVerificationCalculator->identityVerificationComponent()); 363 363 $result = $this->mergeConstants($result); 364 $result['installation_type'] = 'wordpress'; 364 365 return $result; 365 366 } -
intercom/trunk/readme.txt
r2721339 r3036264 4 4 Tags: intercom, customer, chat 5 5 Requires at least: 4.2.0 6 Tested up to: 6. 06 Tested up to: 6.4.3 7 7 8 8 The official WordPress plugin, built by Intercom. -
intercom/trunk/test/SnippetSettingsTest.php
r1622875 r3036264 10 10 { 11 11 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar")); 12 $this->assertEquals("{\"app_id\":\"bar\" }", $snippet_settings->json());12 $this->assertEquals("{\"app_id\":\"bar\",\"installation_type\":\"wordpress\"}", $snippet_settings->json()); 13 13 } 14 public function testJSONRenderingWith SecureMode()14 public function testJSONRenderingWithIdentityVerification() 15 15 { 16 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar"), "foo", true,new FakeWordPressUserForSnippetTest());17 $this->assertEquals("{\"app_id\":\"bar\",\"email\":\"foo@bar.com\",\"user_hash\":\"a95b0a1ab461c0721d91fbe32a5f5f2a27ac0bfa4bfbcfced168173fa80d4e14\" }", $snippet_settings->json());16 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar"), "foo", new FakeWordPressUserForSnippetTest()); 17 $this->assertEquals("{\"app_id\":\"bar\",\"email\":\"foo@bar.com\",\"user_hash\":\"a95b0a1ab461c0721d91fbe32a5f5f2a27ac0bfa4bfbcfced168173fa80d4e14\",\"installation_type\":\"wordpress\"}", $snippet_settings->json()); 18 18 } 19 19 public function testJSONRenderingWithIdentityVerificationAndNoSecret() 20 { 21 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar"), NULL, new FakeWordPressUserForSnippetTest()); 22 $this->assertEquals("{\"app_id\":\"bar\",\"email\":\"foo@bar.com\",\"installation_type\":\"wordpress\"}", $snippet_settings->json()); 23 } 24 public function testInstallationType() 25 { 26 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar")); 27 $this->assertEquals("{\"app_id\":\"bar\",\"installation_type\":\"wordpress\"}", $snippet_settings->json()); 28 } 20 29 public function testIclLanguageConstant() 21 30 { 22 31 define('ICL_LANGUAGE_CODE', 'fr'); 23 32 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar")); 24 $this->assertEquals("{\"app_id\":\"bar\",\"language_override\":\"fr\" }", $snippet_settings->json());33 $this->assertEquals("{\"app_id\":\"bar\",\"language_override\":\"fr\",\"installation_type\":\"wordpress\"}", $snippet_settings->json()); 25 34 } 26 35 -
intercom/trunk/test/SnippetTest.php
r1671713 r3036264 4 4 public function testGeneratedHtml() 5 5 { 6 $settings = new IntercomSnippetSettings(array("app_id" => "foo", "name" => "Nikola Tesla"), NULL, NULL, NULL,array());6 $settings = new IntercomSnippetSettings(array("app_id" => "foo", "name" => "Nikola Tesla"), NULL, NULL, array()); 7 7 $snippet = new IntercomSnippet($settings); 8 8 … … 23 23 </script> 24 24 <script data-cfasync="false"> 25 window.intercomSettings = {"app_id":"foo","name":"Nikola Tesla" };25 window.intercomSettings = {"app_id":"foo","name":"Nikola Tesla","installation_type":"wordpress"}; 26 26 </script> 27 <script data-cfasync="false">(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update', intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/foo';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>27 <script data-cfasync="false">(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/foo';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script> 28 28 HTML; 29 29
Note: See TracChangeset
for help on using the changeset viewer.