Merged in bugfix/PMCORE-3971 (pull request #8565)
PMCORE-3971 (remove conflicts with develop branch) 3.8.x: Solve the conflicts to merge this epic into develop Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
4081
composer.lock
generated
4081
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,34 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class DelegationFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$user = \ProcessMaker\Model\User::factory()->create();
|
||||
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||
$task = \ProcessMaker\Model\Task::factory()->create([
|
||||
$factory->define(\ProcessMaker\Model\Delegation::class, function(Faker $faker) {
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID
|
||||
]);
|
||||
$application = \ProcessMaker\Model\Application::factory()->create([
|
||||
$application = factory(\ProcessMaker\Model\Application::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_CUR_USER' => $user->USR_UID
|
||||
]);
|
||||
// Return with default values
|
||||
return [
|
||||
'DELEGATION_ID' => $this->faker->unique()->numberBetween(5000),
|
||||
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 1,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -39,53 +27,49 @@ class DelegationFactory extends Factory
|
||||
'DEL_TYPE' => 'NORMAL',
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_PRIORITY' => 3,
|
||||
'DEL_DELEGATE_DATE' => $this->faker->dateTime(),
|
||||
'DEL_INIT_DATE' => $this->faker->dateTime(),
|
||||
'DEL_TASK_DUE_DATE' => $this->faker->dateTime(),
|
||||
'DEL_RISK_DATE' => $this->faker->dateTime(),
|
||||
'DEL_DELEGATE_DATE' => $faker->dateTime(),
|
||||
'DEL_INIT_DATE' => $faker->dateTime(),
|
||||
'DEL_TASK_DUE_DATE' => $faker->dateTime(),
|
||||
'DEL_RISK_DATE' => $faker->dateTime(),
|
||||
'DEL_LAST_INDEX' => 0,
|
||||
'USR_ID' => $user->USR_ID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_DATA' => '',
|
||||
'DEL_TITLE' => $this->faker->word()
|
||||
'DEL_TITLE' => $faker->word()
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Create a delegation with the foreign keys
|
||||
* @return type
|
||||
*/
|
||||
public function foreign_keys()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// Create a delegation with the foreign keys
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'foreign_keys', function (Faker $faker) {
|
||||
// Create values in the foreign key relations
|
||||
$user = \ProcessMaker\Model\User::factory()->create();
|
||||
$category = \ProcessMaker\Model\ProcessCategory::factory()->create();
|
||||
$process = \ProcessMaker\Model\Process::factory()->create([
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$category = factory(\ProcessMaker\Model\ProcessCategory::class)->create();
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create([
|
||||
'PRO_CATEGORY' => $category->CATEGORY_UID,
|
||||
'CATEGORY_ID' => $category->CATEGORY_ID
|
||||
]);
|
||||
$task = \ProcessMaker\Model\Task::factory()->create([
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID
|
||||
]);
|
||||
$application = \ProcessMaker\Model\Application::factory()->create([
|
||||
$application = factory(\ProcessMaker\Model\Application::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_CUR_USER' => $user->USR_UID
|
||||
]);
|
||||
|
||||
$delegateDate = $this->faker->dateTime();
|
||||
$initDate = $this->faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $this->faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $this->faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
$index = $this->faker->unique()->numberBetween(2000);
|
||||
$delegateDate = $faker->dateTime();
|
||||
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
$index = $faker->unique()->numberBetween(2000);
|
||||
|
||||
// Return with default values
|
||||
return [
|
||||
'DELEGATION_ID' => $this->faker->unique()->numberBetween(5000),
|
||||
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => $index,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -96,6 +80,7 @@ class DelegationFactory extends Factory
|
||||
'DEL_TYPE' => 'NORMAL',
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_PRIORITY' => 3,
|
||||
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||
'DEL_INIT_DATE' => $initDate,
|
||||
@@ -106,31 +91,24 @@ class DelegationFactory extends Factory
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_DATA' => '',
|
||||
'DEL_TITLE' => $this->faker->word()
|
||||
'DEL_TITLE' => $faker->word()
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Create a delegation with the foreign keys
|
||||
* @return type
|
||||
*/
|
||||
public function web_entry()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// Create a delegation with the foreign keys
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'web_entry', function (Faker $faker) {
|
||||
// Create values in the foreign key relations
|
||||
$user = \ProcessMaker\Model\User::factory()->create();
|
||||
$category = \ProcessMaker\Model\ProcessCategory::factory()->create();
|
||||
$process = \ProcessMaker\Model\Process::factory()->create([
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$category = factory(\ProcessMaker\Model\ProcessCategory::class)->create();
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create([
|
||||
'PRO_CATEGORY' => $category->CATEGORY_UID,
|
||||
'CATEGORY_ID' => $category->CATEGORY_ID
|
||||
]);
|
||||
$task = \ProcessMaker\Model\Task::factory()->create([
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID
|
||||
]);
|
||||
$application = \ProcessMaker\Model\Application::factory()->web_entry()->create([
|
||||
$application = factory(\ProcessMaker\Model\Application::class)->states('web_entry')->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_CUR_USER' => $user->USR_UID
|
||||
@@ -138,7 +116,7 @@ class DelegationFactory extends Factory
|
||||
|
||||
// Return with default values
|
||||
return [
|
||||
'DELEGATION_ID' => $this->faker->unique()->numberBetween(5000),
|
||||
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 1,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -149,59 +127,47 @@ class DelegationFactory extends Factory
|
||||
'DEL_TYPE' => 'NORMAL',
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_PRIORITY' => 3,
|
||||
'DEL_DELEGATE_DATE' => $this->faker->dateTime(),
|
||||
'DEL_INIT_DATE' => $this->faker->dateTime(),
|
||||
'DEL_TASK_DUE_DATE' => $this->faker->dateTime(),
|
||||
'DEL_RISK_DATE' => $this->faker->dateTime(),
|
||||
'DEL_DELEGATE_DATE' => $faker->dateTime(),
|
||||
'DEL_INIT_DATE' => $faker->dateTime(),
|
||||
'DEL_TASK_DUE_DATE' => $faker->dateTime(),
|
||||
'DEL_RISK_DATE' => $faker->dateTime(),
|
||||
'USR_ID' => $user->USR_ID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_DATA' => '',
|
||||
'DEL_TITLE' => $this->faker->word()
|
||||
'DEL_TITLE' => $faker->word()
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Create a open delegation
|
||||
* @return type
|
||||
*/
|
||||
public function open()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// Create a open delegation
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'open', function (Faker $faker) {
|
||||
// Create dates with sense
|
||||
$delegateDate = $this->faker->dateTime();
|
||||
$initDate = $this->faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $this->faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $this->faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
$delegateDate = $faker->dateTime();
|
||||
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
|
||||
return [
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||
'DEL_INIT_DATE' => $initDate,
|
||||
'DEL_RISK_DATE' => $riskDate,
|
||||
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||
'DEL_FINISH_DATE' => null
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Create a closed delegation
|
||||
* @return type
|
||||
*/
|
||||
public function closed()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// Create a closed delegation
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'closed', function (Faker $faker) {
|
||||
// Create dates with sense
|
||||
$delegateDate = $this->faker->dateTime();
|
||||
$initDate = $this->faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $this->faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $this->faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
$finishDate = $this->faker->dateTimeInInterval($initDate, '+10 days');
|
||||
$delegateDate = $faker->dateTime();
|
||||
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
$finishDate = $faker->dateTimeInInterval($initDate, '+10 days');
|
||||
|
||||
return [
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
@@ -211,37 +177,21 @@ class DelegationFactory extends Factory
|
||||
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||
'DEL_FINISH_DATE' => $finishDate
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
});
|
||||
|
||||
// Create a last delegation
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'last_thread', function (Faker $faker) {
|
||||
|
||||
/**
|
||||
* Create a last delegation
|
||||
* @return type
|
||||
*/
|
||||
public function last_thread()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
return [
|
||||
'DEL_LAST_INDEX' => 1,
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
});
|
||||
|
||||
// Create a first delegation
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'first_thread', function (Faker $faker) {
|
||||
|
||||
/**
|
||||
* Create a first delegation
|
||||
* @return type
|
||||
*/
|
||||
public function first_thread()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
return [
|
||||
'DEL_INDEX' => 1,
|
||||
'DEL_PREVIOUS' => 0,
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,46 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class WebEntryFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
/**
|
||||
* Model factory for web entries
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\WebEntry::class, function(Faker $faker) {
|
||||
return [
|
||||
'WE_UID' => G::generateUniqueID(),
|
||||
'PRO_UID' => G::generateUniqueID(),
|
||||
'TAS_UID' => G::generateUniqueID(),
|
||||
'DYN_UID' => G::generateUniqueID(),
|
||||
'USR_UID' => G::generateUniqueID(),
|
||||
'WE_METHOD' => $this->faker->randomElement(['WS', 'HTML']),
|
||||
'WE_INPUT_DOCUMENT_ACCESS' => $this->faker->randomElement([0, 1]),
|
||||
'WE_METHOD' => $faker->randomElement(['WS', 'HTML']),
|
||||
'WE_INPUT_DOCUMENT_ACCESS' => $faker->randomElement([0, 1]),
|
||||
'WE_DATA' => G::generateUniqueID() . '.php',
|
||||
'WE_CREATE_USR_UID' => G::generateUniqueID(),
|
||||
'WE_UPDATE_USR_UID' => G::generateUniqueID(),
|
||||
'WE_CREATE_DATE' => $this->faker->date('Y-m-d H:i:s', 'now'),
|
||||
'WE_UPDATE_DATE' => $this->faker->date('Y-m-d H:i:s', 'now'),
|
||||
'WE_TYPE' => $this->faker->randomElement(['SINGLE', 'MULTIPLE']),
|
||||
'WE_CUSTOM_TITLE' => $this->faker->words(5, true),
|
||||
'WE_AUTHENTICATION' => $this->faker->randomElement(['LOGIN_REQUIRED', 'ANONYMOUS']),
|
||||
'WE_HIDE_INFORMATION_BAR' => $this->faker->randomElement(['0', '1']),
|
||||
'WE_CALLBACK' => $this->faker->randomElement(['PROCESSMAKER', 'CUSTOM', 'CUSTOM_CLEAR']),
|
||||
'WE_CALLBACK_URL' => $this->faker->url,
|
||||
'WE_LINK_GENERATION' => $this->faker->randomElement(['DEFAULT', 'ADVANCED']),
|
||||
'WE_CREATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
||||
'WE_UPDATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
||||
'WE_TYPE' => $faker->randomElement(['SINGLE', 'MULTIPLE']),
|
||||
'WE_CUSTOM_TITLE' => $faker->words(5, true),
|
||||
'WE_AUTHENTICATION' => $faker->randomElement(['LOGIN_REQUIRED', 'ANONYMOUS']),
|
||||
'WE_HIDE_INFORMATION_BAR' => $faker->randomElement(['0', '1']),
|
||||
'WE_HIDE_ACTIVE_SESSION_WARNING' => $faker->randomElement(['0', '1']),
|
||||
'WE_CALLBACK' => $faker->randomElement(['PROCESSMAKER', 'CUSTOM', 'CUSTOM_CLEAR']),
|
||||
'WE_CALLBACK_URL' => $faker->url,
|
||||
'WE_LINK_GENERATION' => $faker->randomElement(['DEFAULT', 'ADVANCED']),
|
||||
'WE_LINK_SKIN' => 'classic',
|
||||
'WE_LINK_LANGUAGE' => 'en',
|
||||
'WE_LINK_DOMAIN' => $this->faker->domainName,
|
||||
'WE_SHOW_IN_NEW_CASE' => $this->faker->randomElement(['0', '1'])
|
||||
'WE_LINK_DOMAIN' => $faker->domainName,
|
||||
'WE_SHOW_IN_NEW_CASE' => $faker->randomElement(['0', '1'])
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ class ServerTest extends TestCase
|
||||
/**
|
||||
* Setup method.
|
||||
*/
|
||||
public function setUp(): void
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->server = $_SERVER;
|
||||
@@ -29,7 +29,7 @@ class ServerTest extends TestCase
|
||||
/**
|
||||
* Teardown method.
|
||||
*/
|
||||
public function tearDown(): void
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
$_SERVER = $this->server;
|
||||
@@ -42,8 +42,8 @@ class ServerTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_post_token_with_valid_credentials()
|
||||
{
|
||||
$user = User::where('USR_ID', '=', 1)->get()->first();
|
||||
$oauthClients = OauthClients::factory()->create([
|
||||
$user = User::where('USR_ID', '=', 1)->first();
|
||||
$oauthClients = factory(OauthClients::class)->create([
|
||||
"USR_UID" => $user->USR_UID
|
||||
]);
|
||||
|
||||
@@ -80,8 +80,8 @@ class ServerTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_post_token_with_return_handle_token()
|
||||
{
|
||||
$user = User::where('USR_ID', '=', 1)->get()->first();
|
||||
$oauthClients = OauthClients::factory()->create([
|
||||
$user = User::where('USR_ID', '=', 1)->first();
|
||||
$oauthClients = factory(OauthClients::class)->create([
|
||||
"USR_UID" => $user->USR_UID
|
||||
]);
|
||||
|
||||
@@ -116,8 +116,8 @@ class ServerTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_post_token_with_empty_client_id()
|
||||
{
|
||||
$user = User::where('USR_ID', '=', 1)->get()->first();
|
||||
$oauthClients = OauthClients::factory()->create([
|
||||
$user = User::where('USR_ID', '=', 1)->first();
|
||||
$oauthClients = factory(OauthClients::class)->create([
|
||||
"USR_UID" => $user->USR_UID
|
||||
]);
|
||||
|
||||
@@ -155,8 +155,8 @@ class ServerTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_post_token_for_pm_client_id()
|
||||
{
|
||||
$user = User::where('USR_ID', '=', 1)->get()->first();
|
||||
$oauthClients = OauthClients::where('CLIENT_ID', '=', 'x-pm-local-client')->get()->first();
|
||||
$user = User::where('USR_ID', '=', 1)->first();
|
||||
$oauthClients = OauthClients::where('CLIENT_ID', '=', 'x-pm-local-client')->first();
|
||||
|
||||
$data = '{
|
||||
"grant_type":"password",
|
||||
@@ -202,7 +202,7 @@ class ServerTest extends TestCase
|
||||
file_put_contents($filename, $data);
|
||||
|
||||
LicenseManager::truncate();
|
||||
LicenseManager::factory()->create([
|
||||
factory(LicenseManager::class)->create([
|
||||
"LICENSE_DATA" => $data,
|
||||
"LICENSE_PATH" => $filename,
|
||||
"LICENSE_WORKSPACE" => env('MAIN_SYS_SYS')
|
||||
|
||||
7
thirdparty/phing/lib/Capsule.php
vendored
7
thirdparty/phing/lib/Capsule.php
vendored
@@ -140,14 +140,15 @@ class Capsule {
|
||||
}
|
||||
}
|
||||
|
||||
@ini_set('track_errors', true);
|
||||
include $__template;
|
||||
@ini_restore('track_errors');
|
||||
|
||||
// restore the include path
|
||||
ini_set('include_path', $__old_inc_path);
|
||||
|
||||
$lastError = error_get_last();
|
||||
if (!empty($lastError['message'])) {
|
||||
throw new Exception("Unable to parse template " . $__template . ": " . $lastError['message']);
|
||||
if (!empty($php_errormsg)) {
|
||||
throw new Exception("Unable to parse template " . $__template . ": " . $php_errormsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user