You are here

private function RocketChatTestUnitTest::javascriptVersionTest in Rocket.Chat 7.2

1 call to RocketChatTestUnitTest::javascriptVersionTest()
RocketChatTestUnitTest::testLiveChatJavascriptGeneratorUnitTest in ./rocket_chat.test

File

./rocket_chat.test, line 65

Class

RocketChatTestUnitTest
Although most core test cases are based on DrupalWebTestCase and are functional tests (exercising the web UI) we also have DrupalUnitTestCase, which executes much faster because a Drupal install does not have to be one. No environment is provided to a…

Code

private function javascriptVersionTest($version = null, $url = "https://default") {
  $testValue = \RocketChat\LiveChat::getLivechatJavascript($url, $version);
  if (empty($testValue)) {
    return false;
  }
  if (substr_count(!empty($testValue) ? $testValue : "1.0.0", $url) > 0) {
    return TRUE;
  }
  return false;
}