Files
luos/tests/unit/workflow/engine/methods/emailServer/EmailServerTest.php
Paula Quispe 45ff325901 Merged in feature/PMC-1332 (pull request #7136)
PMC-1332 PMCORE-1018

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
Approved-by: Paula Quispe <paula.quispe@processmaker.com>
2020-02-03 10:07:05 -04:00

38 lines
987 B
PHP

<?php
namespace Tests\unit\workflow\engine\methods\emailServer;
use ProcessMaker\Model\User;
use RBAC;
use Tests\TestCase;
class EmailServerTest extends TestCase
{
/**
* This test ensures that the script output generates the javascript variable
* EMAILSERVER_LICENSED.
* @test
*/
public function it_should_verify_the_script_output_contains_javascript_variable()
{
global $RBAC;
$user = User::where('USR_ID', '=', 1)
->get()
->first();
$_SESSION['USER_LOGGED'] = $user['USR_UID'];
$_POST['USR_UID'] = $user['USR_UID'];
$RBAC = RBAC::getSingleton(PATH_DATA, session_id());
$RBAC->initRBAC();
$RBAC->loadUserRolePermission('PROCESSMAKER', $_SESSION['USER_LOGGED']);
ob_start();
require_once PATH_METHODS . 'emailServer/emailServer.php';
$content = ob_get_clean();
$this->assertContains("EMAILSERVER_LICENSED", $content);
}
}