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>
This commit is contained in:
Paula Quispe
2020-02-03 13:58:16 +00:00
parent 3f2c8a89ad
commit 45ff325901
37 changed files with 2841 additions and 361 deletions

View File

@@ -0,0 +1,37 @@
<?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);
}
}