Plugin Directory

Changeset 3036264


Ignore:
Timestamp:
02/15/2024 12:19:59 PM (2 years ago)
Author:
bobintercom
Message:

Update Tested up to version to 6.4.3.
Add new settings installation_type attribute.
Update the tests

Location:
intercom/trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • intercom/trunk/bootstrap.php

    r2623352 r3036264  
    362362    $result = array_merge($settings, $identityVerificationCalculator->identityVerificationComponent());
    363363    $result = $this->mergeConstants($result);
     364    $result['installation_type'] = 'wordpress';
    364365    return $result;
    365366  }
  • intercom/trunk/readme.txt

    r2721339 r3036264  
    44Tags: intercom, customer, chat
    55Requires at least: 4.2.0
    6 Tested up to: 6.0
     6Tested up to: 6.4.3
    77
    88The official WordPress plugin, built by Intercom.
  • intercom/trunk/test/SnippetSettingsTest.php

    r1622875 r3036264  
    1010  {
    1111    $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());
    1313  }
    14   public function testJSONRenderingWithSecureMode()
     14  public function testJSONRenderingWithIdentityVerification()
    1515  {
    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());
    1818  }
    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  }
    2029  public function testIclLanguageConstant()
    2130  {
    2231    define('ICL_LANGUAGE_CODE', 'fr');
    2332    $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());
    2534  }
    2635
  • intercom/trunk/test/SnippetTest.php

    r1671713 r3036264  
    44  public function testGeneratedHtml()
    55  {
    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());
    77    $snippet = new IntercomSnippet($settings);
    88
     
    2323</script>
    2424<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"};
    2626</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>
    2828HTML;
    2929
Note: See TracChangeset for help on using the changeset viewer.