PMCORE-598-A

This commit is contained in:
Andrea Adamczyk
2020-02-07 09:10:37 -04:00
parent 23caca0035
commit e3b8a4ebf8
2 changed files with 20 additions and 1 deletions

View File

@@ -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);
}
}

View File

@@ -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"));