From e3b8a4ebf8c1dba76cc9ef017ce49e9ebe38beb1 Mon Sep 17 00:00:00 2001 From: Andrea Adamczyk Date: Fri, 7 Feb 2020 09:10:37 -0400 Subject: [PATCH] PMCORE-598-A --- .../GmailOAuth/GmailOAuthTest.php | 19 +++++++++++++++++++ .../ProcessMaker/GmailOAuth/GmailOAuth.php | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/unit/workflow/engine/src/ProcessMaker/GmailOAuth/GmailOAuthTest.php b/tests/unit/workflow/engine/src/ProcessMaker/GmailOAuth/GmailOAuthTest.php index 5f819c2a7..440e91501 100644 --- a/tests/unit/workflow/engine/src/ProcessMaker/GmailOAuth/GmailOAuthTest.php +++ b/tests/unit/workflow/engine/src/ProcessMaker/GmailOAuth/GmailOAuthTest.php @@ -8,6 +8,7 @@ use Google_Client; use Google_Service_Gmail_Message; use Illuminate\Foundation\Testing\DatabaseTransactions; use PHPMailerOAuth; +use ProcessMaker\Core\System; use ProcessMaker\GmailOAuth\GmailOAuth; use RBAC; use Tests\TestCase; @@ -330,4 +331,22 @@ class GmailOAuthTest extends TestCase } $this->assertTrue(true); } + + /** + * It tests that the message body contains the link to the image + * + * @test + * @covers \ProcessMaker\GmailOAuth\GmailOAuth::getMessageBody() + */ + public function it_should_tests_the_get_message_body_method() + { + // Create the GmailOAuth object + $gmailOauth = new GmailOAuth(); + + // Call the getMessageBody method + $res = $gmailOauth->getMessageBody(); + + // Assert the result contains the server protocol and host + $this->assertRegExp("#" . System::getServerProtocol() . System::getServerHost() . "#", $res); + } } diff --git a/workflow/engine/src/ProcessMaker/GmailOAuth/GmailOAuth.php b/workflow/engine/src/ProcessMaker/GmailOAuth/GmailOAuth.php index cf3313480..63bac963e 100644 --- a/workflow/engine/src/ProcessMaker/GmailOAuth/GmailOAuth.php +++ b/workflow/engine/src/ProcessMaker/GmailOAuth/GmailOAuth.php @@ -350,7 +350,7 @@ class GmailOAuth { $templateTower = new TemplatePower(PATH_TPL . "admin" . PATH_SEP . "email.tpl"); $templateTower->prepare(); - $templateTower->assign("server", System::getServerHostname()); + $templateTower->assign("server", System::getServerProtocol() . System::getServerHost()); $templateTower->assign("date", date("H:i:s")); $templateTower->assign("ver", System::getVersion()); $templateTower->assign("engine", G::LoadTranslation("ID_MESS_ENGINE_TYPE_4"));