Merged in bugfix/PMCORE-1151 (pull request #7297)
PMCORE-1151 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -16,8 +16,8 @@ $app->make(Kernel::class)->bootstrap();
|
||||
/**
|
||||
* @todo Migrate to configuration parameters
|
||||
*/
|
||||
define('PATH_TRUNK', dirname(__DIR__));
|
||||
define('PATH_CORE', PATH_TRUNK . '/workflow/engine/');
|
||||
define('PATH_TRUNK', dirname(__DIR__) . '/');
|
||||
define('PATH_CORE', PATH_TRUNK . 'workflow/engine/');
|
||||
define('PATH_CONFIG', PATH_CORE . 'config/');
|
||||
if (!defined("PATH_DATA")) {
|
||||
define('PATH_DATA', dirname(__DIR__) . '/shared/');
|
||||
@@ -33,12 +33,12 @@ define('DB_ADAPTER', 'mysql');
|
||||
// Path related some specific directories
|
||||
define('PATH_SEP', '/');
|
||||
define("PATH_PLUGINS", PATH_CORE . "plugins" . PATH_SEP);
|
||||
define('PATH_WORKSPACE', PATH_TRUNK . '/shared/sites/' . SYS_SYS . '/');
|
||||
define('PATH_WORKSPACE', PATH_TRUNK . 'shared/sites/' . SYS_SYS . '/');
|
||||
define('PATH_METHODS', dirname(__DIR__) . '/workflow/engine/methods/');
|
||||
define('PATH_WORKFLOW_MYSQL_DATA', PATH_TRUNK . '/workflow/engine/data/mysql/');
|
||||
define('PATH_RBAC_MYSQL_DATA', PATH_TRUNK . '/rbac/engine/data/mysql/');
|
||||
define('PATH_WORKFLOW_MYSQL_DATA', PATH_TRUNK . 'workflow/engine/data/mysql/');
|
||||
define('PATH_RBAC_MYSQL_DATA', PATH_TRUNK . 'rbac/engine/data/mysql/');
|
||||
define('PATH_LANGUAGECONT', PATH_DATA . '/META-INF/');
|
||||
define('PATH_RBAC_HOME', PATH_TRUNK . '/rbac/');
|
||||
define('PATH_RBAC_HOME', PATH_TRUNK . 'rbac/');
|
||||
define('PATH_RBAC', PATH_RBAC_HOME . 'engine/classes/');
|
||||
define("PATH_CUSTOM_SKINS", PATH_DATA . "skins/");
|
||||
define("PATH_TPL", PATH_CORE . "templates/");
|
||||
@@ -49,11 +49,11 @@ define('DB_HOST', env('DB_HOST'));
|
||||
define('DB_NAME', env('DB_DATABASE'));
|
||||
define('DB_USER', env('DB_USERNAME'));
|
||||
define('DB_PASS', env('DB_PASSWORD'));
|
||||
define('PATH_HOME', PATH_TRUNK . '/workflow/');
|
||||
define('PATH_HOME', PATH_TRUNK . 'workflow/');
|
||||
define('PATH_HTML', PATH_HOME . 'public_html/');
|
||||
define('PATH_SMARTY_C', PATH_TRUNK . '/shared/compiled/smarty/c');
|
||||
define('PATH_SMARTY_CACHE', PATH_TRUNK . '/shared/compiled/smarty/cache');
|
||||
define('PATH_THIRDPARTY', PATH_TRUNK . '/thirdparty/');
|
||||
define('PATH_SMARTY_C', PATH_TRUNK . 'shared/compiled/smarty/c');
|
||||
define('PATH_SMARTY_CACHE', PATH_TRUNK . 'shared/compiled/smarty/cache');
|
||||
define('PATH_THIRDPARTY', PATH_TRUNK . 'thirdparty/');
|
||||
define("URL_KEY", 'c0l0s40pt1mu59r1m3');
|
||||
define("PATH_XMLFORM", PATH_CORE . "xmlform" . PATH_SEP);
|
||||
|
||||
|
||||
BIN
tests/resources/fonts/arialuni.ttf
Normal file
BIN
tests/resources/fonts/arialuni.ttf
Normal file
Binary file not shown.
@@ -14,7 +14,7 @@ class DefaultAjaxTest extends TestCase
|
||||
*/
|
||||
private function getDataFromFile(string $pathData): array
|
||||
{
|
||||
$pathData = PATH_TRUNK . "/tests/resources/{$pathData}";
|
||||
$pathData = PATH_TRUNK . "tests/resources/{$pathData}";
|
||||
$data = file_get_contents($pathData);
|
||||
$result = json_decode($data, JSON_OBJECT_AS_ARRAY);
|
||||
return $result;
|
||||
@@ -35,10 +35,10 @@ class DefaultAjaxTest extends TestCase
|
||||
if (!is_dir($pathName)) {
|
||||
mkdir($pathName);
|
||||
}
|
||||
$data = file_get_contents(PATH_TRUNK . "/tests/resources/simpleClassicXmlFormData.xml");
|
||||
$data = file_get_contents(PATH_TRUNK . "tests/resources/simpleClassicXmlFormData.xml");
|
||||
file_put_contents($pathFileName, $data);
|
||||
|
||||
require_once PATH_TRUNK . '/gulliver/methods/defaultAjax.php';
|
||||
require_once PATH_TRUNK . 'gulliver/methods/defaultAjax.php';
|
||||
$this->expectOutputString('[]');
|
||||
|
||||
unlink($pathFileName);
|
||||
|
||||
@@ -26,25 +26,25 @@ class CliWorkspacesTest extends TestCase
|
||||
*/
|
||||
public function it_should_delete_the_deprecated_files()
|
||||
{
|
||||
include(PATH_TRUNK . PATH_SEP . 'workflow/engine/bin/tasks/cliWorkspaces.php');
|
||||
if (!file_exists(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/data_usersList.php')) {
|
||||
$filename = PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/data_usersList.php';
|
||||
include(PATH_TRUNK . 'workflow/engine/bin/tasks/cliWorkspaces.php');
|
||||
if (!file_exists(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php')) {
|
||||
$filename = PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php';
|
||||
$handle = fopen($filename, 'w');
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
// This assert the data_usersList.php file do exists before being deleted
|
||||
$this->assertTrue(file_exists(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/data_usersList.php'));
|
||||
$this->assertTrue(file_exists(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php'));
|
||||
|
||||
$path = PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/';
|
||||
$path = PATH_TRUNK . 'workflow/engine/methods/users/';
|
||||
|
||||
if (getmyuid() == fileowner($path)) {
|
||||
if (substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/data_usersList.php'),
|
||||
if (substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php'),
|
||||
1, 2) == 'rw' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/'), 2, 1) == 'w' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/'), 3, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/'), 3, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/'), 3, 1) == 'x'
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/methods/users/'), 2, 1) == 'w' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/methods/'), 3, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/'), 3, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/'), 3, 1) == 'x'
|
||||
) {
|
||||
remove_deprecated_files();
|
||||
} else {
|
||||
@@ -53,13 +53,13 @@ class CliWorkspacesTest extends TestCase
|
||||
}
|
||||
} else {
|
||||
if (getmygid() == filegroup($path)) {
|
||||
if (substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/data_usersList.php'),
|
||||
if (substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php'),
|
||||
4, 2) == 'rw' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/'), 5,
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/methods/users/'), 5,
|
||||
1) == 'w' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/'), 6, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/'), 6, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/'), 6, 1) == 'x'
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/methods/'), 6, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/'), 6, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/'), 6, 1) == 'x'
|
||||
) {
|
||||
remove_deprecated_files();
|
||||
} else {
|
||||
@@ -68,13 +68,13 @@ class CliWorkspacesTest extends TestCase
|
||||
}
|
||||
|
||||
} else {
|
||||
if (substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/data_usersList.php'),
|
||||
if (substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php'),
|
||||
7, 2) == 'rw' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/'), 8,
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/methods/users/'), 8,
|
||||
1) == 'w' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/'), 9, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/engine/'), 9, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . PATH_SEP . 'workflow/'), 9, 1) == 'x'
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/methods/'), 9, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/engine/'), 9, 1) == 'x' &&
|
||||
substr($this->getPermissions(PATH_TRUNK . 'workflow/'), 9, 1) == 'x'
|
||||
) {
|
||||
remove_deprecated_files();
|
||||
} else {
|
||||
@@ -85,7 +85,7 @@ class CliWorkspacesTest extends TestCase
|
||||
}
|
||||
|
||||
// This assert the data_usersList.php does not exist anymore
|
||||
$this->assertFalse(file_exists(PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/data_usersList.php'));
|
||||
$this->assertFalse(file_exists(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\unit\workflow\engine\classes\model;
|
||||
|
||||
use G;
|
||||
use OutputDocument;
|
||||
use ProcessMaker\Model\OutputDocument as OutputDocumentModel;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class OutputDocumentTest
|
||||
*
|
||||
* @coversDefaultClass \OutputDocument
|
||||
*/
|
||||
class OutputDocumentTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Review the generate pdf using TCPDF
|
||||
* @test
|
||||
* @covers \OutputDocument::generateTcpdf()
|
||||
*/
|
||||
public function it_should_generate_tcpdf()
|
||||
{
|
||||
// Create a register in the output document
|
||||
$output = factory(OutputDocumentModel::class)->create([
|
||||
'OUT_DOC_TEMPLATE' => '<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<body>
|
||||
<p>TEST OUTPUT DOCUMENT 内 </p>
|
||||
<p><font size="2" color="blue" face="verdana" style="text-align:center">this is some font</font></p>
|
||||
</body>
|
||||
</html>',
|
||||
]);
|
||||
|
||||
// Prepare the font arialuni.ttf
|
||||
$arialBkp = PATH_TRUNK . 'tests' . PATH_SEP . 'resources' . PATH_SEP . 'fonts' . PATH_SEP;
|
||||
$fonts = PATH_DATA . 'fonts' . PATH_SEP;
|
||||
if (!file_exists($fonts)) {
|
||||
G::mk_dir($fonts);
|
||||
}
|
||||
G::recursive_copy($arialBkp, $fonts);
|
||||
// Define the path for generate the pdf
|
||||
$appUid = G::generateUniqueID();
|
||||
$pathOutput = PATH_DB . config('system.workspace') . PATH_SEP . 'files' . G::getPathFromUID($appUid) . PATH_SEP . 'outdocs' . PATH_SEP;
|
||||
G::mk_dir($pathOutput);
|
||||
// Define some parameters
|
||||
$fields = [];
|
||||
$fields['USR_USERNAME'] = G::generateUniqueID();
|
||||
// Define some atributes for the pdf
|
||||
$properties = [];
|
||||
$properties['margins'] = [];
|
||||
$properties['margins']['left'] = 15;
|
||||
$properties['margins']['right'] = 15;
|
||||
$properties['margins']['top'] = 15;
|
||||
$properties['margins']['bottom'] = 15;
|
||||
$properties['pdfSecurity'] = true;
|
||||
// Call output document
|
||||
$outputDocument = new OutputDocument();
|
||||
$outputDocument->generateTcpdf(
|
||||
$output->OUT_DOC_UID,
|
||||
$fields,
|
||||
$pathOutput,
|
||||
$output->OUT_DOC_FILENAME,
|
||||
$output->OUT_DOC_TEMPLATE,
|
||||
false,
|
||||
$properties
|
||||
);
|
||||
$this->assertFileExists($pathOutput . $output->OUT_DOC_FILENAME . '.pdf');
|
||||
// Remove the shared folder
|
||||
G::rm_dir($fonts);
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ class UsersAjaxTest extends TestCase
|
||||
ob_start();
|
||||
|
||||
//Call the tested file
|
||||
require_once PATH_TRUNK . PATH_SEP . 'workflow/engine/methods/users/usersAjax.php';
|
||||
require_once PATH_TRUNK . 'workflow/engine/methods/users/usersAjax.php';
|
||||
|
||||
//Return the contents of the output buffer
|
||||
$outputBuffer = ob_get_contents();
|
||||
|
||||
@@ -13,7 +13,7 @@ class GranularImporterTest extends TestCase
|
||||
*/
|
||||
public function importDataObject()
|
||||
{
|
||||
$filename = PATH_TRUNK . "/tests/resources/GranularImporterTest.json";
|
||||
$filename = PATH_TRUNK . "tests/resources/GranularImporterTest.json";
|
||||
$json = file_get_contents($filename);
|
||||
$data = json_decode($json, true);
|
||||
return $data;
|
||||
|
||||
@@ -37,7 +37,7 @@ class XmlImporterTest extends TestCase
|
||||
*/
|
||||
public function it_should_matter_with_import_option_create_new_and_group_import_option_create_new()
|
||||
{
|
||||
$filename = PATH_TRUNK . "/tests/resources/p1normal-1.pmx";
|
||||
$filename = PATH_TRUNK . "tests/resources/p1normal-1.pmx";
|
||||
$importer = new XmlImporter();
|
||||
$importer->setData("usr_uid", $this->user->USR_UID);
|
||||
$importer->setSourceFile($filename);
|
||||
@@ -59,7 +59,7 @@ class XmlImporterTest extends TestCase
|
||||
'GRP_TITLE' => 'group2'
|
||||
]);
|
||||
$regenerateUids = false;
|
||||
$filename = PATH_TRUNK . "/tests/resources/p1normal-1.pmx";
|
||||
$filename = PATH_TRUNK . "tests/resources/p1normal-1.pmx";
|
||||
$importer = new XmlImporter();
|
||||
$importer->setData("usr_uid", $this->user->USR_UID);
|
||||
$importer->setSourceFile($filename);
|
||||
@@ -80,7 +80,7 @@ class XmlImporterTest extends TestCase
|
||||
factory(\ProcessMaker\Model\Groupwf::class)->create([
|
||||
'GRP_TITLE' => 'group2'
|
||||
]);
|
||||
$filename = PATH_TRUNK . "/tests/resources/p1normal-1.pmx";
|
||||
$filename = PATH_TRUNK . "tests/resources/p1normal-1.pmx";
|
||||
$importer = new XmlImporter();
|
||||
$importer->setData("usr_uid", $this->user->USR_UID);
|
||||
$importer->setSourceFile($filename);
|
||||
@@ -96,9 +96,9 @@ class XmlImporterTest extends TestCase
|
||||
*/
|
||||
public function it_should_matter_with_import_option_create_new_and_group_import_option_create_new_and_objects_import()
|
||||
{
|
||||
$filename = PATH_TRUNK . "/tests/resources/p2custom-1.pmx2";
|
||||
$filename = PATH_TRUNK . "tests/resources/p2custom-1.pmx2";
|
||||
|
||||
$objectsToImportFilename = PATH_TRUNK . "/tests/resources/p2custom-1-ObjectsToImport.json";
|
||||
$objectsToImportFilename = PATH_TRUNK . "tests/resources/p2custom-1-ObjectsToImport.json";
|
||||
$json = file_get_contents($objectsToImportFilename);
|
||||
$objectsToImport = json_decode($json);
|
||||
|
||||
@@ -117,9 +117,9 @@ class XmlImporterTest extends TestCase
|
||||
public function it_should_matter_with_import_option_keep_without_changing_and_create_new_and_group_import_option_create_new()
|
||||
{
|
||||
$regenerateUids = false;
|
||||
$filename = PATH_TRUNK . "/tests/resources/p2custom-1.pmx2";
|
||||
$filename = PATH_TRUNK . "tests/resources/p2custom-1.pmx2";
|
||||
|
||||
$objectsToImportFilename = PATH_TRUNK . "/tests/resources/p2custom-1-ObjectsToImport.json";
|
||||
$objectsToImportFilename = PATH_TRUNK . "tests/resources/p2custom-1-ObjectsToImport.json";
|
||||
$json = file_get_contents($objectsToImportFilename);
|
||||
$objectsToImport = json_decode($json);
|
||||
|
||||
@@ -137,9 +137,9 @@ class XmlImporterTest extends TestCase
|
||||
*/
|
||||
public function it_should_matter_with_import_option_overwrite_and_group_import_option_create_new()
|
||||
{
|
||||
$filename = PATH_TRUNK . "/tests/resources/p2custom-1.pmx2";
|
||||
$filename = PATH_TRUNK . "tests/resources/p2custom-1.pmx2";
|
||||
|
||||
$objectsToImportFilename = PATH_TRUNK . "/tests/resources/p2custom-1-ObjectsToImport.json";
|
||||
$objectsToImportFilename = PATH_TRUNK . "tests/resources/p2custom-1-ObjectsToImport.json";
|
||||
$json = file_get_contents($objectsToImportFilename);
|
||||
$objectsToImport = json_decode($json);
|
||||
|
||||
@@ -158,9 +158,9 @@ class XmlImporterTest extends TestCase
|
||||
public function it_should_matter_with_import_option_disable_and_create_new_and_group_import_option_create_new()
|
||||
{
|
||||
$regenerateUids = false;
|
||||
$filename = PATH_TRUNK . "/tests/resources/p2custom-1.pmx2";
|
||||
$filename = PATH_TRUNK . "tests/resources/p2custom-1.pmx2";
|
||||
|
||||
$objectsToImportFilename = PATH_TRUNK . "/tests/resources/p2custom-1-ObjectsToImport.json";
|
||||
$objectsToImportFilename = PATH_TRUNK . "tests/resources/p2custom-1-ObjectsToImport.json";
|
||||
$json = file_get_contents($objectsToImportFilename);
|
||||
$objectsToImport = json_decode($json);
|
||||
|
||||
@@ -178,7 +178,7 @@ class XmlImporterTest extends TestCase
|
||||
*/
|
||||
public function it_should_matter_with_import_option_create_new_and_group_import_option_create_new_with_exception()
|
||||
{
|
||||
$filename = PATH_TRUNK . "/tests/resources/p1normal-1.pmx";
|
||||
$filename = PATH_TRUNK . "tests/resources/p1normal-1.pmx";
|
||||
$importer = new XmlImporter();
|
||||
$importer->setData("usr_uid", $this->user->USR_UID);
|
||||
$importer->setSourceFile($filename);
|
||||
@@ -202,7 +202,7 @@ class XmlImporterTest extends TestCase
|
||||
factory(\ProcessMaker\Model\Groupwf::class)->create([
|
||||
'GRP_TITLE' => 'group2'
|
||||
]);
|
||||
$filename = PATH_TRUNK . "/tests/resources/p1normal-1.pmx";
|
||||
$filename = PATH_TRUNK . "tests/resources/p1normal-1.pmx";
|
||||
$importer = new XmlImporter();
|
||||
$importer->setData("usr_uid", $this->user->USR_UID);
|
||||
$importer->setSourceFile($filename);
|
||||
@@ -219,7 +219,7 @@ class XmlImporterTest extends TestCase
|
||||
*/
|
||||
public function it_should_matter_with_import_option_create_new_and_group_import_option_create_new_try_exception()
|
||||
{
|
||||
$filename = PATH_TRUNK . "/tests/resources/p1normalWithException-1.pmx";
|
||||
$filename = PATH_TRUNK . "tests/resources/p1normalWithException-1.pmx";
|
||||
$importer = new XmlImporter();
|
||||
$importer->setData("usr_uid", $this->user->USR_UID);
|
||||
$importer->setSourceFile($filename);
|
||||
@@ -241,7 +241,7 @@ class XmlImporterTest extends TestCase
|
||||
'PRO_TITLE' => 'p1normalWithoutTitle'
|
||||
]);
|
||||
|
||||
$filename = PATH_TRUNK . "/tests/resources/p1normalWithoutTitle-1.pmx";
|
||||
$filename = PATH_TRUNK . "tests/resources/p1normalWithoutTitle-1.pmx";
|
||||
$importer = new XmlImporter();
|
||||
$importer->setData("usr_uid", $this->user->USR_UID);
|
||||
$importer->setSourceFile($filename);
|
||||
@@ -253,7 +253,7 @@ class XmlImporterTest extends TestCase
|
||||
'PRO_TITLE' => 'p1normalWithoutTitle2'
|
||||
]);
|
||||
|
||||
$filename = PATH_TRUNK . "/tests/resources/p1normalWithoutTitle2-1.pmx";
|
||||
$filename = PATH_TRUNK . "tests/resources/p1normalWithoutTitle2-1.pmx";
|
||||
$importer = new XmlImporter();
|
||||
$importer->setData("usr_uid", $this->user->USR_UID);
|
||||
$importer->setSourceFile($filename);
|
||||
|
||||
@@ -108,7 +108,7 @@ class BpmnWorkflowTest extends TestCase
|
||||
{
|
||||
$faker = Factory::create();
|
||||
|
||||
$projectDataFilename = PATH_TRUNK . "/tests/resources/projectData.json";
|
||||
$projectDataFilename = PATH_TRUNK . "tests/resources/projectData.json";
|
||||
$json = file_get_contents($projectDataFilename);
|
||||
$projectData = json_decode($json, JSON_OBJECT_AS_ARRAY);
|
||||
$projectData['prj_uid'] = G::generateUniqueID();
|
||||
@@ -127,7 +127,7 @@ class BpmnWorkflowTest extends TestCase
|
||||
{
|
||||
$faker = Factory::create();
|
||||
|
||||
$projectDataFilename = PATH_TRUNK . "/tests/resources/projectData.json";
|
||||
$projectDataFilename = PATH_TRUNK . "tests/resources/projectData.json";
|
||||
$json = file_get_contents($projectDataFilename);
|
||||
$projectData = json_decode($json, JSON_OBJECT_AS_ARRAY);
|
||||
$projectData['prj_uid'] = G::generateUniqueID();
|
||||
@@ -150,7 +150,7 @@ class BpmnWorkflowTest extends TestCase
|
||||
{
|
||||
$faker = Factory::create();
|
||||
|
||||
$projectDataFilename = PATH_TRUNK . "/tests/resources/projectData.json";
|
||||
$projectDataFilename = PATH_TRUNK . "tests/resources/projectData.json";
|
||||
$json = file_get_contents($projectDataFilename);
|
||||
$projectData = json_decode($json, JSON_OBJECT_AS_ARRAY);
|
||||
$projectData['prj_uid'] = G::generateUniqueID();
|
||||
@@ -179,7 +179,7 @@ class BpmnWorkflowTest extends TestCase
|
||||
{
|
||||
$faker = Factory::create();
|
||||
|
||||
$projectDataFilename = PATH_TRUNK . "/tests/resources/projectData.json";
|
||||
$projectDataFilename = PATH_TRUNK . "tests/resources/projectData.json";
|
||||
$json = file_get_contents($projectDataFilename);
|
||||
$projectData = json_decode($json, JSON_OBJECT_AS_ARRAY);
|
||||
$projectData['prj_uid'] = G::generateUniqueID();
|
||||
@@ -203,7 +203,7 @@ class BpmnWorkflowTest extends TestCase
|
||||
{
|
||||
$faker = Factory::create();
|
||||
|
||||
$projectDataFilename = PATH_TRUNK . "/tests/resources/projectData.json";
|
||||
$projectDataFilename = PATH_TRUNK . "tests/resources/projectData.json";
|
||||
$json = file_get_contents($projectDataFilename);
|
||||
$projectData = json_decode($json, JSON_OBJECT_AS_ARRAY);
|
||||
$projectData['prj_uid'] = G::generateUniqueID();
|
||||
@@ -227,7 +227,7 @@ class BpmnWorkflowTest extends TestCase
|
||||
{
|
||||
$faker = Factory::create();
|
||||
|
||||
$projectDataFilename = PATH_TRUNK . "/tests/resources/projectData.json";
|
||||
$projectDataFilename = PATH_TRUNK . "tests/resources/projectData.json";
|
||||
$json = file_get_contents($projectDataFilename);
|
||||
$projectData = json_decode($json, JSON_OBJECT_AS_ARRAY);
|
||||
$projectData['prj_uid'] = G::generateUniqueID();
|
||||
|
||||
@@ -27,7 +27,7 @@ class ProjectTest extends TestCase
|
||||
*/
|
||||
public function it_should_set_the_process_owner_with_invalid_value()
|
||||
{
|
||||
$filename = PATH_TRUNK . "/tests/resources/p1normal-2.pmx";
|
||||
$filename = PATH_TRUNK . "tests/resources/p1normal-2.pmx";
|
||||
$importer = new XmlImporter();
|
||||
$importer->setData("usr_uid", $this->user->USR_UID);
|
||||
$importer->setSourceFile($filename);
|
||||
|
||||
@@ -928,8 +928,10 @@ class OutputDocument extends BaseOutputDocument
|
||||
if (preg_match('/[\x{30FF}\x{3040}-\x{309F}\x{4E00}-\x{9FFF}\x{0E00}-\x{0E7F}]/u', $content, $matches)) {
|
||||
// The additional fonts should be in "shared/fonts" folder
|
||||
$fileArialUniTTF = PATH_DATA . "fonts" . PATH_SEP . "arialuni.ttf";
|
||||
$pdf->SetFont((!file_exists($fileArialUniTTF)) ? "kozminproregular" :
|
||||
$pdf->addTTFfont($fileArialUniTTF, "TrueTypeUnicode", "", 32));
|
||||
if (file_exists($fileArialUniTTF)) {
|
||||
$font = TCPDF_FONTS::addTTFfont($fileArialUniTTF, 'TrueTypeUnicode');
|
||||
$pdf->SetFont($font);
|
||||
}
|
||||
}
|
||||
|
||||
// Convert the encoding of the content if is UTF-8
|
||||
|
||||
Reference in New Issue
Block a user