Merged in release/3.4.8 (pull request #7272)

Updating branch develop with release/3.4.8

Approved-by: Paula Quispe <paula.quispe@processmaker.com>
Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2020-02-27 12:21:56 +00:00
committed by Julio Cesar Laura Avendaño
5 changed files with 65 additions and 17 deletions

View File

@@ -3,8 +3,12 @@
namespace Tests\unit\gulliver\system;
use G;
use MonologProvider;
use Tests\TestCase;
/**
* @coversDefaultClass \G
*/
class gTest extends TestCase
{
/**
@@ -350,4 +354,27 @@ class gTest extends TestCase
$this->assertContains($word, $res);
}
}
/**
* It tests if the errors related to the trigger execution was registered
*
* @covers ::logTriggerExecution
* @test
*/
public function it_check_log_trigger_execution()
{
$data = [];
$error = 'This is some error';
$_SESSION['_DATA_TRIGGER_']['_TRI_LOG_'] = false;
G::logTriggerExecution($data, $error, 'FATAL_ERROR', 60);
$log = MonologProvider::getSingleton('TriggerExecutionError', 'processmaker.log', true);
$this->assertNotEmpty($log->getPathFile());
$this->assertTrue($_SESSION['_DATA_TRIGGER_']['_TRI_LOG_']);
$_SESSION['_DATA_TRIGGER_']['_TRI_LOG_'] = false;
G::logTriggerExecution($data, '', '', 100);
$log = MonologProvider::getSingleton('TriggerExecution', 'processmaker.log', true);
$this->assertNotEmpty($log->getPathFile());
$this->assertFalse($_SESSION['_DATA_TRIGGER_']['_TRI_LOG_']);
}
}