PMCORE-3880 PhpUnit: Error: Call to undefined function factory
This commit is contained in:
@@ -6,7 +6,7 @@ jobs:
|
|||||||
- image: devopsstacks/pm:n285-phpunit
|
- image: devopsstacks/pm:n285-phpunit
|
||||||
- image: circleci/mysql:8.0.13-ram
|
- image: circleci/mysql:8.0.13-ram
|
||||||
command: |
|
command: |
|
||||||
mysqld --default-authentication-plugin='mysql_native_password' --optimizer-switch='derived_merge=off' --sql-mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
|
mysqld --default-authentication-plugin='mysql_native_password' --optimizer-switch='derived_merge=off' --sql-mode='NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' --collation-server='utf8mb4_unicode_ci' --character-set-server='utf8mb4'
|
||||||
environment:
|
environment:
|
||||||
MYSQL_HOST: 127.0.0.1
|
MYSQL_HOST: 127.0.0.1
|
||||||
MYSQL_ROOT_PASSWORD: 'password'
|
MYSQL_ROOT_PASSWORD: 'password'
|
||||||
@@ -27,7 +27,7 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Run Test Units
|
name: Run Test Units
|
||||||
command: |
|
command: |
|
||||||
mkdir coverage
|
mkdir -p coverage
|
||||||
vendor/phpunit/phpunit/phpunit --stop-on-error --testdox-html coverage/result.html --coverage-html coverage --verbose tests/unit/
|
vendor/phpunit/phpunit/phpunit --stop-on-error --testdox-html coverage/result.html --coverage-html coverage --verbose tests/unit/
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: coverage
|
path: coverage
|
||||||
|
|||||||
70
app/Factories/Factory.php
Normal file
70
app/Factories/Factory.php
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory as ParentFactory;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
abstract class Factory extends ParentFactory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Custom namespace for models.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public static $customNameSpaceForModels = 'ProcessMaker\\Model\\';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom directory for models.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public static $customDirectoryForModels = 'workflow/engine/src/ProcessMaker/Model/';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the factory name for the given model name.
|
||||||
|
*
|
||||||
|
* @param string $modelName
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function resolveFactoryName(string $modelName)
|
||||||
|
{
|
||||||
|
$resolver = static::$factoryNameResolver ?: function (string $modelName) {
|
||||||
|
$appNamespace = static::appNamespace();
|
||||||
|
|
||||||
|
$modelName = Str::startsWith($modelName, $appNamespace.'Models\\')
|
||||||
|
? Str::after($modelName, $appNamespace.'Models\\')
|
||||||
|
: (Str::startsWith($modelName, static::$customNameSpaceForModels)
|
||||||
|
? Str::after($modelName, static::$customNameSpaceForModels)
|
||||||
|
: Str::after($modelName, $appNamespace));
|
||||||
|
|
||||||
|
return static::$namespace.$modelName.'Factory';
|
||||||
|
};
|
||||||
|
|
||||||
|
return $resolver($modelName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name of the model that is generated by the factory.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function modelName()
|
||||||
|
{
|
||||||
|
$resolver = static::$modelNameResolver ?: function (self $factory) {
|
||||||
|
$namespacedFactoryBasename = Str::replaceLast(
|
||||||
|
'Factory', '', Str::replaceFirst(static::$namespace, '', get_class($factory))
|
||||||
|
);
|
||||||
|
|
||||||
|
$factoryBasename = Str::replaceLast('Factory', '', class_basename($factory));
|
||||||
|
|
||||||
|
$appNamespace = static::appNamespace();
|
||||||
|
|
||||||
|
return class_exists($appNamespace.'Models\\'.$namespacedFactoryBasename)
|
||||||
|
? $appNamespace.'Models\\'.$namespacedFactoryBasename
|
||||||
|
: (class_exists(static::$customNameSpaceForModels.$namespacedFactoryBasename)
|
||||||
|
? static::$customNameSpaceForModels.$namespacedFactoryBasename
|
||||||
|
: $appNamespace.$factoryBasename);
|
||||||
|
};
|
||||||
|
|
||||||
|
return $this->model ?: $resolver($this);
|
||||||
|
}
|
||||||
|
}
|
||||||
28
app/Factories/HasFactory.php
Normal file
28
app/Factories/HasFactory.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory as ParentHasFactory;
|
||||||
|
|
||||||
|
trait HasFactory
|
||||||
|
{
|
||||||
|
use ParentHasFactory
|
||||||
|
{
|
||||||
|
ParentHasFactory::factory as private parentFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a new factory instance for the model.
|
||||||
|
*
|
||||||
|
* @param mixed $parameters
|
||||||
|
* @return \App\Factories\Factory
|
||||||
|
*/
|
||||||
|
public static function factory(...$parameters)
|
||||||
|
{
|
||||||
|
$factory = static::newFactory() ?: Factory::factoryForModel(get_called_class());
|
||||||
|
|
||||||
|
return $factory
|
||||||
|
->count(is_numeric($parameters[0] ?? null) ? $parameters[0] : null)
|
||||||
|
->state(is_array($parameters[0] ?? null) ? $parameters[0] : ($parameters[1] ?? []));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -53,11 +53,11 @@
|
|||||||
"smarty/smarty": "2.6.31",
|
"smarty/smarty": "2.6.31",
|
||||||
"pdepend/pdepend": "@stable",
|
"pdepend/pdepend": "@stable",
|
||||||
"php-imap/php-imap": "^3.0",
|
"php-imap/php-imap": "^3.0",
|
||||||
"nikic/php-parser": "3.1.5",
|
"nikic/php-parser": "4.14",
|
||||||
"laravel/tinker": "^2.0",
|
"laravel/tinker": "^2.0",
|
||||||
"league/oauth2-client": "^2.4",
|
"league/oauth2-client": "^2.4",
|
||||||
"league/oauth2-google": "^3.0",
|
"league/oauth2-google": "^3.0",
|
||||||
"tecnickcom/tcpdf": "6.3.*",
|
"tecnickcom/tcpdf": "6.4.*",
|
||||||
"fzaninotto/faker": "^1.7",
|
"fzaninotto/faker": "^1.7",
|
||||||
"predis/predis": "1.1.1",
|
"predis/predis": "1.1.1",
|
||||||
"phpmyadmin/sql-parser": "^5.3",
|
"phpmyadmin/sql-parser": "^5.3",
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"guzzlehttp/guzzle": "^6.3",
|
"guzzlehttp/guzzle": "^6.3",
|
||||||
"phpunit/phpunit": "8.5.26",
|
"phpunit/phpunit": "9.5",
|
||||||
"filp/whoops": "~2.0",
|
"filp/whoops": "~2.0",
|
||||||
"behat/behat": "^3.3",
|
"behat/behat": "^3.3",
|
||||||
"behat/mink-selenium2-driver": "^1.3",
|
"behat/mink-selenium2-driver": "^1.3",
|
||||||
@@ -80,6 +80,7 @@
|
|||||||
},
|
},
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"App\\": "app/",
|
"App\\": "app/",
|
||||||
|
"Database\\Factories\\": "database/factories/",
|
||||||
"Maveriks\\": "framework/src/Maveriks/",
|
"Maveriks\\": "framework/src/Maveriks/",
|
||||||
"Tests\\": "tests/"
|
"Tests\\": "tests/"
|
||||||
},
|
},
|
||||||
|
|||||||
1446
composer.lock
generated
1446
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,35 +1,50 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\AbeConfiguration::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
use G;
|
||||||
$dynaform = factory(\ProcessMaker\Model\Dynaform::class)->create([
|
use Illuminate\Support\Str;
|
||||||
'PRO_UID' => $process->PRO_UID
|
|
||||||
]);
|
class AbeConfigurationFactory extends Factory
|
||||||
$task = factory(\ProcessMaker\Model\Task::class)->create([
|
{
|
||||||
'PRO_UID' => $process->PRO_UID
|
|
||||||
]);
|
/**
|
||||||
$emailServer = factory(\ProcessMaker\Model\EmailServerModel::class)->create();
|
* Define the model's default state.
|
||||||
return [
|
*
|
||||||
'ABE_UID' => G::generateUniqueID(),
|
* @return array
|
||||||
'PRO_UID' => $process->PRO_UID,
|
*/
|
||||||
'TAS_UID' => $task->TAS_UID,
|
public function definition()
|
||||||
'ABE_TYPE' => $faker->randomElement(['', 'LINK']),
|
{
|
||||||
'ABE_TEMPLATE' => 'actionByEmail.html',
|
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||||
'ABE_DYN_TYPE' => 'NORMAL',
|
$dynaform = \ProcessMaker\Model\Dynaform::factory()->create([
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
'PRO_UID' => $process->PRO_UID
|
||||||
'ABE_EMAIL_FIELD' => 'admin@processmaker.com',
|
]);
|
||||||
'ABE_ACTION_FIELD' => '',
|
$task = \ProcessMaker\Model\Task::factory()->create([
|
||||||
'ABE_CASE_NOTE_IN_RESPONSE' => $faker->randomElement(['0', '1']),
|
'PRO_UID' => $process->PRO_UID
|
||||||
'ABE_FORCE_LOGIN' => $faker->randomElement(['0', '1']),
|
]);
|
||||||
'ABE_CREATE_DATE' => $faker->dateTime(),
|
$emailServer = \ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||||
'ABE_UPDATE_DATE' => $faker->dateTime(),
|
return [
|
||||||
'ABE_SUBJECT_FIELD' => '',
|
'ABE_UID' => G::generateUniqueID(),
|
||||||
'ABE_MAILSERVER_OR_MAILCURRENT' => 0,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'ABE_CUSTOM_GRID' => serialize([]),
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'ABE_EMAIL_SERVER_UID' => $emailServer->MESS_UID,
|
'ABE_TYPE' => $this->faker->randomElement(['', 'LINK']),
|
||||||
'ABE_ACTION_BODY_FIELD' => '',
|
'ABE_TEMPLATE' => 'actionByEmail.html',
|
||||||
'ABE_EMAIL_SERVER_RECEIVER_UID' => ''
|
'ABE_DYN_TYPE' => 'NORMAL',
|
||||||
];
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
});
|
'ABE_EMAIL_FIELD' => 'admin@processmaker.com',
|
||||||
|
'ABE_ACTION_FIELD' => '',
|
||||||
|
'ABE_CASE_NOTE_IN_RESPONSE' => $this->faker->randomElement(['0', '1']),
|
||||||
|
'ABE_FORCE_LOGIN' => $this->faker->randomElement(['0', '1']),
|
||||||
|
'ABE_CREATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'ABE_UPDATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'ABE_SUBJECT_FIELD' => '',
|
||||||
|
'ABE_MAILSERVER_OR_MAILCURRENT' => 0,
|
||||||
|
'ABE_CUSTOM_GRID' => serialize([]),
|
||||||
|
'ABE_EMAIL_SERVER_UID' => $emailServer->MESS_UID,
|
||||||
|
'ABE_ACTION_BODY_FIELD' => '',
|
||||||
|
'ABE_EMAIL_SERVER_RECEIVER_UID' => ''
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,25 +1,40 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\AbeRequest::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
use G;
|
||||||
$abeConfiguration = factory(\ProcessMaker\Model\AbeConfiguration::class)->create([
|
use Illuminate\Support\Str;
|
||||||
'PRO_UID' => $process->PRO_UID
|
|
||||||
]);
|
class AbeRequestFactory extends Factory
|
||||||
$application = factory(\ProcessMaker\Model\Application::class)->create([
|
{
|
||||||
'PRO_UID' => $process->PRO_UID
|
|
||||||
]);
|
/**
|
||||||
return [
|
* Define the model's default state.
|
||||||
'ABE_REQ_UID' => G::generateUniqueID(),
|
*
|
||||||
'ABE_UID' => $abeConfiguration->ABE_UID,
|
* @return array
|
||||||
'APP_UID' => $application->APP_UID,
|
*/
|
||||||
'DEL_INDEX' => 0,
|
public function definition()
|
||||||
'ABE_REQ_SENT_TO' => $faker->email,
|
{
|
||||||
'ABE_REQ_SUBJECT' => '',
|
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||||
'ABE_REQ_BODY' => '',
|
$abeConfiguration = \ProcessMaker\Model\AbeConfiguration::factory()->create([
|
||||||
'ABE_REQ_DATE' => $faker->date(),
|
'PRO_UID' => $process->PRO_UID
|
||||||
'ABE_REQ_STATUS' => '',
|
]);
|
||||||
'ABE_REQ_ANSWERED' => $faker->numberBetween(1, 9)
|
$application = \ProcessMaker\Model\Application::factory()->create([
|
||||||
];
|
'PRO_UID' => $process->PRO_UID
|
||||||
});
|
]);
|
||||||
|
return [
|
||||||
|
'ABE_REQ_UID' => G::generateUniqueID(),
|
||||||
|
'ABE_UID' => $abeConfiguration->ABE_UID,
|
||||||
|
'APP_UID' => $application->APP_UID,
|
||||||
|
'DEL_INDEX' => 0,
|
||||||
|
'ABE_REQ_SENT_TO' => $this->faker->email,
|
||||||
|
'ABE_REQ_SUBJECT' => '',
|
||||||
|
'ABE_REQ_BODY' => '',
|
||||||
|
'ABE_REQ_DATE' => $this->faker->date(),
|
||||||
|
'ABE_REQ_STATUS' => '',
|
||||||
|
'ABE_REQ_ANSWERED' => $this->faker->numberBetween(1, 9)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,29 +1,44 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\AdditionalTables::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
$name = $faker->regexify("/[a-zA-Z]{6}/");
|
use G;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
'ADD_TAB_UID' => G::generateUniqueID(),
|
|
||||||
'ADD_TAB_NAME' => 'PMT_' . strtoupper($name),
|
class AdditionalTablesFactory extends Factory
|
||||||
'ADD_TAB_CLASS_NAME' => 'Pmt' . $name,
|
{
|
||||||
'ADD_TAB_DESCRIPTION' => $faker->text,
|
|
||||||
'ADD_TAB_SDW_LOG_INSERT' => 0,
|
/**
|
||||||
'ADD_TAB_SDW_LOG_UPDATE' => 0,
|
* Define the model's default state.
|
||||||
'ADD_TAB_SDW_LOG_DELETE' => 0,
|
*
|
||||||
'ADD_TAB_SDW_LOG_SELECT' => 0,
|
* @return array
|
||||||
'ADD_TAB_SDW_MAX_LENGTH' => 0,
|
*/
|
||||||
'ADD_TAB_SDW_AUTO_DELETE' => 0,
|
public function definition()
|
||||||
'ADD_TAB_PLG_UID' => '',
|
{
|
||||||
'DBS_UID' => 'workflow',
|
$name = $this->faker->regexify("/[a-zA-Z]{6}/");
|
||||||
'PRO_UID' => function() {
|
return [
|
||||||
return factory(\ProcessMaker\Model\Process::class)->create()->PRO_UID;
|
'ADD_TAB_UID' => G::generateUniqueID(),
|
||||||
},
|
'ADD_TAB_NAME' => 'PMT_' . strtoupper($name),
|
||||||
'ADD_TAB_TYPE' => '',
|
'ADD_TAB_CLASS_NAME' => 'Pmt' . $name,
|
||||||
'ADD_TAB_GRID' => '',
|
'ADD_TAB_DESCRIPTION' => $this->faker->text,
|
||||||
'ADD_TAB_TAG' => '',
|
'ADD_TAB_SDW_LOG_INSERT' => 0,
|
||||||
'ADD_TAB_OFFLINE' => 0,
|
'ADD_TAB_SDW_LOG_UPDATE' => 0,
|
||||||
'ADD_TAB_UPDATE_DATE' => $faker->dateTime()
|
'ADD_TAB_SDW_LOG_DELETE' => 0,
|
||||||
];
|
'ADD_TAB_SDW_LOG_SELECT' => 0,
|
||||||
});
|
'ADD_TAB_SDW_MAX_LENGTH' => 0,
|
||||||
|
'ADD_TAB_SDW_AUTO_DELETE' => 0,
|
||||||
|
'ADD_TAB_PLG_UID' => '',
|
||||||
|
'DBS_UID' => 'workflow',
|
||||||
|
'PRO_UID' => function () {
|
||||||
|
return \ProcessMaker\Model\Process::factory()->create()->PRO_UID;
|
||||||
|
},
|
||||||
|
'ADD_TAB_TYPE' => '',
|
||||||
|
'ADD_TAB_GRID' => '',
|
||||||
|
'ADD_TAB_TAG' => '',
|
||||||
|
'ADD_TAB_OFFLINE' => 0,
|
||||||
|
'ADD_TAB_UPDATE_DATE' => $this->faker->dateTime()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,18 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for a APP_ASSIGN_SELF_SERVICE_VALUE
|
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\AppAssignSelfServiceValue::class, function(Faker $faker) {
|
namespace Database\Factories;
|
||||||
return [
|
|
||||||
'ID' => $faker->unique()->numberBetween(5000),
|
|
||||||
'APP_UID' => G::generateUniqueID(),
|
|
||||||
'DEL_INDEX' => 2,
|
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
|
||||||
'TAS_UID' => G::generateUniqueID(),
|
|
||||||
'TAS_ID' => $faker->unique()->numberBetween(1, 2000),
|
|
||||||
'GRP_UID' => G::generateUniqueID(),
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
|
use App\Factories\Factory;
|
||||||
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class AppAssignSelfServiceValueFactory extends Factory
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'ID' => $this->faker->unique()->numberBetween(5000),
|
||||||
|
'APP_UID' => G::generateUniqueID(),
|
||||||
|
'DEL_INDEX' => 2,
|
||||||
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
|
'TAS_UID' => G::generateUniqueID(),
|
||||||
|
'TAS_ID' => $this->faker->unique()->numberBetween(1, 2000),
|
||||||
|
'GRP_UID' => G::generateUniqueID(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,15 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for a APP_ASSIGN_SELF_SERVICE_VALUE_GROUP
|
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\AppAssignSelfServiceValueGroup::class, function(Faker $faker) {
|
namespace Database\Factories;
|
||||||
return [
|
|
||||||
'ID' => $faker->unique()->numberBetween(5000),
|
|
||||||
'GRP_UID' => G::generateUniqueID(),
|
|
||||||
'ASSIGNEE_ID' => $faker->unique()->numberBetween(1, 2000),
|
|
||||||
'ASSIGNEE_TYPE' => $faker->unique()->numberBetween(1, 2000),
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
|
use App\Factories\Factory;
|
||||||
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class AppAssignSelfServiceValueGroupFactory extends Factory
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'ID' => $this->faker->unique()->numberBetween(5000),
|
||||||
|
'GRP_UID' => G::generateUniqueID(),
|
||||||
|
'ASSIGNEE_ID' => $this->faker->unique()->numberBetween(1, 2000),
|
||||||
|
'ASSIGNEE_TYPE' => $this->faker->unique()->numberBetween(1, 2000),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,62 +1,84 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\AppDelay::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
$actions = ['CANCEL', 'PAUSE', 'REASSIGN'];
|
use G;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
'APP_DELAY_UID' => G::generateUniqueID(),
|
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
|
||||||
'APP_UID' => G::generateUniqueID(),
|
|
||||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
|
||||||
'APP_THREAD_INDEX' => $faker->unique()->numberBetween(100),
|
|
||||||
'APP_DEL_INDEX' => $faker->unique()->numberBetween(100),
|
|
||||||
'APP_TYPE' => $faker->randomElement($actions),
|
|
||||||
'APP_STATUS' => 'TO_DO',
|
|
||||||
'APP_NEXT_TASK' => 0,
|
|
||||||
'APP_DELEGATION_USER' => G::generateUniqueID(),
|
|
||||||
'APP_ENABLE_ACTION_USER' => G::generateUniqueID(),
|
|
||||||
'APP_ENABLE_ACTION_DATE' => $faker->dateTime(),
|
|
||||||
'APP_DISABLE_ACTION_USER' => G::generateUniqueID(),
|
|
||||||
'APP_DISABLE_ACTION_DATE' => $faker->dateTime(),
|
|
||||||
'APP_AUTOMATIC_DISABLED_DATE' => '',
|
|
||||||
'APP_DELEGATION_USER_ID' => $faker->unique()->numberBetween(1000),
|
|
||||||
'PRO_ID' => $faker->unique()->numberBetween(1000),
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a delegation with the foreign keys
|
class AppDelayFactory extends Factory
|
||||||
$factory->state(\ProcessMaker\Model\AppDelay::class, 'paused_foreign_keys', function (Faker $faker) {
|
{
|
||||||
// Create values in the foreign key relations
|
|
||||||
$delegation1 = factory(\ProcessMaker\Model\Delegation::class)->states('closed')->create();
|
|
||||||
$delegation2 = factory(\ProcessMaker\Model\Delegation::class)->states('foreign_keys')->create([
|
|
||||||
'PRO_UID' => $delegation1->PRO_UID,
|
|
||||||
'PRO_ID' => $delegation1->PRO_ID,
|
|
||||||
'TAS_UID' => $delegation1->TAS_UID,
|
|
||||||
'TAS_ID' => $delegation1->TAS_ID,
|
|
||||||
'APP_NUMBER' => $delegation1->APP_NUMBER,
|
|
||||||
'APP_UID' => $delegation1->APP_UID,
|
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
|
||||||
'USR_UID' => $delegation1->USR_UID,
|
|
||||||
'USR_ID' => $delegation1->USR_ID,
|
|
||||||
'DEL_PREVIOUS' => $delegation1->DEL_INDEX,
|
|
||||||
'DEL_INDEX' => $faker->unique()->numberBetween(2000),
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Return with default values
|
/**
|
||||||
return [
|
* Define the model's default state.
|
||||||
'APP_DELAY_UID' => G::generateUniqueID(),
|
*
|
||||||
'PRO_UID' => $delegation2->PRO_UID,
|
* @return array
|
||||||
'PRO_ID' => $delegation2->PRO_ID,
|
*/
|
||||||
'APP_UID' => $delegation2->APP_UID,
|
public function definition()
|
||||||
'APP_NUMBER' => $delegation2->APP_NUMBER,
|
{
|
||||||
'APP_DEL_INDEX' => $delegation2->DEL_INDEX,
|
$actions = ['CANCEL', 'PAUSE', 'REASSIGN'];
|
||||||
'APP_TYPE' => 'PAUSE',
|
return [
|
||||||
'APP_STATUS' => 'TO_DO',
|
'APP_DELAY_UID' => G::generateUniqueID(),
|
||||||
'APP_DELEGATION_USER' => $delegation2->USR_UID,
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
'APP_DELEGATION_USER_ID' => $delegation2->USR_ID,
|
'APP_UID' => G::generateUniqueID(),
|
||||||
'APP_ENABLE_ACTION_USER' => G::generateUniqueID(),
|
'APP_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||||
'APP_ENABLE_ACTION_DATE' => $faker->dateTime(),
|
'APP_THREAD_INDEX' => $this->faker->unique()->numberBetween(100),
|
||||||
'APP_DISABLE_ACTION_USER' => 0,
|
'APP_DEL_INDEX' => $this->faker->unique()->numberBetween(100),
|
||||||
];
|
'APP_TYPE' => $this->faker->randomElement($actions),
|
||||||
});
|
'APP_STATUS' => 'TO_DO',
|
||||||
|
'APP_NEXT_TASK' => 0,
|
||||||
|
'APP_DELEGATION_USER' => G::generateUniqueID(),
|
||||||
|
'APP_ENABLE_ACTION_USER' => G::generateUniqueID(),
|
||||||
|
'APP_ENABLE_ACTION_DATE' => $this->faker->dateTime(),
|
||||||
|
'APP_DISABLE_ACTION_USER' => G::generateUniqueID(),
|
||||||
|
'APP_DISABLE_ACTION_DATE' => $this->faker->dateTime(),
|
||||||
|
'APP_AUTOMATIC_DISABLED_DATE' => '',
|
||||||
|
'APP_DELEGATION_USER_ID' => $this->faker->unique()->numberBetween(1000),
|
||||||
|
'PRO_ID' => $this->faker->unique()->numberBetween(1000),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a delegation with the foreign keys
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function paused_foreign_keys()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
// Create values in the foreign key relations
|
||||||
|
$delegation1 = \ProcessMaker\Model\Delegation::factory()->closed()->create();
|
||||||
|
$delegation2 = \ProcessMaker\Model\Delegation::factory()->foreign_keys()->create([
|
||||||
|
'PRO_UID' => $delegation1->PRO_UID,
|
||||||
|
'PRO_ID' => $delegation1->PRO_ID,
|
||||||
|
'TAS_UID' => $delegation1->TAS_UID,
|
||||||
|
'TAS_ID' => $delegation1->TAS_ID,
|
||||||
|
'APP_NUMBER' => $delegation1->APP_NUMBER,
|
||||||
|
'APP_UID' => $delegation1->APP_UID,
|
||||||
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
|
'USR_UID' => $delegation1->USR_UID,
|
||||||
|
'USR_ID' => $delegation1->USR_ID,
|
||||||
|
'DEL_PREVIOUS' => $delegation1->DEL_INDEX,
|
||||||
|
'DEL_INDEX' => $this->faker->unique()->numberBetween(2000),
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Return with default values
|
||||||
|
return [
|
||||||
|
'APP_DELAY_UID' => G::generateUniqueID(),
|
||||||
|
'PRO_UID' => $delegation2->PRO_UID,
|
||||||
|
'PRO_ID' => $delegation2->PRO_ID,
|
||||||
|
'APP_UID' => $delegation2->APP_UID,
|
||||||
|
'APP_NUMBER' => $delegation2->APP_NUMBER,
|
||||||
|
'APP_DEL_INDEX' => $delegation2->DEL_INDEX,
|
||||||
|
'APP_TYPE' => 'PAUSE',
|
||||||
|
'APP_STATUS' => 'TO_DO',
|
||||||
|
'APP_DELEGATION_USER' => $delegation2->USR_UID,
|
||||||
|
'APP_DELEGATION_USER_ID' => $delegation2->USR_ID,
|
||||||
|
'APP_ENABLE_ACTION_USER' => G::generateUniqueID(),
|
||||||
|
'APP_ENABLE_ACTION_DATE' => $this->faker->dateTime(),
|
||||||
|
'APP_DISABLE_ACTION_USER' => 0,
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,37 +1,52 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\AppMessage::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'APP_MSG_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'MSG_UID' => '',
|
|
||||||
'APP_UID' => function() {
|
class AppMessageFactory extends Factory
|
||||||
return factory(\ProcessMaker\Model\Application::class)->create()->APP_UID;
|
{
|
||||||
},
|
|
||||||
'DEL_INDEX' => 1,
|
/**
|
||||||
'APP_MSG_TYPE' => 'ROUTING',
|
* Define the model's default state.
|
||||||
'APP_MSG_TYPE_ID' => 0,
|
*
|
||||||
'APP_MSG_SUBJECT' => $faker->title,
|
* @return array
|
||||||
'APP_MSG_FROM' => $faker->email,
|
*/
|
||||||
'APP_MSG_TO' => $faker->email,
|
public function definition()
|
||||||
'APP_MSG_BODY' => $faker->text,
|
{
|
||||||
'APP_MSG_DATE' => $faker->dateTime(),
|
return [
|
||||||
'APP_MSG_CC' => '',
|
'APP_MSG_UID' => G::generateUniqueID(),
|
||||||
'APP_MSG_BCC' => '',
|
'MSG_UID' => '',
|
||||||
'APP_MSG_TEMPLATE' => '',
|
'APP_UID' => function () {
|
||||||
'APP_MSG_STATUS' => 'pending',
|
return \ProcessMaker\Model\Application::factory()->create()->APP_UID;
|
||||||
'APP_MSG_STATUS_ID' => 1,
|
},
|
||||||
'APP_MSG_ATTACH' => '',
|
'DEL_INDEX' => 1,
|
||||||
'APP_MSG_SEND_DATE' => $faker->dateTime(),
|
'APP_MSG_TYPE' => 'ROUTING',
|
||||||
'APP_MSG_SHOW_MESSAGE' => 1,
|
'APP_MSG_TYPE_ID' => 0,
|
||||||
'APP_MSG_ERROR' => '',
|
'APP_MSG_SUBJECT' => $this->faker->title,
|
||||||
'PRO_ID' => function() {
|
'APP_MSG_FROM' => $this->faker->email,
|
||||||
return factory(\ProcessMaker\Model\Process::class)->create()->PRO_ID;
|
'APP_MSG_TO' => $this->faker->email,
|
||||||
},
|
'APP_MSG_BODY' => $this->faker->text,
|
||||||
'TAS_ID' => function() {
|
'APP_MSG_DATE' => $this->faker->dateTime(),
|
||||||
return factory(\ProcessMaker\Model\Task::class)->create()->TAS_ID;
|
'APP_MSG_CC' => '',
|
||||||
},
|
'APP_MSG_BCC' => '',
|
||||||
'APP_NUMBER' => 1
|
'APP_MSG_TEMPLATE' => '',
|
||||||
];
|
'APP_MSG_STATUS' => 'pending',
|
||||||
});
|
'APP_MSG_STATUS_ID' => 1,
|
||||||
|
'APP_MSG_ATTACH' => '',
|
||||||
|
'APP_MSG_SEND_DATE' => $this->faker->dateTime(),
|
||||||
|
'APP_MSG_SHOW_MESSAGE' => 1,
|
||||||
|
'APP_MSG_ERROR' => '',
|
||||||
|
'PRO_ID' => function () {
|
||||||
|
return \ProcessMaker\Model\Process::factory()->create()->PRO_ID;
|
||||||
|
},
|
||||||
|
'TAS_ID' => function () {
|
||||||
|
return \ProcessMaker\Model\Task::factory()->create()->TAS_ID;
|
||||||
|
},
|
||||||
|
'APP_NUMBER' => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,42 +1,63 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\AppNotes::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'APP_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'APP_NUMBER' => $faker->unique()->numberBetween(5000),
|
|
||||||
'USR_UID' => G::generateUniqueID(),
|
|
||||||
'NOTE_DATE' => $faker->dateTime(),
|
|
||||||
'NOTE_CONTENT' => $faker->sentence(3),
|
|
||||||
'NOTE_TYPE' => 'USER',
|
|
||||||
'NOTE_AVAILABILITY' => 'PUBLIC',
|
|
||||||
'NOTE_ORIGIN_OBJ' => '',
|
|
||||||
'NOTE_AFFECTED_OBJ1' => '',
|
|
||||||
'NOTE_AFFECTED_OBJ2' => '',
|
|
||||||
'NOTE_RECIPIENTS' => '',
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a case notes with the foreign keys
|
class AppNotesFactory extends Factory
|
||||||
$factory->state(\ProcessMaker\Model\AppNotes::class, 'foreign_keys', function (Faker $faker) {
|
{
|
||||||
// Create values in the foreign key relations
|
|
||||||
$application = factory(\ProcessMaker\Model\Application::class)->create();
|
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
|
||||||
|
|
||||||
// Return with default values
|
/**
|
||||||
return [
|
* Define the model's default state.
|
||||||
'APP_UID' => $application->APP_UID,
|
*
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
* @return array
|
||||||
'USR_UID' => $user->USR_UID,
|
*/
|
||||||
'NOTE_DATE' => $faker->dateTime(),
|
public function definition()
|
||||||
'NOTE_CONTENT' => $faker->sentence(3),
|
{
|
||||||
'NOTE_TYPE' => 'USER',
|
return [
|
||||||
'NOTE_AVAILABILITY' => 'PUBLIC',
|
'APP_UID' => G::generateUniqueID(),
|
||||||
'NOTE_ORIGIN_OBJ' => '',
|
'APP_NUMBER' => $this->faker->unique()->numberBetween(5000),
|
||||||
'NOTE_AFFECTED_OBJ1' => '',
|
'USR_UID' => G::generateUniqueID(),
|
||||||
'NOTE_AFFECTED_OBJ2' => '',
|
'NOTE_DATE' => $this->faker->dateTime(),
|
||||||
'NOTE_RECIPIENTS' => '',
|
'NOTE_CONTENT' => $this->faker->sentence(3),
|
||||||
];
|
'NOTE_TYPE' => 'USER',
|
||||||
});
|
'NOTE_AVAILABILITY' => 'PUBLIC',
|
||||||
|
'NOTE_ORIGIN_OBJ' => '',
|
||||||
|
'NOTE_AFFECTED_OBJ1' => '',
|
||||||
|
'NOTE_AFFECTED_OBJ2' => '',
|
||||||
|
'NOTE_RECIPIENTS' => '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a case notes with the foreign keys
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function foreign_keys()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
// Create values in the foreign key relations
|
||||||
|
$application = \ProcessMaker\Model\Application::factory()->create();
|
||||||
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
|
|
||||||
|
// Return with default values
|
||||||
|
return [
|
||||||
|
'APP_UID' => $application->APP_UID,
|
||||||
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
|
'USR_UID' => $user->USR_UID,
|
||||||
|
'NOTE_DATE' => $this->faker->dateTime(),
|
||||||
|
'NOTE_CONTENT' => $this->faker->sentence(3),
|
||||||
|
'NOTE_TYPE' => 'USER',
|
||||||
|
'NOTE_AVAILABILITY' => 'PUBLIC',
|
||||||
|
'NOTE_ORIGIN_OBJ' => '',
|
||||||
|
'NOTE_AFFECTED_OBJ1' => '',
|
||||||
|
'NOTE_AFFECTED_OBJ2' => '',
|
||||||
|
'NOTE_RECIPIENTS' => '',
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,16 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for a APP_THREAD
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\AppThread::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'APP_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'APP_THREAD_INDEX' => $faker->unique()->numberBetween(1, 2000),
|
|
||||||
'APP_THREAD_PARENT' => $faker->unique()->numberBetween(1, 2000),
|
class AppThreadFactory extends Factory
|
||||||
'APP_THREAD_STATUS' => $faker->randomElement(['OPEN', 'CLOSED']),
|
{
|
||||||
'DEL_INDEX' => $faker->unique()->numberBetween(1, 2000)
|
|
||||||
];
|
/**
|
||||||
});
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'APP_UID' => G::generateUniqueID(),
|
||||||
|
'APP_THREAD_INDEX' => $this->faker->unique()->numberBetween(1, 2000),
|
||||||
|
'APP_THREAD_PARENT' => $this->faker->unique()->numberBetween(1, 2000),
|
||||||
|
'APP_THREAD_STATUS' => $this->faker->randomElement(['OPEN', 'CLOSED']),
|
||||||
|
'DEL_INDEX' => $this->faker->unique()->numberBetween(1, 2000)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,12 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\AppTimeoutAction::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
$index = $faker->unique()->numberBetween(20);
|
use G;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
'APP_UID' => G::generateUniqueID(),
|
|
||||||
'DEL_INDEX' => $index,
|
class AppTimeoutActionFactory extends Factory
|
||||||
'EXECUTION_DATE' => $faker->dateTime()
|
{
|
||||||
];
|
|
||||||
});
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
$index = $this->faker->unique()->numberBetween(20);
|
||||||
|
return [
|
||||||
|
'APP_UID' => G::generateUniqueID(),
|
||||||
|
'DEL_INDEX' => $index,
|
||||||
|
'EXECUTION_DATE' => $this->faker->dateTime()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,147 +1,233 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Application::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
use G;
|
||||||
$appNumber = $faker->unique()->numberBetween(1000);
|
use Illuminate\Support\Str;
|
||||||
// APP_TITLE field is used in 'MYSQL: MATCH() AGAINST()' function, string size should not be less than 3.
|
|
||||||
$appTitle = $faker->lexify(str_repeat('?', rand(3, 5)) . ' ' . str_repeat('?', rand(3, 5)));
|
|
||||||
return [
|
|
||||||
'APP_UID' => G::generateUniqueID(),
|
|
||||||
'APP_TITLE' => $appTitle,
|
|
||||||
'APP_DESCRIPTION' => $faker->text,
|
|
||||||
'APP_NUMBER' => $appNumber,
|
|
||||||
'APP_STATUS' => 'TO_DO',
|
|
||||||
'APP_STATUS_ID' => 2,
|
|
||||||
'PRO_UID' => function() {
|
|
||||||
return factory(\ProcessMaker\Model\Process::class)->create()->PRO_UID;
|
|
||||||
},
|
|
||||||
'APP_PROC_STATUS' => '',
|
|
||||||
'APP_PROC_CODE' => '',
|
|
||||||
'APP_PARALLEL' => 'N',
|
|
||||||
'APP_INIT_USER' => $user->USR_UID,
|
|
||||||
'APP_CUR_USER' => $user->USR_UID,
|
|
||||||
'APP_PIN' => G::generateUniqueID(),
|
|
||||||
'APP_CREATE_DATE' => $faker->dateTimeBetween('now', '+30 minutes'),
|
|
||||||
'APP_INIT_DATE' => $faker->dateTimeBetween('now', '+30 minutes'),
|
|
||||||
'APP_UPDATE_DATE' => $faker->dateTimeBetween('now', '+30 minutes'),
|
|
||||||
'APP_FINISH_DATE' => $faker->dateTimeBetween('now', '+30 minutes'),
|
|
||||||
'APP_DATA' => serialize(['APP_NUMBER' => $appNumber])
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a delegation with the foreign keys
|
class ApplicationFactory extends Factory
|
||||||
$factory->state(\ProcessMaker\Model\Application::class, 'foreign_keys', function (Faker $faker) {
|
{
|
||||||
// Create values in the foreign key relations
|
|
||||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
|
||||||
$appNumber = $faker->unique()->numberBetween(1000);
|
|
||||||
|
|
||||||
// APP_TITLE field is used in 'MYSQL: MATCH() AGAINST()' function, string size should not be less than 3.
|
/**
|
||||||
$appTitle = $faker->lexify(str_repeat('?', rand(3, 5)) . ' ' . str_repeat('?', rand(3, 5)));
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
|
$appNumber = $this->faker->unique()->numberBetween(1000);
|
||||||
|
// APP_TITLE field is used in 'MYSQL: MATCH() AGAINST()' function, string size should not be less than 3.
|
||||||
|
$appTitle = $this->faker->lexify(str_repeat('?', rand(3, 5)) . ' ' . str_repeat('?', rand(3, 5)));
|
||||||
|
return [
|
||||||
|
'APP_UID' => G::generateUniqueID(),
|
||||||
|
'APP_TITLE' => $appTitle,
|
||||||
|
'APP_DESCRIPTION' => $this->faker->text,
|
||||||
|
'APP_NUMBER' => $appNumber,
|
||||||
|
'APP_STATUS' => 'TO_DO',
|
||||||
|
'APP_STATUS_ID' => 2,
|
||||||
|
'PRO_UID' => function () {
|
||||||
|
return \ProcessMaker\Model\Process::factory()->create()->PRO_UID;
|
||||||
|
},
|
||||||
|
'APP_PROC_STATUS' => '',
|
||||||
|
'APP_PROC_CODE' => '',
|
||||||
|
'APP_PARALLEL' => 'N',
|
||||||
|
'APP_INIT_USER' => $user->USR_UID,
|
||||||
|
'APP_CUR_USER' => $user->USR_UID,
|
||||||
|
'APP_PIN' => G::generateUniqueID(),
|
||||||
|
'APP_CREATE_DATE' => $this->faker->dateTimeBetween('now', '+30 minutes'),
|
||||||
|
'APP_INIT_DATE' => $this->faker->dateTimeBetween('now', '+30 minutes'),
|
||||||
|
'APP_UPDATE_DATE' => $this->faker->dateTimeBetween('now', '+30 minutes'),
|
||||||
|
'APP_FINISH_DATE' => $this->faker->dateTimeBetween('now', '+30 minutes'),
|
||||||
|
'APP_DATA' => serialize(['APP_NUMBER' => $appNumber])
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
$statuses = ['DRAFT', 'TO_DO', 'COMPLETED', 'CANCELLED'];
|
/**
|
||||||
$status = $faker->randomElement($statuses);
|
* Create a delegation with the foreign keys
|
||||||
$statusId = array_search($status, $statuses) + 1;
|
* @return type
|
||||||
|
*/
|
||||||
|
public function foreign_keys()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
// Create values in the foreign key relations
|
||||||
|
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||||
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
|
$appNumber = $this->faker->unique()->numberBetween(1000);
|
||||||
|
|
||||||
return [
|
// APP_TITLE field is used in 'MYSQL: MATCH() AGAINST()' function, string size should not be less than 3.
|
||||||
'APP_UID' => G::generateUniqueID(),
|
$appTitle = $this->faker->lexify(str_repeat('?', rand(3, 5)) . ' ' . str_repeat('?', rand(3, 5)));
|
||||||
'APP_TITLE' => $appTitle,
|
|
||||||
'APP_NUMBER' => $appNumber,
|
|
||||||
'APP_STATUS' => $status,
|
|
||||||
'APP_STATUS_ID' => $statusId,
|
|
||||||
'PRO_UID' => $process->PRO_UID,
|
|
||||||
'APP_PROC_STATUS' => '',
|
|
||||||
'APP_PROC_CODE' => '',
|
|
||||||
'APP_PARALLEL' => 'N',
|
|
||||||
'APP_INIT_USER' => $user->USR_UID,
|
|
||||||
'APP_INIT_USER_ID' => $user->USR_ID,
|
|
||||||
'APP_CUR_USER' => $user->USR_UID,
|
|
||||||
'APP_PIN' => G::generateUniqueID(),
|
|
||||||
'APP_CREATE_DATE' => $faker->dateTime(),
|
|
||||||
'APP_INIT_DATE' => $faker->dateTime(),
|
|
||||||
'APP_UPDATE_DATE' => $faker->dateTime(),
|
|
||||||
'APP_FINISH_DATE' => $faker->dateTime(),
|
|
||||||
'APP_DATA' => serialize(['APP_NUMBER' => $appNumber])
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\Application::class, 'web_entry', function (Faker $faker) {
|
$statuses = ['DRAFT', 'TO_DO', 'COMPLETED', 'CANCELLED'];
|
||||||
$appNumber = $faker->unique()->numberBetween(5000);
|
$status = $this->faker->randomElement($statuses);
|
||||||
return [
|
$statusId = array_search($status, $statuses) + 1;
|
||||||
'APP_NUMBER' => $appNumber * -1,
|
|
||||||
'APP_STATUS_ID' => 2,
|
|
||||||
'APP_STATUS' => 'TO_DO'
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\Application::class, 'todo', function (Faker $faker) {
|
return [
|
||||||
return [
|
'APP_UID' => G::generateUniqueID(),
|
||||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
'APP_TITLE' => $appTitle,
|
||||||
'APP_STATUS_ID' => 2,
|
'APP_NUMBER' => $appNumber,
|
||||||
'APP_STATUS' => 'TO_DO'
|
'APP_STATUS' => $status,
|
||||||
];
|
'APP_STATUS_ID' => $statusId,
|
||||||
});
|
'PRO_UID' => $process->PRO_UID,
|
||||||
|
'APP_PROC_STATUS' => '',
|
||||||
|
'APP_PROC_CODE' => '',
|
||||||
|
'APP_PARALLEL' => 'N',
|
||||||
|
'APP_INIT_USER' => $user->USR_UID,
|
||||||
|
'APP_INIT_USER_ID' => $user->USR_ID,
|
||||||
|
'APP_CUR_USER' => $user->USR_UID,
|
||||||
|
'APP_PIN' => G::generateUniqueID(),
|
||||||
|
'APP_CREATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'APP_INIT_DATE' => $this->faker->dateTime(),
|
||||||
|
'APP_UPDATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'APP_FINISH_DATE' => $this->faker->dateTime(),
|
||||||
|
'APP_DATA' => serialize(['APP_NUMBER' => $appNumber])
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\Application::class, 'draft', function (Faker $faker) {
|
/**
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
*
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function web_entry()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
$appNumber = $this->faker->unique()->numberBetween(5000);
|
||||||
|
return [
|
||||||
|
'APP_NUMBER' => $appNumber * -1,
|
||||||
|
'APP_STATUS_ID' => 2,
|
||||||
|
'APP_STATUS' => 'TO_DO'
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
/**
|
||||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
*
|
||||||
'APP_STATUS_ID' => 1,
|
* @return type
|
||||||
'APP_STATUS' => 'DRAFT',
|
*/
|
||||||
'APP_INIT_USER' => $user->USR_UID,
|
public function todo()
|
||||||
'APP_INIT_USER_ID' => $user->USR_ID,
|
{
|
||||||
];
|
$state = function (array $attributes) {
|
||||||
});
|
return [
|
||||||
|
'APP_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||||
|
'APP_STATUS_ID' => 2,
|
||||||
|
'APP_STATUS' => 'TO_DO'
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\Application::class, 'paused', function (Faker $faker) {
|
/**
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
*
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function draft()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
'APP_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||||
'APP_STATUS_ID' => 1,
|
'APP_STATUS_ID' => 1,
|
||||||
'APP_STATUS' => 'PAUSED',
|
'APP_STATUS' => 'DRAFT',
|
||||||
'APP_INIT_USER' => $user->USR_UID,
|
'APP_INIT_USER' => $user->USR_UID,
|
||||||
'APP_INIT_USER_ID' => $user->USR_ID,
|
'APP_INIT_USER_ID' => $user->USR_ID,
|
||||||
];
|
];
|
||||||
});
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\Application::class, 'completed', function (Faker $faker) {
|
/**
|
||||||
return [
|
*
|
||||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
* @return type
|
||||||
'APP_STATUS_ID' => 3,
|
*/
|
||||||
'APP_STATUS' => 'COMPLETED'
|
public function paused()
|
||||||
];
|
{
|
||||||
});
|
$state = function (array $attributes) {
|
||||||
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\Application::class, 'canceled', function (Faker $faker) {
|
return [
|
||||||
return [
|
'APP_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
'APP_STATUS_ID' => 1,
|
||||||
'APP_STATUS_ID' => 4,
|
'APP_STATUS' => 'PAUSED',
|
||||||
'APP_STATUS' => 'CANCELLED'
|
'APP_INIT_USER' => $user->USR_UID,
|
||||||
];
|
'APP_INIT_USER_ID' => $user->USR_ID,
|
||||||
});
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\Application::class, 'draft_minor_case', function (Faker $faker) {
|
/**
|
||||||
$caseNumber = $faker->unique()->numberBetween(1, 1000);
|
*
|
||||||
return [
|
* @return type
|
||||||
'APP_NUMBER' => $caseNumber,
|
*/
|
||||||
'APP_TITLE' => 'Case # ' . $caseNumber,
|
public function completed()
|
||||||
'APP_STATUS_ID' => 1,
|
{
|
||||||
'APP_STATUS' => 'DRAFT',
|
$state = function (array $attributes) {
|
||||||
'APP_UPDATE_DATE' => $faker->dateTimeBetween('-2 year', '-1 year')
|
return [
|
||||||
];
|
'APP_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||||
});
|
'APP_STATUS_ID' => 3,
|
||||||
|
'APP_STATUS' => 'COMPLETED'
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\Application::class, 'draft_major_case', function (Faker $faker) {
|
/**
|
||||||
$caseNumber = $faker->unique()->numberBetween(2000, 3000);
|
*
|
||||||
return [
|
* @return type
|
||||||
'APP_NUMBER' => $caseNumber,
|
*/
|
||||||
'APP_TITLE' => 'Case # ' . $caseNumber,
|
public function canceled()
|
||||||
'APP_STATUS_ID' => 1,
|
{
|
||||||
'APP_STATUS' => 'DRAFT',
|
$state = function (array $attributes) {
|
||||||
'APP_UPDATE_DATE' => $faker->dateTimeBetween('now', '+1 year')
|
return [
|
||||||
];
|
'APP_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||||
});
|
'APP_STATUS_ID' => 4,
|
||||||
|
'APP_STATUS' => 'CANCELLED'
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function draft_minor_case()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
$caseNumber = $this->faker->unique()->numberBetween(1, 1000);
|
||||||
|
return [
|
||||||
|
'APP_NUMBER' => $caseNumber,
|
||||||
|
'APP_TITLE' => 'Case # ' . $caseNumber,
|
||||||
|
'APP_STATUS_ID' => 1,
|
||||||
|
'APP_STATUS' => 'DRAFT',
|
||||||
|
'APP_UPDATE_DATE' => $this->faker->dateTimeBetween('-2 year', '-1 year')
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function draft_major_case()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
$caseNumber = $this->faker->unique()->numberBetween(2000, 3000);
|
||||||
|
return [
|
||||||
|
'APP_NUMBER' => $caseNumber,
|
||||||
|
'APP_TITLE' => 'Case # ' . $caseNumber,
|
||||||
|
'APP_STATUS_ID' => 1,
|
||||||
|
'APP_STATUS' => 'DRAFT',
|
||||||
|
'APP_UPDATE_DATE' => $this->faker->dateTimeBetween('now', '+1 year')
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,14 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\BpmnDiagram::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
'DIA_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
|
||||||
'PRJ_UID' => function() {
|
class BpmnDiagramFactory extends Factory
|
||||||
return factory(\ProcessMaker\Model\BpmnProject::class)->create()->PRJ_UID;
|
{
|
||||||
},
|
|
||||||
'DIA_NAME' => $faker->name,
|
/**
|
||||||
'DIA_IS_CLOSABLE' => 0,
|
* Define the model's default state.
|
||||||
];
|
*
|
||||||
});
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'DIA_UID' => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||||
|
'PRJ_UID' => function () {
|
||||||
|
return \ProcessMaker\Model\BpmnProject::factory()->create()->PRJ_UID;
|
||||||
|
},
|
||||||
|
'DIA_NAME' => $this->faker->name,
|
||||||
|
'DIA_IS_CLOSABLE' => 0,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,32 +1,46 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\BpmnEvent::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
$bpmnProcess = factory(\ProcessMaker\Model\BpmnProcess::class)->create();
|
use Illuminate\Support\Str;
|
||||||
return [
|
|
||||||
'EVN_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
class BpmnEventFactory extends Factory
|
||||||
'PRJ_UID' => $bpmnProcess->PRJ_UID,
|
{
|
||||||
'PRO_UID' => $bpmnProcess->PRO_UID,
|
|
||||||
'EVN_NAME' => $faker->name,
|
/**
|
||||||
'EVN_TYPE' => 'START',
|
* Define the model's default state.
|
||||||
'EVN_MARKER' => 'EMPTY',
|
*
|
||||||
'EVN_IS_INTERRUPTING' => 1,
|
* @return array
|
||||||
'EVN_ATTACHED_TO' => '',
|
*/
|
||||||
'EVN_CANCEL_ACTIVITY' => 0,
|
public function definition()
|
||||||
'EVN_ACTIVITY_REF' => null,
|
{
|
||||||
'EVN_WAIT_FOR_COMPLETION' => 0,
|
$bpmnProcess = \ProcessMaker\Model\BpmnProcess::factory()->create();
|
||||||
'EVN_ERROR_NAME' => null,
|
return [
|
||||||
'EVN_ERROR_CODE' => null,
|
'EVN_UID' => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||||
'EVN_ESCALATION_NAME' => null,
|
'PRJ_UID' => $bpmnProcess->PRJ_UID,
|
||||||
'EVN_ESCALATION_CODE' => null,
|
'PRO_UID' => $bpmnProcess->PRO_UID,
|
||||||
'EVN_CONDITION' => null,
|
'EVN_NAME' => $this->faker->name,
|
||||||
'EVN_MESSAGE' => '',
|
'EVN_TYPE' => 'START',
|
||||||
'EVN_OPERATION_NAME' => null,
|
'EVN_MARKER' => 'EMPTY',
|
||||||
'EVN_OPERATION_IMPLEMENTATION_REF' => null,
|
'EVN_IS_INTERRUPTING' => 1,
|
||||||
'EVN_TIME_DATE' => null,
|
'EVN_ATTACHED_TO' => '',
|
||||||
'EVN_TIME_CYCLE' => null,
|
'EVN_CANCEL_ACTIVITY' => 0,
|
||||||
'EVN_TIME_DURATION' => null,
|
'EVN_ACTIVITY_REF' => null,
|
||||||
'EVN_BEHAVIOR' => 'THROW',
|
'EVN_WAIT_FOR_COMPLETION' => 0,
|
||||||
];
|
'EVN_ERROR_NAME' => null,
|
||||||
});
|
'EVN_ERROR_CODE' => null,
|
||||||
|
'EVN_ESCALATION_NAME' => null,
|
||||||
|
'EVN_ESCALATION_CODE' => null,
|
||||||
|
'EVN_CONDITION' => null,
|
||||||
|
'EVN_MESSAGE' => '',
|
||||||
|
'EVN_OPERATION_NAME' => null,
|
||||||
|
'EVN_OPERATION_IMPLEMENTATION_REF' => null,
|
||||||
|
'EVN_TIME_DATE' => null,
|
||||||
|
'EVN_TIME_CYCLE' => null,
|
||||||
|
'EVN_TIME_DURATION' => null,
|
||||||
|
'EVN_BEHAVIOR' => 'THROW',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,21 +1,34 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\BpmnProcess::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
'PRO_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
|
||||||
'PRJ_UID' => function() {
|
|
||||||
return factory(\ProcessMaker\Model\BpmnProject::class)->create()->PRJ_UID;
|
|
||||||
},
|
|
||||||
'DIA_UID' => function() {
|
|
||||||
return factory(\ProcessMaker\Model\BpmnDiagram::class)->create()->DIA_UID;
|
|
||||||
},
|
|
||||||
'PRO_NAME' => $faker->title,
|
|
||||||
'PRO_TYPE' => 'NONE',
|
|
||||||
'PRO_IS_EXECUTABLE' => 0,
|
|
||||||
'PRO_IS_CLOSED' => 0,
|
|
||||||
'PRO_IS_SUBPROCESS' => 0,
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
|
class BpmnProcessFactory extends Factory
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'PRO_UID' => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||||
|
'PRJ_UID' => function () {
|
||||||
|
return \ProcessMaker\Model\BpmnProject::factory()->create()->PRJ_UID;
|
||||||
|
},
|
||||||
|
'DIA_UID' => function () {
|
||||||
|
return \ProcessMaker\Model\BpmnDiagram::factory()->create()->DIA_UID;
|
||||||
|
},
|
||||||
|
'PRO_NAME' => $this->faker->title,
|
||||||
|
'PRO_TYPE' => 'NONE',
|
||||||
|
'PRO_IS_EXECUTABLE' => 0,
|
||||||
|
'PRO_IS_CLOSED' => 0,
|
||||||
|
'PRO_IS_SUBPROCESS' => 0,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,25 +1,40 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\BpmnProject::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
// Create user
|
use G;
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
use Illuminate\Support\Str;
|
||||||
// Create process
|
|
||||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
|
||||||
|
|
||||||
return [
|
class BpmnProjectFactory extends Factory
|
||||||
'PRJ_UID' => G::generateUniqueID(),
|
{
|
||||||
'PRJ_NAME' => $faker->sentence(5),
|
|
||||||
'PRJ_DESCRIPTION' => $faker->text,
|
/**
|
||||||
'PRJ_EXPRESION_LANGUAGE' => '',
|
* Define the model's default state.
|
||||||
'PRJ_TYPE_LANGUAGE' => '',
|
*
|
||||||
'PRJ_EXPORTER' => '',
|
* @return array
|
||||||
'PRJ_EXPORTER_VERSION' => '',
|
*/
|
||||||
'PRJ_CREATE_DATE' => $faker->dateTime(),
|
public function definition()
|
||||||
'PRJ_UPDATE_DATE' => $faker->dateTime(),
|
{
|
||||||
'PRJ_AUTHOR' => $user->USR_UID,
|
// Create user
|
||||||
'PRJ_AUTHOR_VERSION' => '',
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
'PRJ_ORIGINAL_SOURCE' => '',
|
// Create process
|
||||||
];
|
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||||
});
|
|
||||||
|
return [
|
||||||
|
'PRJ_UID' => G::generateUniqueID(),
|
||||||
|
'PRJ_NAME' => $this->faker->sentence(5),
|
||||||
|
'PRJ_DESCRIPTION' => $this->faker->text,
|
||||||
|
'PRJ_EXPRESION_LANGUAGE' => '',
|
||||||
|
'PRJ_TYPE_LANGUAGE' => '',
|
||||||
|
'PRJ_EXPORTER' => '',
|
||||||
|
'PRJ_EXPORTER_VERSION' => '',
|
||||||
|
'PRJ_CREATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'PRJ_UPDATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'PRJ_AUTHOR' => $user->USR_UID,
|
||||||
|
'PRJ_AUTHOR_VERSION' => '',
|
||||||
|
'PRJ_ORIGINAL_SOURCE' => '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,26 +1,40 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\CaseList::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
'CAL_ID' => $faker->unique()->numberBetween(1, 5000),
|
|
||||||
'CAL_TYPE' => 'inbox',
|
class CaseListFactory extends Factory
|
||||||
'CAL_NAME' => $faker->title,
|
{
|
||||||
'CAL_DESCRIPTION' => $faker->text,
|
|
||||||
'ADD_TAB_UID' => function () {
|
/**
|
||||||
$table = factory(\ProcessMaker\Model\AdditionalTables::class)->create();
|
* Define the model's default state.
|
||||||
return $table->ADD_TAB_UID;
|
*
|
||||||
},
|
* @return array
|
||||||
'CAL_COLUMNS' => '[]',
|
*/
|
||||||
'USR_ID' => function () {
|
public function definition()
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
{
|
||||||
return $user->USR_ID;
|
return [
|
||||||
},
|
'CAL_ID' => $this->faker->unique()->numberBetween(1, 5000),
|
||||||
'CAL_ICON_LIST' => 'deafult.png',
|
'CAL_TYPE' => 'inbox',
|
||||||
'CAL_ICON_COLOR' => 'red',
|
'CAL_NAME' => $this->faker->title,
|
||||||
'CAL_ICON_COLOR_SCREEN' => 'blue',
|
'CAL_DESCRIPTION' => $this->faker->text,
|
||||||
'CAL_CREATE_DATE' => $faker->dateTime(),
|
'ADD_TAB_UID' => function () {
|
||||||
'CAL_UPDATE_DATE' => $faker->dateTime()
|
$table = \ProcessMaker\Model\AdditionalTables::factory()->create();
|
||||||
];
|
return $table->ADD_TAB_UID;
|
||||||
});
|
},
|
||||||
|
'CAL_COLUMNS' => '[]',
|
||||||
|
'USR_ID' => function () {
|
||||||
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
|
return $user->USR_ID;
|
||||||
|
},
|
||||||
|
'CAL_ICON_LIST' => 'deafult.png',
|
||||||
|
'CAL_ICON_COLOR' => 'red',
|
||||||
|
'CAL_ICON_COLOR_SCREEN' => 'blue',
|
||||||
|
'CAL_CREATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'CAL_UPDATE_DATE' => $this->faker->dateTime()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,37 +1,57 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for a configuration
|
namespace Database\Factories;
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
use App\Factories\Factory;
|
||||||
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use ProcessMaker\Model\Configuration;
|
use ProcessMaker\Model\Configuration;
|
||||||
use ProcessMaker\Model\User;
|
use ProcessMaker\Model\User;
|
||||||
|
|
||||||
$factory->define(Configuration::class, function(Faker $faker) {
|
class ConfigurationFactory extends Factory
|
||||||
return [
|
{
|
||||||
'CFG_UID' => $faker->randomElement(['AUDIT_LOG', 'EE']),
|
|
||||||
'OBJ_UID' => '',
|
|
||||||
'CFG_VALUE' => '',
|
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
|
||||||
'USR_UID' => G::generateUniqueID(),
|
|
||||||
'APP_UID' => G::generateUniqueID(),
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
$factory->state(Configuration::class, 'userPreferencesEmpty', function (Faker $faker) {
|
/**
|
||||||
// Grab a user if random
|
* Define the model's default state.
|
||||||
$users = User::all();
|
*
|
||||||
if (!empty($users)) {
|
* @return array
|
||||||
$user = factory(User::class)->create();
|
*/
|
||||||
} else {
|
public function definition()
|
||||||
$user = $users->random();
|
{
|
||||||
|
return [
|
||||||
|
'CFG_UID' => $this->faker->randomElement(['AUDIT_LOG', 'EE']),
|
||||||
|
'OBJ_UID' => '',
|
||||||
|
'CFG_VALUE' => '',
|
||||||
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
|
'USR_UID' => G::generateUniqueID(),
|
||||||
|
'APP_UID' => G::generateUniqueID(),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
return [
|
|
||||||
'CFG_UID' => 'USER_PREFERENCES',
|
|
||||||
'OBJ_UID' => '',
|
|
||||||
'CFG_VALUE' => '',
|
|
||||||
'PRO_UID' => '',
|
|
||||||
'USR_UID' => $user->USR_UID,
|
|
||||||
'APP_UID' => '',
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function userPreferencesEmpty()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
// Grab a user if random
|
||||||
|
$users = User::all();
|
||||||
|
if (!empty($users)) {
|
||||||
|
$user = User::factory()->create();
|
||||||
|
} else {
|
||||||
|
$user = $users->random();
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'CFG_UID' => 'USER_PREFERENCES',
|
||||||
|
'OBJ_UID' => '',
|
||||||
|
'CFG_VALUE' => '',
|
||||||
|
'PRO_UID' => '',
|
||||||
|
'USR_UID' => $user->USR_UID,
|
||||||
|
'APP_UID' => '',
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,24 +1,46 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Consolidated::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'TAS_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'DYN_UID' => G::generateUniqueID(),
|
|
||||||
'REP_TAB_UID' => G::generateUniqueID(),
|
|
||||||
'CON_STATUS' => 'ACTIVE',
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a consolidated task with the foreign keys
|
class ConsolidatedFactory extends Factory
|
||||||
$factory->state(\ProcessMaker\Model\Consolidated::class, 'foreign_keys', function (Faker $faker) {
|
{
|
||||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
|
||||||
$dynaform = factory(\ProcessMaker\Model\Dynaform::class)->create();
|
/**
|
||||||
return [
|
* Define the model's default state.
|
||||||
'TAS_UID' => $task->TAS_UID,
|
*
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
* @return array
|
||||||
'REP_TAB_UID' => G::generateUniqueID(),
|
*/
|
||||||
'CON_STATUS' => 'ACTIVE',
|
public function definition()
|
||||||
];
|
{
|
||||||
});
|
return [
|
||||||
|
'TAS_UID' => G::generateUniqueID(),
|
||||||
|
'DYN_UID' => G::generateUniqueID(),
|
||||||
|
'REP_TAB_UID' => G::generateUniqueID(),
|
||||||
|
'CON_STATUS' => 'ACTIVE',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a consolidated task with the foreign keys
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function foreign_keys()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
$task = \ProcessMaker\Model\Task::factory()->create();
|
||||||
|
$dynaform = \ProcessMaker\Model\Dynaform::factory()->create();
|
||||||
|
return [
|
||||||
|
'TAS_UID' => $task->TAS_UID,
|
||||||
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
|
'REP_TAB_UID' => G::generateUniqueID(),
|
||||||
|
'CON_STATUS' => 'ACTIVE',
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,31 +1,43 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for a process
|
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\DbSource::class, function(Faker $faker) {
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use App\Factories\Factory;
|
||||||
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class DbSourceFactory extends Factory
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo Determine if we need more base columns populated
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
$dbName = $faker->word;
|
public function definition()
|
||||||
return [
|
{
|
||||||
'DBS_UID' => G::generateUniqueID(),
|
|
||||||
'PRO_UID' => function() {
|
|
||||||
return factory(\ProcessMaker\Model\Process::class)->create()->PRO_UID;
|
|
||||||
},
|
|
||||||
'DBS_TYPE' => 'mysql',
|
|
||||||
'DBS_SERVER' => $faker->localIpv4,
|
|
||||||
'DBS_DATABASE_NAME' => $faker->word,
|
|
||||||
'DBS_USERNAME' => $faker->userName,
|
|
||||||
/**
|
/**
|
||||||
* @todo WHY figure out there's a magic value to the encryption here
|
* @todo Determine if we need more base columns populated
|
||||||
*/
|
*/
|
||||||
'DBS_PASSWORD' => \G::encrypt( $faker->password, $dbName, false, false) . "_2NnV3ujj3w",
|
$dbName = $this->faker->word;
|
||||||
'DBS_PORT' => $faker->numberBetween(1000, 9000),
|
return [
|
||||||
'DBS_ENCODE' => 'utf8', // @todo Perhaps grab this from our definitions in DbConnections
|
'DBS_UID' => G::generateUniqueID(),
|
||||||
'DBS_CONNECTION_TYPE' => 'NORMAL', // @todo Determine what this value means
|
'PRO_UID' => function () {
|
||||||
'DBS_TNS' => null // @todo Determine what this value means
|
return \ProcessMaker\Model\Process::factory()->create()->PRO_UID;
|
||||||
];
|
},
|
||||||
});
|
'DBS_TYPE' => 'mysql',
|
||||||
|
'DBS_SERVER' => $this->faker->localIpv4,
|
||||||
|
'DBS_DATABASE_NAME' => $this->faker->word,
|
||||||
|
'DBS_USERNAME' => $this->faker->userName,
|
||||||
|
/**
|
||||||
|
* @todo WHY figure out there's a magic value to the encryption here
|
||||||
|
*/
|
||||||
|
'DBS_PASSWORD' => \G::encrypt($this->faker->password, $dbName, false, false) . "_2NnV3ujj3w",
|
||||||
|
'DBS_PORT' => $this->faker->numberBetween(1000, 9000),
|
||||||
|
'DBS_ENCODE' => 'utf8', // @todo Perhaps grab this from our definitions in DbConnections
|
||||||
|
'DBS_CONNECTION_TYPE' => 'NORMAL', // @todo Determine what this value means
|
||||||
|
'DBS_TNS' => null // @todo Determine what this value means
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,193 +1,247 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Delegation::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
use Illuminate\Support\Str;
|
||||||
$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 = 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' => $faker->unique()->numberBetween(5000),
|
|
||||||
'APP_UID' => $application->APP_UID,
|
|
||||||
'DEL_INDEX' => 1,
|
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
|
||||||
'DEL_PREVIOUS' => 0,
|
|
||||||
'PRO_UID' => $process->PRO_UID,
|
|
||||||
'TAS_UID' => $task->TAS_UID,
|
|
||||||
'USR_UID' => $user->USR_UID,
|
|
||||||
'DEL_TYPE' => 'NORMAL',
|
|
||||||
'DEL_THREAD' => 1,
|
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
|
||||||
'DEL_PRIORITY' => 3,
|
|
||||||
'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' => $faker->word()
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a delegation with the foreign keys
|
class DelegationFactory extends Factory
|
||||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'foreign_keys', function (Faker $faker) {
|
{
|
||||||
// Create values in the foreign key relations
|
|
||||||
$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 = factory(\ProcessMaker\Model\Task::class)->create([
|
|
||||||
'PRO_UID' => $process->PRO_UID,
|
|
||||||
'PRO_ID' => $process->PRO_ID
|
|
||||||
]);
|
|
||||||
$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 = $faker->dateTime();
|
/**
|
||||||
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
* Define the model's default state.
|
||||||
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
*
|
||||||
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
* @return array
|
||||||
$index = $faker->unique()->numberBetween(2000);
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
|
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||||
|
$task = \ProcessMaker\Model\Task::factory()->create([
|
||||||
|
'PRO_UID' => $process->PRO_UID,
|
||||||
|
'PRO_ID' => $process->PRO_ID
|
||||||
|
]);
|
||||||
|
$application = \ProcessMaker\Model\Application::factory()->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),
|
||||||
|
'APP_UID' => $application->APP_UID,
|
||||||
|
'DEL_INDEX' => 1,
|
||||||
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
|
'DEL_PREVIOUS' => 0,
|
||||||
|
'PRO_UID' => $process->PRO_UID,
|
||||||
|
'TAS_UID' => $task->TAS_UID,
|
||||||
|
'USR_UID' => $user->USR_UID,
|
||||||
|
'DEL_TYPE' => 'NORMAL',
|
||||||
|
'DEL_THREAD' => 1,
|
||||||
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
|
'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_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()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
// Return with default values
|
/**
|
||||||
return [
|
* Create a delegation with the foreign keys
|
||||||
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
* @return type
|
||||||
'APP_UID' => $application->APP_UID,
|
*/
|
||||||
'DEL_INDEX' => $index,
|
public function foreign_keys()
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
{
|
||||||
'DEL_PREVIOUS' => $index - 1,
|
$state = function (array $attributes) {
|
||||||
'PRO_UID' => $process->PRO_UID,
|
// Create values in the foreign key relations
|
||||||
'TAS_UID' => $task->TAS_UID,
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
'USR_UID' => $user->USR_UID,
|
$category = \ProcessMaker\Model\ProcessCategory::factory()->create();
|
||||||
'DEL_TYPE' => 'NORMAL',
|
$process = \ProcessMaker\Model\Process::factory()->create([
|
||||||
'DEL_THREAD' => 1,
|
'PRO_CATEGORY' => $category->CATEGORY_UID,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'CATEGORY_ID' => $category->CATEGORY_ID
|
||||||
'DEL_PRIORITY' => 3,
|
]);
|
||||||
'DEL_DELEGATE_DATE' => $delegateDate,
|
$task = \ProcessMaker\Model\Task::factory()->create([
|
||||||
'DEL_INIT_DATE' => $initDate,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
'PRO_ID' => $process->PRO_ID
|
||||||
'DEL_RISK_DATE' => $riskDate,
|
]);
|
||||||
'DEL_LAST_INDEX' => 1,
|
$application = \ProcessMaker\Model\Application::factory()->create([
|
||||||
'USR_ID' => $user->USR_ID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'PRO_ID' => $process->PRO_ID,
|
'APP_INIT_USER' => $user->USR_UID,
|
||||||
'TAS_ID' => $task->TAS_ID,
|
'APP_CUR_USER' => $user->USR_UID
|
||||||
'DEL_DATA' => '',
|
]);
|
||||||
'DEL_TITLE' => $faker->word()
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a delegation with the foreign keys
|
$delegateDate = $this->faker->dateTime();
|
||||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'web_entry', function (Faker $faker) {
|
$initDate = $this->faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||||
// Create values in the foreign key relations
|
$riskDate = $this->faker->dateTimeInInterval($initDate, '+1 day');
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
$taskDueDate = $this->faker->dateTimeInInterval($riskDate, '+2 day');
|
||||||
$category = factory(\ProcessMaker\Model\ProcessCategory::class)->create();
|
$index = $this->faker->unique()->numberBetween(2000);
|
||||||
$process = factory(\ProcessMaker\Model\Process::class)->create([
|
|
||||||
'PRO_CATEGORY' => $category->CATEGORY_UID,
|
|
||||||
'CATEGORY_ID' => $category->CATEGORY_ID
|
|
||||||
]);
|
|
||||||
$task = factory(\ProcessMaker\Model\Task::class)->create([
|
|
||||||
'PRO_UID' => $process->PRO_UID,
|
|
||||||
'PRO_ID' => $process->PRO_ID
|
|
||||||
]);
|
|
||||||
$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
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Return with default values
|
// Return with default values
|
||||||
return [
|
return [
|
||||||
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
'DELEGATION_ID' => $this->faker->unique()->numberBetween(5000),
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 1,
|
'DEL_INDEX' => $index,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'DEL_PREVIOUS' => 0,
|
'DEL_PREVIOUS' => $index - 1,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
'DEL_TYPE' => 'NORMAL',
|
'DEL_TYPE' => 'NORMAL',
|
||||||
'DEL_THREAD' => 1,
|
'DEL_THREAD' => 1,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
'DEL_PRIORITY' => 3,
|
'DEL_PRIORITY' => 3,
|
||||||
'DEL_DELEGATE_DATE' => $faker->dateTime(),
|
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||||
'DEL_INIT_DATE' => $faker->dateTime(),
|
'DEL_INIT_DATE' => $initDate,
|
||||||
'DEL_TASK_DUE_DATE' => $faker->dateTime(),
|
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||||
'DEL_RISK_DATE' => $faker->dateTime(),
|
'DEL_RISK_DATE' => $riskDate,
|
||||||
'USR_ID' => $user->USR_ID,
|
'DEL_LAST_INDEX' => 1,
|
||||||
'PRO_ID' => $process->PRO_ID,
|
'USR_ID' => $user->USR_ID,
|
||||||
'TAS_ID' => $task->TAS_ID,
|
'PRO_ID' => $process->PRO_ID,
|
||||||
'DEL_DATA' => '',
|
'TAS_ID' => $task->TAS_ID,
|
||||||
'DEL_TITLE' => $faker->word()
|
'DEL_DATA' => '',
|
||||||
];
|
'DEL_TITLE' => $this->faker->word()
|
||||||
});
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
// Create a open delegation
|
/**
|
||||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'open', function (Faker $faker) {
|
* Create a delegation with the foreign keys
|
||||||
// Create dates with sense
|
* @return type
|
||||||
$delegateDate = $faker->dateTime();
|
*/
|
||||||
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
public function web_entry()
|
||||||
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
{
|
||||||
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
$state = function (array $attributes) {
|
||||||
|
// 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([
|
||||||
|
'PRO_CATEGORY' => $category->CATEGORY_UID,
|
||||||
|
'CATEGORY_ID' => $category->CATEGORY_ID
|
||||||
|
]);
|
||||||
|
$task = \ProcessMaker\Model\Task::factory()->create([
|
||||||
|
'PRO_UID' => $process->PRO_UID,
|
||||||
|
'PRO_ID' => $process->PRO_ID
|
||||||
|
]);
|
||||||
|
$application = \ProcessMaker\Model\Application::factory()->web_entry()->create([
|
||||||
|
'PRO_UID' => $process->PRO_UID,
|
||||||
|
'APP_INIT_USER' => $user->USR_UID,
|
||||||
|
'APP_CUR_USER' => $user->USR_UID
|
||||||
|
]);
|
||||||
|
|
||||||
return [
|
// Return with default values
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
return [
|
||||||
'DEL_DELEGATE_DATE' => $delegateDate,
|
'DELEGATION_ID' => $this->faker->unique()->numberBetween(5000),
|
||||||
'DEL_INIT_DATE' => $initDate,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_RISK_DATE' => $riskDate,
|
'DEL_INDEX' => 1,
|
||||||
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'DEL_FINISH_DATE' => null
|
'DEL_PREVIOUS' => 0,
|
||||||
];
|
'PRO_UID' => $process->PRO_UID,
|
||||||
});
|
'TAS_UID' => $task->TAS_UID,
|
||||||
|
'USR_UID' => $user->USR_UID,
|
||||||
|
'DEL_TYPE' => 'NORMAL',
|
||||||
|
'DEL_THREAD' => 1,
|
||||||
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
|
'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(),
|
||||||
|
'USR_ID' => $user->USR_ID,
|
||||||
|
'PRO_ID' => $process->PRO_ID,
|
||||||
|
'TAS_ID' => $task->TAS_ID,
|
||||||
|
'DEL_DATA' => '',
|
||||||
|
'DEL_TITLE' => $this->faker->word()
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
// Create a closed delegation
|
/**
|
||||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'closed', function (Faker $faker) {
|
* Create a open delegation
|
||||||
// Create dates with sense
|
* @return type
|
||||||
$delegateDate = $faker->dateTime();
|
*/
|
||||||
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
public function open()
|
||||||
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
{
|
||||||
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
$state = function (array $attributes) {
|
||||||
$finishDate = $faker->dateTimeInInterval($initDate, '+10 days');
|
// 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');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
'DEL_DELEGATE_DATE' => $delegateDate,
|
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||||
'DEL_INIT_DATE' => $initDate,
|
'DEL_INIT_DATE' => $initDate,
|
||||||
'DEL_RISK_DATE' => $riskDate,
|
'DEL_RISK_DATE' => $riskDate,
|
||||||
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||||
'DEL_FINISH_DATE' => $finishDate
|
'DEL_FINISH_DATE' => null
|
||||||
];
|
];
|
||||||
});
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
// Create a last delegation
|
/**
|
||||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'last_thread', function (Faker $faker) {
|
* Create a closed delegation
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function closed()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
// 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');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'DEL_LAST_INDEX' => 1,
|
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||||
];
|
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||||
});
|
'DEL_INIT_DATE' => $initDate,
|
||||||
|
'DEL_RISK_DATE' => $riskDate,
|
||||||
|
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||||
|
'DEL_FINISH_DATE' => $finishDate
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
// Create a first delegation
|
/**
|
||||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'first_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);
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
/**
|
||||||
'DEL_INDEX' => 1,
|
* Create a first delegation
|
||||||
'DEL_PREVIOUS' => 0,
|
* @return type
|
||||||
];
|
*/
|
||||||
});
|
public function first_thread()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
return [
|
||||||
|
'DEL_INDEX' => 1,
|
||||||
|
'DEL_PREVIOUS' => 0,
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,16 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Department::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'DEP_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'DEP_TITLE' => $faker->sentence(2),
|
|
||||||
'DEP_PARENT' => '',
|
class DepartmentFactory extends Factory
|
||||||
'DEP_MANAGER' => '',
|
{
|
||||||
'DEP_LOCATION' => 0,
|
|
||||||
'DEP_STATUS' => 'ACTIVE',
|
/**
|
||||||
'DEP_REF_CODE' => '',
|
* Define the model's default state.
|
||||||
'DEP_LDAP_DN' => '',
|
*
|
||||||
];
|
* @return array
|
||||||
});
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'DEP_UID' => G::generateUniqueID(),
|
||||||
|
'DEP_TITLE' => $this->faker->sentence(2),
|
||||||
|
'DEP_PARENT' => '',
|
||||||
|
'DEP_MANAGER' => '',
|
||||||
|
'DEP_LOCATION' => 0,
|
||||||
|
'DEP_STATUS' => 'ACTIVE',
|
||||||
|
'DEP_REF_CODE' => '',
|
||||||
|
'DEP_LDAP_DN' => '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,54 +1,76 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Documents::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
$types = ['INPUT', 'OUTPUT', 'ATTACHED'];
|
use G;
|
||||||
$type = $faker->randomElement($types);
|
use Illuminate\Support\Str;
|
||||||
return [
|
|
||||||
'APP_DOC_UID' => G::generateUniqueID(),
|
|
||||||
'APP_DOC_FILENAME' => 'image.png',
|
|
||||||
'APP_DOC_TITLE' => '',
|
|
||||||
'APP_DOC_COMMENT' => '',
|
|
||||||
'DOC_VERSION' => 1,
|
|
||||||
'APP_UID' => G::generateUniqueID(),
|
|
||||||
'DEL_INDEX' => 1,
|
|
||||||
'DOC_UID' => G::generateUniqueID(),
|
|
||||||
'USR_UID' => G::generateUniqueID(),
|
|
||||||
'APP_DOC_TYPE' => $type,
|
|
||||||
'APP_DOC_CREATE_DATE' => $faker->date(),
|
|
||||||
'APP_DOC_INDEX' => 1,
|
|
||||||
'FOLDER_UID' => G::generateUniqueID(),
|
|
||||||
'APP_DOC_PLUGIN' => '',
|
|
||||||
'APP_DOC_TAGS' => '',
|
|
||||||
'APP_DOC_STATUS' => 'ACTIVE',
|
|
||||||
'APP_DOC_STATUS_DATE' => $faker->date(),
|
|
||||||
'APP_DOC_FIELDNAME' => '',
|
|
||||||
'APP_DOC_DRIVE_DOWNLOAD' => '',
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a document related to the case notes
|
class DocumentsFactory extends Factory
|
||||||
$factory->state(\ProcessMaker\Model\Documents::class, 'case_notes', function (Faker $faker) {
|
{
|
||||||
return [
|
|
||||||
'APP_DOC_UID' => G::generateUniqueID(),
|
/**
|
||||||
'APP_DOC_FILENAME' => 'image.png',
|
* Define the model's default state.
|
||||||
'APP_DOC_TITLE' => '',
|
*
|
||||||
'APP_DOC_COMMENT' => '',
|
* @return array
|
||||||
'DOC_VERSION' => 1,
|
*/
|
||||||
'APP_UID' => G::generateUniqueID(),
|
public function definition()
|
||||||
'DEL_INDEX' => 1,
|
{
|
||||||
'DOC_UID' => G::generateUniqueID(),
|
$types = ['INPUT', 'OUTPUT', 'ATTACHED'];
|
||||||
'USR_UID' => G::generateUniqueID(),
|
$type = $this->faker->randomElement($types);
|
||||||
'APP_DOC_TYPE' => 'CASE_NOTE',
|
return [
|
||||||
'APP_DOC_CREATE_DATE' => $faker->date(),
|
'APP_DOC_UID' => G::generateUniqueID(),
|
||||||
'APP_DOC_INDEX' => 1,
|
'APP_DOC_FILENAME' => 'image.png',
|
||||||
'FOLDER_UID' => G::generateUniqueID(),
|
'APP_DOC_TITLE' => '',
|
||||||
'APP_DOC_PLUGIN' => '',
|
'APP_DOC_COMMENT' => '',
|
||||||
'APP_DOC_TAGS' => '',
|
'DOC_VERSION' => 1,
|
||||||
'APP_DOC_STATUS' => 'ACTIVE',
|
'APP_UID' => G::generateUniqueID(),
|
||||||
'APP_DOC_STATUS_DATE' => $faker->date(),
|
'DEL_INDEX' => 1,
|
||||||
'APP_DOC_FIELDNAME' => '',
|
'DOC_UID' => G::generateUniqueID(),
|
||||||
'APP_DOC_DRIVE_DOWNLOAD' => '',
|
'USR_UID' => G::generateUniqueID(),
|
||||||
];
|
'APP_DOC_TYPE' => $type,
|
||||||
});
|
'APP_DOC_CREATE_DATE' => $this->faker->date(),
|
||||||
|
'APP_DOC_INDEX' => 1,
|
||||||
|
'FOLDER_UID' => G::generateUniqueID(),
|
||||||
|
'APP_DOC_PLUGIN' => '',
|
||||||
|
'APP_DOC_TAGS' => '',
|
||||||
|
'APP_DOC_STATUS' => 'ACTIVE',
|
||||||
|
'APP_DOC_STATUS_DATE' => $this->faker->date(),
|
||||||
|
'APP_DOC_FIELDNAME' => '',
|
||||||
|
'APP_DOC_DRIVE_DOWNLOAD' => '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a document related to the case notes
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function case_notes()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
return [
|
||||||
|
'APP_DOC_UID' => G::generateUniqueID(),
|
||||||
|
'APP_DOC_FILENAME' => 'image.png',
|
||||||
|
'APP_DOC_TITLE' => '',
|
||||||
|
'APP_DOC_COMMENT' => '',
|
||||||
|
'DOC_VERSION' => 1,
|
||||||
|
'APP_UID' => G::generateUniqueID(),
|
||||||
|
'DEL_INDEX' => 1,
|
||||||
|
'DOC_UID' => G::generateUniqueID(),
|
||||||
|
'USR_UID' => G::generateUniqueID(),
|
||||||
|
'APP_DOC_TYPE' => 'CASE_NOTE',
|
||||||
|
'APP_DOC_CREATE_DATE' => $this->faker->date(),
|
||||||
|
'APP_DOC_INDEX' => 1,
|
||||||
|
'FOLDER_UID' => G::generateUniqueID(),
|
||||||
|
'APP_DOC_PLUGIN' => '',
|
||||||
|
'APP_DOC_TAGS' => '',
|
||||||
|
'APP_DOC_STATUS' => 'ACTIVE',
|
||||||
|
'APP_DOC_STATUS_DATE' => $this->faker->date(),
|
||||||
|
'APP_DOC_FIELDNAME' => '',
|
||||||
|
'APP_DOC_DRIVE_DOWNLOAD' => '',
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,66 +1,92 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
namespace Database\Factories;
|
||||||
* Model factory for a dynaform.
|
|
||||||
*/
|
use App\Factories\Factory;
|
||||||
use Faker\Generator as Faker;
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use ProcessMaker\Model\Process;
|
use ProcessMaker\Model\Process;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Dynaform::class, function(Faker $faker) {
|
class DynaformFactory extends Factory
|
||||||
$date = $faker->dateTime();
|
{
|
||||||
return [
|
|
||||||
'DYN_UID' => G::generateUniqueID(),
|
|
||||||
'DYN_TITLE' => $faker->sentence(2),
|
|
||||||
'DYN_DESCRIPTION' => $faker->sentence(5),
|
|
||||||
'PRO_UID' => function() {
|
|
||||||
$process = factory(Process::class)->create();
|
|
||||||
return $process->PRO_UID;
|
|
||||||
},
|
|
||||||
'DYN_TYPE' => 'xmlform',
|
|
||||||
'DYN_FILENAME' => '',
|
|
||||||
'DYN_CONTENT' => '',
|
|
||||||
'DYN_LABEL' => '',
|
|
||||||
'DYN_VERSION' => 2,
|
|
||||||
'DYN_UPDATE_DATE' => $date->format('Y-m-d H:i:s'),
|
|
||||||
];
|
|
||||||
});
|
|
||||||
// Create a dynaform with the foreign keys
|
|
||||||
$factory->state(\ProcessMaker\Model\Dynaform::class, 'foreign_keys', function (Faker $faker) {
|
|
||||||
$date = $faker->dateTime();
|
|
||||||
return [
|
|
||||||
'DYN_UID' => G::generateUniqueID(),
|
|
||||||
'DYN_TITLE' => $faker->sentence(2),
|
|
||||||
'DYN_DESCRIPTION' => $faker->sentence(5),
|
|
||||||
'PRO_UID' => function() {
|
|
||||||
$process = factory(Process::class)->create();
|
|
||||||
return $process->PRO_UID;
|
|
||||||
},
|
|
||||||
'DYN_TYPE' => 'xmlform',
|
|
||||||
'DYN_FILENAME' => '',
|
|
||||||
'DYN_CONTENT' => '',
|
|
||||||
'DYN_LABEL' => '',
|
|
||||||
'DYN_VERSION' => 2,
|
|
||||||
'DYN_UPDATE_DATE' => $date->format('Y-m-d H:i:s'),
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
$date = $this->faker->dateTime();
|
||||||
|
return [
|
||||||
|
'DYN_UID' => G::generateUniqueID(),
|
||||||
|
'DYN_TITLE' => $this->faker->sentence(2),
|
||||||
|
'DYN_DESCRIPTION' => $this->faker->sentence(5),
|
||||||
|
'PRO_UID' => function () {
|
||||||
|
$process = Process::factory()->create();
|
||||||
|
return $process->PRO_UID;
|
||||||
|
},
|
||||||
|
'DYN_TYPE' => 'xmlform',
|
||||||
|
'DYN_FILENAME' => '',
|
||||||
|
'DYN_CONTENT' => '',
|
||||||
|
'DYN_LABEL' => '',
|
||||||
|
'DYN_VERSION' => 2,
|
||||||
|
'DYN_UPDATE_DATE' => $date->format('Y-m-d H:i:s'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
// Create a dynaform with translations defined: ["es", "es-Es"]
|
/**
|
||||||
$factory->state(\ProcessMaker\Model\Dynaform::class, 'translations', function (Faker $faker) {
|
* Create a dynaform with the foreign keys
|
||||||
$date = $faker->dateTime();
|
* @return type
|
||||||
return [
|
*/
|
||||||
'DYN_UID' => G::generateUniqueID(),
|
public function foreign_keys()
|
||||||
'DYN_TITLE' => $faker->sentence(2),
|
{
|
||||||
'DYN_DESCRIPTION' => $faker->sentence(5),
|
$state = function (array $attributes) {
|
||||||
'PRO_UID' => function() {
|
$date = $this->faker->dateTime();
|
||||||
$process = factory(Process::class)->create();
|
return [
|
||||||
return $process->PRO_UID;
|
'DYN_UID' => G::generateUniqueID(),
|
||||||
},
|
'DYN_TITLE' => $this->faker->sentence(2),
|
||||||
'DYN_TYPE' => 'xmlform',
|
'DYN_DESCRIPTION' => $this->faker->sentence(5),
|
||||||
'DYN_FILENAME' => '',
|
'PRO_UID' => function () {
|
||||||
'DYN_CONTENT' => '',
|
$process = Process::factory()->create();
|
||||||
'DYN_LABEL' => '{"es":{"Project-Id-Version":"PM 4.0.1","POT-Creation-Date":"","PO-Revision-Date":"2019-09-11 12:02-0400","Last-Translator":"Colosa <colosa@colosa.com>","Language-Team":"Colosa Developers Team <developers@colosa.com>","MIME-Version":"1.0","Content-Type":"text\/plain; charset=utf-8","Content-Transfer_Encoding":"8bit","X-Poedit-SourceCharset":"utf-8","Content-Transfer-Encoding":"8bit","File-Name":"Test-v2.es.po","X-Generator":"Poedit 1.8.11","X-Poedit-Language":"en","X-Poedit-Country":".","Labels":[{"msgid":"Test without dependent fields","msgstr":"Ejemplo sin campos dependientes"},{"msgid":"Incident Type:","msgstr":"Tipo de incidente:"},{"msgid":"- Select -","msgstr":"- Seleccionar -"},{"msgid":"Incident Sub Type:","msgstr":"Sub tipo de incidente:"},{"msgid":"Test with dependent fields","msgstr":"Ejemplo con campos dependientes"},{"msgid":"Health\/Safety","msgstr":"Salud\/Seguridad"},{"msgid":"Environment","msgstr":"Ambiente"},{"msgid":"Fatality","msgstr":"Ambiente"},{"msgid":"Lost Time Injury","msgstr":"Ambiente"},{"msgid":"Environment","msgstr":"Ambiente"},{"msgid":"Medical Treatment Injury","msgstr":"Lesiones de tratamiento m\u00e9dico"},{"msgid":"Chemical\/Substance Spill","msgstr":"Derrame qu\u00edmico \/ de sustancias"},{"msgid":"Fire\/Explosion","msgstr":"Fuego\/Explosion"},{"msgid":"Offsite Release","msgstr":"Lanzamiento fuera del sitio"}]},"es-Es":{"Project-Id-Version":"PM 4.0.1","POT-Creation-Date":"","PO-Revision-Date":"2019-09-11 12:02-0400","Last-Translator":"Colosa <colosa@colosa.com>","Language-Team":"Colosa Developers Team <developers@colosa.com>","MIME-Version":"1.0","Content-Type":"text\/plain; charset=utf-8","Content-Transfer_Encoding":"8bit","X-Poedit-SourceCharset":"utf-8","Content-Transfer-Encoding":"8bit","File-Name":"Test-v2.es-Es.po","X-Generator":"Poedit 1.8.11","X-Poedit-Language":"en","X-Poedit-Country":".","Labels":[{"msgid":"Test without dependent fields","msgstr":"Ejemplo sin campos dependientes"},{"msgid":"Incident Type:","msgstr":"Tipo de incidente:"},{"msgid":"- Select -","msgstr":"- Seleccionar -"},{"msgid":"Incident Sub Type:","msgstr":"Sub tipo de incidente:"},{"msgid":"Test with dependent fields","msgstr":"Ejemplo con campos dependientes"},{"msgid":"Health\/Safety","msgstr":"Salud\/Seguridad"},{"msgid":"Environment","msgstr":"Ambiente"},{"msgid":"Fatality","msgstr":"Ambiente"},{"msgid":"Lost Time Injury","msgstr":"Ambiente"},{"msgid":"Environment","msgstr":"Ambiente"},{"msgid":"Medical Treatment Injury","msgstr":"Lesiones de tratamiento m\u00e9dico"},{"msgid":"Chemical\/Substance Spill","msgstr":"Derrame qu\u00edmico \/ de sustancias"},{"msgid":"Fire\/Explosion","msgstr":"Fuego\/Explosion"},{"msgid":"Offsite Release","msgstr":"Lanzamiento fuera del sitio"}]}}',
|
return $process->PRO_UID;
|
||||||
'DYN_VERSION' => 2,
|
},
|
||||||
'DYN_UPDATE_DATE' => $date->format('Y-m-d H:i:s'),
|
'DYN_TYPE' => 'xmlform',
|
||||||
];
|
'DYN_FILENAME' => '',
|
||||||
});
|
'DYN_CONTENT' => '',
|
||||||
|
'DYN_LABEL' => '',
|
||||||
|
'DYN_VERSION' => 2,
|
||||||
|
'DYN_UPDATE_DATE' => $date->format('Y-m-d H:i:s'),
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a dynaform with translations defined: ["es", "es-Es"]
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function translations()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
$date = $this->faker->dateTime();
|
||||||
|
return [
|
||||||
|
'DYN_UID' => G::generateUniqueID(),
|
||||||
|
'DYN_TITLE' => $this->faker->sentence(2),
|
||||||
|
'DYN_DESCRIPTION' => $this->faker->sentence(5),
|
||||||
|
'PRO_UID' => function () {
|
||||||
|
$process = Process::factory()->create();
|
||||||
|
return $process->PRO_UID;
|
||||||
|
},
|
||||||
|
'DYN_TYPE' => 'xmlform',
|
||||||
|
'DYN_FILENAME' => '',
|
||||||
|
'DYN_CONTENT' => '',
|
||||||
|
'DYN_LABEL' => '{"es":{"Project-Id-Version":"PM 4.0.1","POT-Creation-Date":"","PO-Revision-Date":"2019-09-11 12:02-0400","Last-Translator":"Colosa <colosa@colosa.com>","Language-Team":"Colosa Developers Team <developers@colosa.com>","MIME-Version":"1.0","Content-Type":"text\/plain; charset=utf-8","Content-Transfer_Encoding":"8bit","X-Poedit-SourceCharset":"utf-8","Content-Transfer-Encoding":"8bit","File-Name":"Test-v2.es.po","X-Generator":"Poedit 1.8.11","X-Poedit-Language":"en","X-Poedit-Country":".","Labels":[{"msgid":"Test without dependent fields","msgstr":"Ejemplo sin campos dependientes"},{"msgid":"Incident Type:","msgstr":"Tipo de incidente:"},{"msgid":"- Select -","msgstr":"- Seleccionar -"},{"msgid":"Incident Sub Type:","msgstr":"Sub tipo de incidente:"},{"msgid":"Test with dependent fields","msgstr":"Ejemplo con campos dependientes"},{"msgid":"Health\/Safety","msgstr":"Salud\/Seguridad"},{"msgid":"Environment","msgstr":"Ambiente"},{"msgid":"Fatality","msgstr":"Ambiente"},{"msgid":"Lost Time Injury","msgstr":"Ambiente"},{"msgid":"Environment","msgstr":"Ambiente"},{"msgid":"Medical Treatment Injury","msgstr":"Lesiones de tratamiento m\u00e9dico"},{"msgid":"Chemical\/Substance Spill","msgstr":"Derrame qu\u00edmico \/ de sustancias"},{"msgid":"Fire\/Explosion","msgstr":"Fuego\/Explosion"},{"msgid":"Offsite Release","msgstr":"Lanzamiento fuera del sitio"}]},"es-Es":{"Project-Id-Version":"PM 4.0.1","POT-Creation-Date":"","PO-Revision-Date":"2019-09-11 12:02-0400","Last-Translator":"Colosa <colosa@colosa.com>","Language-Team":"Colosa Developers Team <developers@colosa.com>","MIME-Version":"1.0","Content-Type":"text\/plain; charset=utf-8","Content-Transfer_Encoding":"8bit","X-Poedit-SourceCharset":"utf-8","Content-Transfer-Encoding":"8bit","File-Name":"Test-v2.es-Es.po","X-Generator":"Poedit 1.8.11","X-Poedit-Language":"en","X-Poedit-Country":".","Labels":[{"msgid":"Test without dependent fields","msgstr":"Ejemplo sin campos dependientes"},{"msgid":"Incident Type:","msgstr":"Tipo de incidente:"},{"msgid":"- Select -","msgstr":"- Seleccionar -"},{"msgid":"Incident Sub Type:","msgstr":"Sub tipo de incidente:"},{"msgid":"Test with dependent fields","msgstr":"Ejemplo con campos dependientes"},{"msgid":"Health\/Safety","msgstr":"Salud\/Seguridad"},{"msgid":"Environment","msgstr":"Ambiente"},{"msgid":"Fatality","msgstr":"Ambiente"},{"msgid":"Lost Time Injury","msgstr":"Ambiente"},{"msgid":"Environment","msgstr":"Ambiente"},{"msgid":"Medical Treatment Injury","msgstr":"Lesiones de tratamiento m\u00e9dico"},{"msgid":"Chemical\/Substance Spill","msgstr":"Derrame qu\u00edmico \/ de sustancias"},{"msgid":"Fire\/Explosion","msgstr":"Fuego\/Explosion"},{"msgid":"Offsite Release","msgstr":"Lanzamiento fuera del sitio"}]}}',
|
||||||
|
'DYN_VERSION' => 2,
|
||||||
|
'DYN_UPDATE_DATE' => $date->format('Y-m-d H:i:s'),
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,13 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\ElementTaskRelation::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'ETR_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'PRJ_UID' => G::generateUniqueID(),
|
|
||||||
'ELEMENT_UID' => G::generateUniqueID(),
|
class ElementTaskRelationFactory extends Factory
|
||||||
'ELEMENT_TYPE' => 'bpmnEvent',
|
{
|
||||||
'TAS_UID' => G::generateUniqueID(),
|
|
||||||
];
|
/**
|
||||||
});
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'ETR_UID' => G::generateUniqueID(),
|
||||||
|
'PRJ_UID' => G::generateUniqueID(),
|
||||||
|
'ELEMENT_UID' => G::generateUniqueID(),
|
||||||
|
'ELEMENT_TYPE' => 'bpmnEvent',
|
||||||
|
'TAS_UID' => G::generateUniqueID(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,21 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\EmailEvent::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
$bpmnEvent = factory(\ProcessMaker\Model\BpmnEvent::class)->create();
|
use Illuminate\Support\Str;
|
||||||
return [
|
|
||||||
'EMAIL_EVENT_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
class EmailEventFactory extends Factory
|
||||||
'PRJ_UID' => $bpmnEvent->PRJ_UID,
|
{
|
||||||
'EVN_UID' => $bpmnEvent->EVN_UID,
|
|
||||||
'EMAIL_EVENT_FROM' => $faker->email,
|
/**
|
||||||
'EMAIL_EVENT_TO' => $faker->email,
|
* Define the model's default state.
|
||||||
'EMAIL_EVENT_SUBJECT' => $faker->title,
|
*
|
||||||
'PRF_UID' => function() {
|
* @return array
|
||||||
return factory(\ProcessMaker\Model\ProcessFiles::class)->create()->PRF_UID;
|
*/
|
||||||
},
|
public function definition()
|
||||||
'EMAIL_SERVER_UID' => function() {
|
{
|
||||||
return factory(\ProcessMaker\Model\EmailServerModel::class)->create()->MESS_UID;
|
$bpmnEvent = \ProcessMaker\Model\BpmnEvent::factory()->create();
|
||||||
},
|
return [
|
||||||
];
|
'EMAIL_EVENT_UID' => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||||
});
|
'PRJ_UID' => $bpmnEvent->PRJ_UID,
|
||||||
|
'EVN_UID' => $bpmnEvent->EVN_UID,
|
||||||
|
'EMAIL_EVENT_FROM' => $this->faker->email,
|
||||||
|
'EMAIL_EVENT_TO' => $this->faker->email,
|
||||||
|
'EMAIL_EVENT_SUBJECT' => $this->faker->title,
|
||||||
|
'PRF_UID' => function () {
|
||||||
|
return \ProcessMaker\Model\ProcessFiles::factory()->create()->PRF_UID;
|
||||||
|
},
|
||||||
|
'EMAIL_SERVER_UID' => function () {
|
||||||
|
return \ProcessMaker\Model\EmailServerModel::factory()->create()->MESS_UID;
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,92 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\EmailServerModel::class, function(Faker $faker) {
|
|
||||||
return [
|
|
||||||
'MESS_UID' => G::generateUniqueID(),
|
|
||||||
'MESS_ENGINE' => 'MAIL',
|
|
||||||
'MESS_SERVER' => '',
|
|
||||||
'MESS_PORT' => 0,
|
|
||||||
'MESS_INCOMING_SERVER' => '',
|
|
||||||
'MESS_INCOMING_PORT' => 0,
|
|
||||||
'MESS_RAUTH' => 0,
|
|
||||||
'MESS_ACCOUNT' => '',
|
|
||||||
'MESS_PASSWORD' => '',
|
|
||||||
'MESS_FROM_MAIL' => '',
|
|
||||||
'MESS_FROM_NAME' => '',
|
|
||||||
'SMTPSECURE' => 'No',
|
|
||||||
'MESS_TRY_SEND_INMEDIATLY' => 0,
|
|
||||||
'MAIL_TO' => '',
|
|
||||||
'MESS_DEFAULT' => 0,
|
|
||||||
'OAUTH_CLIENT_ID' => '',
|
|
||||||
'OAUTH_CLIENT_SECRET' => '',
|
|
||||||
'OAUTH_REFRESH_TOKEN' => ''
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\EmailServerModel::class, 'PHPMAILER', function ($faker) {
|
|
||||||
return [
|
|
||||||
'MESS_UID' => G::generateUniqueID(),
|
|
||||||
'MESS_ENGINE' => 'PHPMAILER',
|
|
||||||
'MESS_PORT' => $faker->numberBetween(400, 500),
|
|
||||||
'MESS_INCOMING_SERVER' => '',
|
|
||||||
'MESS_INCOMING_PORT' => 0,
|
|
||||||
'MESS_RAUTH' => 1,
|
|
||||||
'MESS_ACCOUNT' => $faker->email,
|
|
||||||
'MESS_PASSWORD' => $faker->password,
|
|
||||||
'MESS_FROM_MAIL' => $faker->email,
|
|
||||||
'MESS_FROM_NAME' => $faker->name,
|
|
||||||
'SMTPSECURE' => 'ssl',
|
|
||||||
'MESS_TRY_SEND_INMEDIATLY' => 0,
|
|
||||||
'MAIL_TO' => $faker->email,
|
|
||||||
'MESS_DEFAULT' => 0,
|
|
||||||
'OAUTH_CLIENT_ID' => '',
|
|
||||||
'OAUTH_CLIENT_SECRET' => '',
|
|
||||||
'OAUTH_REFRESH_TOKEN' => ''
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\EmailServerModel::class, 'IMAP', function ($faker) {
|
|
||||||
return [
|
|
||||||
'MESS_UID' => G::generateUniqueID(),
|
|
||||||
'MESS_ENGINE' => 'IMAP',
|
|
||||||
'MESS_PORT' => $faker->numberBetween(400, 500),
|
|
||||||
'MESS_INCOMING_SERVER' => 'imap.' . $faker->domainName,
|
|
||||||
'MESS_INCOMING_PORT' => $faker->numberBetween(400, 500),
|
|
||||||
'MESS_RAUTH' => 1,
|
|
||||||
'MESS_ACCOUNT' => $faker->email,
|
|
||||||
'MESS_PASSWORD' => $faker->password,
|
|
||||||
'MESS_FROM_MAIL' => $faker->email,
|
|
||||||
'MESS_FROM_NAME' => $faker->name,
|
|
||||||
'SMTPSECURE' => 'ssl',
|
|
||||||
'MESS_TRY_SEND_INMEDIATLY' => 0,
|
|
||||||
'MAIL_TO' => $faker->email,
|
|
||||||
'MESS_DEFAULT' => 0,
|
|
||||||
'OAUTH_CLIENT_ID' => '',
|
|
||||||
'OAUTH_CLIENT_SECRET' => '',
|
|
||||||
'OAUTH_REFRESH_TOKEN' => ''
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\EmailServerModel::class, 'GMAILAPI', function ($faker) {
|
|
||||||
return [
|
|
||||||
'MESS_UID' => G::generateUniqueID(),
|
|
||||||
'MESS_ENGINE' => 'GMAILAPI',
|
|
||||||
'MESS_PORT' => 0,
|
|
||||||
'MESS_INCOMING_SERVER' => '',
|
|
||||||
'MESS_INCOMING_PORT' => 0,
|
|
||||||
'MESS_RAUTH' => 1,
|
|
||||||
'MESS_ACCOUNT' => $faker->email,
|
|
||||||
'MESS_PASSWORD' => '',
|
|
||||||
'MESS_FROM_MAIL' => $faker->email,
|
|
||||||
'MESS_FROM_NAME' => $faker->name,
|
|
||||||
'SMTPSECURE' => 'No',
|
|
||||||
'MESS_TRY_SEND_INMEDIATLY' => 0,
|
|
||||||
'MAIL_TO' => $faker->email,
|
|
||||||
'MESS_DEFAULT' => 0,
|
|
||||||
'OAUTH_CLIENT_ID' => $faker->regexify("/[0-9]{12}-[a-z]{32}\.apps\.googleusercontent\.com/"),
|
|
||||||
'OAUTH_CLIENT_SECRET' => $faker->regexify("/[a-z]{24}/"),
|
|
||||||
'OAUTH_REFRESH_TOKEN' => $faker->regexify("/[a-z]{7}[a-zA-Z0-9]{355}==/")
|
|
||||||
];
|
|
||||||
});
|
|
||||||
131
database/factories/EmailServerModelFactory.php
Executable file
131
database/factories/EmailServerModelFactory.php
Executable file
@@ -0,0 +1,131 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use App\Factories\Factory;
|
||||||
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class EmailServerModelFactory extends Factory
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'MESS_UID' => G::generateUniqueID(),
|
||||||
|
'MESS_ENGINE' => 'MAIL',
|
||||||
|
'MESS_SERVER' => '',
|
||||||
|
'MESS_PORT' => 0,
|
||||||
|
'MESS_INCOMING_SERVER' => '',
|
||||||
|
'MESS_INCOMING_PORT' => 0,
|
||||||
|
'MESS_RAUTH' => 0,
|
||||||
|
'MESS_ACCOUNT' => '',
|
||||||
|
'MESS_PASSWORD' => '',
|
||||||
|
'MESS_FROM_MAIL' => '',
|
||||||
|
'MESS_FROM_NAME' => '',
|
||||||
|
'SMTPSECURE' => 'No',
|
||||||
|
'MESS_TRY_SEND_INMEDIATLY' => 0,
|
||||||
|
'MAIL_TO' => '',
|
||||||
|
'MESS_DEFAULT' => 0,
|
||||||
|
'OAUTH_CLIENT_ID' => '',
|
||||||
|
'OAUTH_CLIENT_SECRET' => '',
|
||||||
|
'OAUTH_REFRESH_TOKEN' => ''
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function PHPMAILER()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
return [
|
||||||
|
'MESS_UID' => G::generateUniqueID(),
|
||||||
|
'MESS_ENGINE' => 'PHPMAILER',
|
||||||
|
'MESS_PORT' => $this->faker->numberBetween(400, 500),
|
||||||
|
'MESS_INCOMING_SERVER' => '',
|
||||||
|
'MESS_INCOMING_PORT' => 0,
|
||||||
|
'MESS_RAUTH' => 1,
|
||||||
|
'MESS_ACCOUNT' => $this->faker->email,
|
||||||
|
'MESS_PASSWORD' => $this->faker->password,
|
||||||
|
'MESS_FROM_MAIL' => $this->faker->email,
|
||||||
|
'MESS_FROM_NAME' => $this->faker->name,
|
||||||
|
'SMTPSECURE' => 'ssl',
|
||||||
|
'MESS_TRY_SEND_INMEDIATLY' => 0,
|
||||||
|
'MAIL_TO' => $this->faker->email,
|
||||||
|
'MESS_DEFAULT' => 0,
|
||||||
|
'OAUTH_CLIENT_ID' => '',
|
||||||
|
'OAUTH_CLIENT_SECRET' => '',
|
||||||
|
'OAUTH_REFRESH_TOKEN' => ''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function IMAP()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
return [
|
||||||
|
'MESS_UID' => G::generateUniqueID(),
|
||||||
|
'MESS_ENGINE' => 'IMAP',
|
||||||
|
'MESS_PORT' => $this->faker->numberBetween(400, 500),
|
||||||
|
'MESS_INCOMING_SERVER' => 'imap.' . $this->faker->domainName,
|
||||||
|
'MESS_INCOMING_PORT' => $this->faker->numberBetween(400, 500),
|
||||||
|
'MESS_RAUTH' => 1,
|
||||||
|
'MESS_ACCOUNT' => $this->faker->email,
|
||||||
|
'MESS_PASSWORD' => $this->faker->password,
|
||||||
|
'MESS_FROM_MAIL' => $this->faker->email,
|
||||||
|
'MESS_FROM_NAME' => $this->faker->name,
|
||||||
|
'SMTPSECURE' => 'ssl',
|
||||||
|
'MESS_TRY_SEND_INMEDIATLY' => 0,
|
||||||
|
'MAIL_TO' => $this->faker->email,
|
||||||
|
'MESS_DEFAULT' => 0,
|
||||||
|
'OAUTH_CLIENT_ID' => '',
|
||||||
|
'OAUTH_CLIENT_SECRET' => '',
|
||||||
|
'OAUTH_REFRESH_TOKEN' => ''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function GMAILAPI()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
return [
|
||||||
|
'MESS_UID' => G::generateUniqueID(),
|
||||||
|
'MESS_ENGINE' => 'GMAILAPI',
|
||||||
|
'MESS_PORT' => 0,
|
||||||
|
'MESS_INCOMING_SERVER' => '',
|
||||||
|
'MESS_INCOMING_PORT' => 0,
|
||||||
|
'MESS_RAUTH' => 1,
|
||||||
|
'MESS_ACCOUNT' => $this->faker->email,
|
||||||
|
'MESS_PASSWORD' => '',
|
||||||
|
'MESS_FROM_MAIL' => $this->faker->email,
|
||||||
|
'MESS_FROM_NAME' => $this->faker->name,
|
||||||
|
'SMTPSECURE' => 'No',
|
||||||
|
'MESS_TRY_SEND_INMEDIATLY' => 0,
|
||||||
|
'MAIL_TO' => $this->faker->email,
|
||||||
|
'MESS_DEFAULT' => 0,
|
||||||
|
'OAUTH_CLIENT_ID' => $this->faker->regexify("/[0-9]{12}-[a-z]{32}\.apps\.googleusercontent\.com/"),
|
||||||
|
'OAUTH_CLIENT_SECRET' => $this->faker->regexify("/[a-z]{24}/"),
|
||||||
|
'OAUTH_REFRESH_TOKEN' => $this->faker->regexify("/[a-z]{7}[a-zA-Z0-9]{355}==/")
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,50 +1,72 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use App\Factories\Factory;
|
||||||
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use ProcessMaker\Model\AdditionalTables;
|
use ProcessMaker\Model\AdditionalTables;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Fields::class, function (Faker $faker) {
|
class FieldsFactory extends Factory
|
||||||
return [
|
{
|
||||||
'FLD_UID' => G::generateUniqueID(),
|
|
||||||
'ADD_TAB_UID' => G::generateUniqueID(),
|
|
||||||
'FLD_INDEX' => 0,
|
|
||||||
'FLD_NAME' => 'VAR_' . $faker->sentence(1),
|
|
||||||
'FLD_DESCRIPTION' => $faker->sentence(2),
|
|
||||||
'FLD_TYPE' => 'VARCHAR',
|
|
||||||
'FLD_SIZE' => 255,
|
|
||||||
'FLD_NULL' => 1,
|
|
||||||
'FLD_AUTO_INCREMENT' => 0,
|
|
||||||
'FLD_KEY' => 1,
|
|
||||||
'FLD_TABLE_INDEX' => 0,
|
|
||||||
'FLD_FOREIGN_KEY' => 0,
|
|
||||||
'FLD_FOREIGN_KEY_TABLE' => '',
|
|
||||||
'FLD_DYN_NAME' => '',
|
|
||||||
'FLD_DYN_UID' => '',
|
|
||||||
'FLD_FILTER' => 0,
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create columns from a table with the foreign keys
|
/**
|
||||||
$factory->state(\ProcessMaker\Model\Fields::class, 'foreign_keys', function (Faker $faker) {
|
* Define the model's default state.
|
||||||
return [
|
*
|
||||||
'FLD_UID' => G::generateUniqueID(),
|
* @return array
|
||||||
'ADD_TAB_UID' => function() {
|
*/
|
||||||
$table = factory(AdditionalTables::class)->create(['ADD_TAB_OFFLINE' => 1]);
|
public function definition()
|
||||||
return $table->ADD_TAB_UID;
|
{
|
||||||
},
|
return [
|
||||||
'FLD_INDEX' => 0,
|
'FLD_UID' => G::generateUniqueID(),
|
||||||
'FLD_NAME' => 'VAR_' . $faker->sentence(1),
|
'ADD_TAB_UID' => G::generateUniqueID(),
|
||||||
'FLD_DESCRIPTION' => $faker->sentence(2),
|
'FLD_INDEX' => 0,
|
||||||
'FLD_TYPE' => 'VARCHAR',
|
'FLD_NAME' => 'VAR_' . $this->faker->sentence(1),
|
||||||
'FLD_SIZE' => 255,
|
'FLD_DESCRIPTION' => $this->faker->sentence(2),
|
||||||
'FLD_NULL' => 1,
|
'FLD_TYPE' => 'VARCHAR',
|
||||||
'FLD_AUTO_INCREMENT' => 0,
|
'FLD_SIZE' => 255,
|
||||||
'FLD_KEY' => 1,
|
'FLD_NULL' => 1,
|
||||||
'FLD_TABLE_INDEX' => 0,
|
'FLD_AUTO_INCREMENT' => 0,
|
||||||
'FLD_FOREIGN_KEY' => 0,
|
'FLD_KEY' => 1,
|
||||||
'FLD_FOREIGN_KEY_TABLE' => '',
|
'FLD_TABLE_INDEX' => 0,
|
||||||
'FLD_DYN_NAME' => '',
|
'FLD_FOREIGN_KEY' => 0,
|
||||||
'FLD_DYN_UID' => '',
|
'FLD_FOREIGN_KEY_TABLE' => '',
|
||||||
'FLD_FILTER' => 0,
|
'FLD_DYN_NAME' => '',
|
||||||
];
|
'FLD_DYN_UID' => '',
|
||||||
});
|
'FLD_FILTER' => 0,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create columns from a table with the foreign keys
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function foreign_keys()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
return [
|
||||||
|
'FLD_UID' => G::generateUniqueID(),
|
||||||
|
'ADD_TAB_UID' => function () {
|
||||||
|
$table = AdditionalTables::factory()->create(['ADD_TAB_OFFLINE' => 1]);
|
||||||
|
return $table->ADD_TAB_UID;
|
||||||
|
},
|
||||||
|
'FLD_INDEX' => 0,
|
||||||
|
'FLD_NAME' => 'VAR_' . $this->faker->sentence(1),
|
||||||
|
'FLD_DESCRIPTION' => $this->faker->sentence(2),
|
||||||
|
'FLD_TYPE' => 'VARCHAR',
|
||||||
|
'FLD_SIZE' => 255,
|
||||||
|
'FLD_NULL' => 1,
|
||||||
|
'FLD_AUTO_INCREMENT' => 0,
|
||||||
|
'FLD_KEY' => 1,
|
||||||
|
'FLD_TABLE_INDEX' => 0,
|
||||||
|
'FLD_FOREIGN_KEY' => 0,
|
||||||
|
'FLD_FOREIGN_KEY_TABLE' => '',
|
||||||
|
'FLD_DYN_NAME' => '',
|
||||||
|
'FLD_DYN_UID' => '',
|
||||||
|
'FLD_FILTER' => 0,
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,25 +1,45 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for a group user relation
|
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\GroupUser::class, function(Faker $faker) {
|
namespace Database\Factories;
|
||||||
return [
|
|
||||||
'GRP_UID' => G::generateUniqueID(),
|
|
||||||
'GRP_ID' => $faker->unique()->numberBetween(1, 2000),
|
|
||||||
'USR_UID' => G::generateUniqueID()
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create columns from a table with the foreign keys
|
use App\Factories\Factory;
|
||||||
$factory->state(\ProcessMaker\Model\GroupUser::class, 'foreign_keys', function (Faker $faker) {
|
use G;
|
||||||
// Create values in the foreign key relations
|
use Illuminate\Support\Str;
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
|
||||||
$group = factory(\ProcessMaker\Model\Groupwf::class)->create();
|
class GroupUserFactory extends Factory
|
||||||
return [
|
{
|
||||||
'GRP_UID' => $group->GRP_UID,
|
|
||||||
'GRP_ID' => $group->GRP_ID,
|
/**
|
||||||
'USR_UID' => $user->USR_UID,
|
* Define the model's default state.
|
||||||
];
|
*
|
||||||
});
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'GRP_UID' => G::generateUniqueID(),
|
||||||
|
'GRP_ID' => $this->faker->unique()->numberBetween(1, 2000),
|
||||||
|
'USR_UID' => G::generateUniqueID()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create columns from a table with the foreign keys
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function foreign_keys()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
// Create values in the foreign key relations
|
||||||
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
|
$group = \ProcessMaker\Model\Groupwf::factory()->create();
|
||||||
|
return [
|
||||||
|
'GRP_UID' => $group->GRP_UID,
|
||||||
|
'GRP_ID' => $group->GRP_ID,
|
||||||
|
'USR_UID' => $user->USR_UID,
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,17 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for a groups
|
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Groupwf::class, function(Faker $faker) {
|
namespace Database\Factories;
|
||||||
return [
|
|
||||||
'GRP_UID' => G::generateUniqueID(),
|
|
||||||
'GRP_ID' => $faker->unique()->numberBetween(2000),
|
|
||||||
'GRP_TITLE' => $faker->sentence(2),
|
|
||||||
'GRP_STATUS' => 'ACTIVE',
|
|
||||||
'GRP_LDAP_DN' => '',
|
|
||||||
'GRP_UX' => 'NORMAL',
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
|
use App\Factories\Factory;
|
||||||
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class GroupwfFactory extends Factory
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'GRP_UID' => G::generateUniqueID(),
|
||||||
|
'GRP_ID' => $this->faker->unique()->numberBetween(2000),
|
||||||
|
'GRP_TITLE' => $this->faker->sentence(2),
|
||||||
|
'GRP_STATUS' => 'ACTIVE',
|
||||||
|
'GRP_LDAP_DN' => '',
|
||||||
|
'GRP_UX' => 'NORMAL',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,29 +1,41 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
namespace Database\Factories;
|
||||||
* Model factory for a input document.
|
|
||||||
*/
|
use App\Factories\Factory;
|
||||||
use Faker\Generator as Faker;
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use ProcessMaker\Model\InputDocument;
|
use ProcessMaker\Model\InputDocument;
|
||||||
use ProcessMaker\Model\Process;
|
use ProcessMaker\Model\Process;
|
||||||
|
|
||||||
$factory->define(InputDocument::class, function(Faker $faker) {
|
class InputDocumentFactory extends Factory
|
||||||
return [
|
{
|
||||||
'INP_DOC_UID' => G::generateUniqueID(),
|
|
||||||
'PRO_UID' => function() {
|
/**
|
||||||
$process = factory(Process::class)->create();
|
* Define the model's default state.
|
||||||
return $process->PRO_UID;
|
*
|
||||||
},
|
* @return array
|
||||||
'INP_DOC_TITLE' => $faker->sentence(2),
|
*/
|
||||||
'INP_DOC_DESCRIPTION' => $faker->sentence(10),
|
public function definition()
|
||||||
'INP_DOC_FORM_NEEDED' => 'VIRTUAL',
|
{
|
||||||
'INP_DOC_ORIGINAL' => 'ORIGINAL',
|
return [
|
||||||
'INP_DOC_PUBLISHED' => 'PRIVATE',
|
'INP_DOC_UID' => G::generateUniqueID(),
|
||||||
'INP_DOC_VERSIONING' => 0,
|
'PRO_UID' => function () {
|
||||||
'INP_DOC_DESTINATION_PATH' => '',
|
$process = Process::factory()->create();
|
||||||
'INP_DOC_TAGS' => 'INPUT',
|
return $process->PRO_UID;
|
||||||
'INP_DOC_TYPE_FILE' => '.*',
|
},
|
||||||
'INP_DOC_MAX_FILESIZE' => 0,
|
'INP_DOC_TITLE' => $this->faker->sentence(2),
|
||||||
'INP_DOC_MAX_FILESIZE_UNIT' => 'KB'
|
'INP_DOC_DESCRIPTION' => $this->faker->sentence(10),
|
||||||
];
|
'INP_DOC_FORM_NEEDED' => 'VIRTUAL',
|
||||||
});
|
'INP_DOC_ORIGINAL' => 'ORIGINAL',
|
||||||
|
'INP_DOC_PUBLISHED' => 'PRIVATE',
|
||||||
|
'INP_DOC_VERSIONING' => 0,
|
||||||
|
'INP_DOC_DESTINATION_PATH' => '',
|
||||||
|
'INP_DOC_TAGS' => 'INPUT',
|
||||||
|
'INP_DOC_TYPE_FILE' => '.*',
|
||||||
|
'INP_DOC_MAX_FILESIZE' => 0,
|
||||||
|
'INP_DOC_MAX_FILESIZE_UNIT' => 'KB'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,18 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\LicenseManager::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
"LICENSE_UID" => $faker->regexify("/[a-zA-Z]{32}/"),
|
|
||||||
"LICENSE_USER" => $faker->name,
|
class LicenseManagerFactory extends Factory
|
||||||
"LICENSE_START" => 0,
|
{
|
||||||
"LICENSE_END" => 0,
|
|
||||||
"LICENSE_SPAN" => 0,
|
/**
|
||||||
"LICENSE_STATUS" => 'ACTIVE',
|
* Define the model's default state.
|
||||||
"LICENSE_DATA" => '',
|
*
|
||||||
"LICENSE_PATH" => '',
|
* @return array
|
||||||
"LICENSE_WORKSPACE" => '',
|
*/
|
||||||
"LICENSE_TYPE" => 'ONPREMISE'
|
public function definition()
|
||||||
];
|
{
|
||||||
});
|
return [
|
||||||
|
"LICENSE_UID" => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||||
|
"LICENSE_USER" => $this->faker->name,
|
||||||
|
"LICENSE_START" => 0,
|
||||||
|
"LICENSE_END" => 0,
|
||||||
|
"LICENSE_SPAN" => 0,
|
||||||
|
"LICENSE_STATUS" => 'ACTIVE',
|
||||||
|
"LICENSE_DATA" => '',
|
||||||
|
"LICENSE_PATH" => '',
|
||||||
|
"LICENSE_WORKSPACE" => '',
|
||||||
|
"LICENSE_TYPE" => 'ONPREMISE'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,65 +1,85 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for a list unassigned
|
namespace Database\Factories;
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
use App\Factories\Factory;
|
||||||
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use ProcessMaker\Model\Application;
|
use ProcessMaker\Model\Application;
|
||||||
use ProcessMaker\Model\Process;
|
use ProcessMaker\Model\Process;
|
||||||
use ProcessMaker\Model\Task;
|
use ProcessMaker\Model\Task;
|
||||||
use ProcessMaker\Model\User;
|
use ProcessMaker\Model\User;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\ListUnassigned::class, function(Faker $faker) {
|
class ListUnassignedFactory extends Factory
|
||||||
return [
|
{
|
||||||
'APP_UID' => G::generateUniqueID(),
|
|
||||||
'DEL_INDEX' => 2,
|
|
||||||
'TAS_UID' => G::generateUniqueID(),
|
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
|
||||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
|
||||||
'APP_TITLE' => $faker->sentence(3),
|
|
||||||
'APP_PRO_TITLE' => $faker->sentence(3),
|
|
||||||
'APP_TAS_TITLE' => $faker->sentence(3),
|
|
||||||
'DEL_PREVIOUS_USR_USERNAME' => $faker->name,
|
|
||||||
'DEL_PREVIOUS_USR_FIRSTNAME' => $faker->firstName,
|
|
||||||
'DEL_PREVIOUS_USR_LASTNAME' => $faker->lastName,
|
|
||||||
'APP_UPDATE_DATE' => $faker->dateTime(),
|
|
||||||
'DEL_PREVIOUS_USR_UID' => G::generateUniqueID(),
|
|
||||||
'DEL_DELEGATE_DATE' => $faker->dateTime(),
|
|
||||||
'DEL_DUE_DATE' => $faker->dateTime(),
|
|
||||||
'DEL_PRIORITY' => 3,
|
|
||||||
'PRO_ID' => $faker->unique()->numberBetween(1000),
|
|
||||||
'TAS_ID' => $faker->unique()->numberBetween(1000),
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\ListUnassigned::class, 'foreign_keys', function (Faker $faker) {
|
/**
|
||||||
$process = factory(Process::class)->create();
|
* Define the model's default state.
|
||||||
$app = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
*
|
||||||
$user = factory(User::class)->create();
|
* @return array
|
||||||
$task = factory(Task::class)->create([
|
*/
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE', // Define a self-service type
|
public function definition()
|
||||||
'TAS_GROUP_VARIABLE' => '',
|
{
|
||||||
'PRO_UID' => $process->PRO_UID
|
return [
|
||||||
]);
|
'APP_UID' => G::generateUniqueID(),
|
||||||
|
'DEL_INDEX' => 2,
|
||||||
|
'TAS_UID' => G::generateUniqueID(),
|
||||||
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
|
'APP_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||||
|
'APP_TITLE' => $this->faker->sentence(3),
|
||||||
|
'APP_PRO_TITLE' => $this->faker->sentence(3),
|
||||||
|
'APP_TAS_TITLE' => $this->faker->sentence(3),
|
||||||
|
'DEL_PREVIOUS_USR_USERNAME' => $this->faker->name,
|
||||||
|
'DEL_PREVIOUS_USR_FIRSTNAME' => $this->faker->firstName,
|
||||||
|
'DEL_PREVIOUS_USR_LASTNAME' => $this->faker->lastName,
|
||||||
|
'APP_UPDATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'DEL_PREVIOUS_USR_UID' => G::generateUniqueID(),
|
||||||
|
'DEL_DELEGATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'DEL_DUE_DATE' => $this->faker->dateTime(),
|
||||||
|
'DEL_PRIORITY' => 3,
|
||||||
|
'PRO_ID' => $this->faker->unique()->numberBetween(1000),
|
||||||
|
'TAS_ID' => $this->faker->unique()->numberBetween(1000),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
/**
|
||||||
'APP_UID' => $app->APP_UID,
|
*
|
||||||
'DEL_INDEX' => 2,
|
* @return type
|
||||||
'TAS_UID' => $task->TAS_UID,
|
*/
|
||||||
'PRO_UID' => $process->PRO_UID,
|
public function foreign_keys()
|
||||||
'APP_NUMBER' => $app->APP_NUMBER,
|
{
|
||||||
'APP_TITLE' => $app->APP_TITLE,
|
$state = function (array $attributes) {
|
||||||
'APP_PRO_TITLE' => $process->PRO_TITLE,
|
$process = Process::factory()->create();
|
||||||
'APP_TAS_TITLE' => $task->TAS_TITLE,
|
$app = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||||
'DEL_PREVIOUS_USR_USERNAME' => $user->USR_USERNAME,
|
$user = User::factory()->create();
|
||||||
'DEL_PREVIOUS_USR_FIRSTNAME' => $user->USR_FIRSTNAME,
|
$task = Task::factory()->create([
|
||||||
'DEL_PREVIOUS_USR_LASTNAME' => $user->USR_LASTNAME,
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE', // Define a self-service type
|
||||||
'APP_UPDATE_DATE' => $faker->dateTime(),
|
'TAS_GROUP_VARIABLE' => '',
|
||||||
'DEL_PREVIOUS_USR_UID' => G::generateUniqueID(),
|
'PRO_UID' => $process->PRO_UID
|
||||||
'DEL_DELEGATE_DATE' => $faker->dateTime(),
|
]);
|
||||||
'DEL_DUE_DATE' => $faker->dateTime(),
|
|
||||||
'DEL_PRIORITY' => 3,
|
|
||||||
'PRO_ID' => $process->PRO_ID,
|
|
||||||
'TAS_ID' => $task->TAS_ID,
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
|
return [
|
||||||
|
'APP_UID' => $app->APP_UID,
|
||||||
|
'DEL_INDEX' => 2,
|
||||||
|
'TAS_UID' => $task->TAS_UID,
|
||||||
|
'PRO_UID' => $process->PRO_UID,
|
||||||
|
'APP_NUMBER' => $app->APP_NUMBER,
|
||||||
|
'APP_TITLE' => $app->APP_TITLE,
|
||||||
|
'APP_PRO_TITLE' => $process->PRO_TITLE,
|
||||||
|
'APP_TAS_TITLE' => $task->TAS_TITLE,
|
||||||
|
'DEL_PREVIOUS_USR_USERNAME' => $user->USR_USERNAME,
|
||||||
|
'DEL_PREVIOUS_USR_FIRSTNAME' => $user->USR_FIRSTNAME,
|
||||||
|
'DEL_PREVIOUS_USR_LASTNAME' => $user->USR_LASTNAME,
|
||||||
|
'APP_UPDATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'DEL_PREVIOUS_USR_UID' => G::generateUniqueID(),
|
||||||
|
'DEL_DELEGATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'DEL_DUE_DATE' => $this->faker->dateTime(),
|
||||||
|
'DEL_PRIORITY' => 3,
|
||||||
|
'PRO_ID' => $process->PRO_ID,
|
||||||
|
'TAS_ID' => $task->TAS_ID,
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,17 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\OauthClients::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
"CLIENT_ID" => $faker->unique()->word(),
|
|
||||||
"CLIENT_SECRET" => $faker->regexify("/[a-zA-Z]{6}/"),
|
class OauthClientsFactory extends Factory
|
||||||
"CLIENT_NAME" => $faker->regexify("/[a-zA-Z]{6}/"),
|
{
|
||||||
"CLIENT_DESCRIPTION" => $faker->text,
|
|
||||||
"CLIENT_WEBSITE" => $faker->url,
|
/**
|
||||||
"REDIRECT_URI" => $faker->url,
|
* Define the model's default state.
|
||||||
"USR_UID" => function() {
|
*
|
||||||
return factory(\ProcessMaker\Model\User::class)->create()->USR_UID;
|
* @return array
|
||||||
}
|
*/
|
||||||
];
|
public function definition()
|
||||||
});
|
{
|
||||||
|
return [
|
||||||
|
"CLIENT_ID" => $this->faker->unique()->word(),
|
||||||
|
"CLIENT_SECRET" => $this->faker->regexify("/[a-zA-Z]{6}/"),
|
||||||
|
"CLIENT_NAME" => $this->faker->regexify("/[a-zA-Z]{6}/"),
|
||||||
|
"CLIENT_DESCRIPTION" => $this->faker->text,
|
||||||
|
"CLIENT_WEBSITE" => $this->faker->url,
|
||||||
|
"REDIRECT_URI" => $this->faker->url,
|
||||||
|
"USR_UID" => function () {
|
||||||
|
return \ProcessMaker\Model\User::factory()->create()->USR_UID;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,22 +1,34 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
namespace Database\Factories;
|
||||||
* Model factory for a process
|
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\ObjectPermission::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'OP_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'PRO_UID' => '',
|
|
||||||
'TAS_UID' => '',
|
class ObjectPermissionFactory extends Factory
|
||||||
'USR_UID' => '',
|
{
|
||||||
'OP_USER_RELATION' => 1,
|
|
||||||
'OP_TASK_SOURCE' => '',
|
/**
|
||||||
'OP_PARTICIPATE' => 0,
|
* Define the model's default state.
|
||||||
'OP_OBJ_TYPE' => 'MSGS_HISTORY',
|
*
|
||||||
'OP_OBJ_UID' => '',
|
* @return array
|
||||||
'OP_ACTION' => 'VIEW',
|
*/
|
||||||
'OP_CASE_STATUS' => 'ALL'
|
public function definition()
|
||||||
];
|
{
|
||||||
});
|
return [
|
||||||
|
'OP_UID' => G::generateUniqueID(),
|
||||||
|
'PRO_UID' => '',
|
||||||
|
'TAS_UID' => '',
|
||||||
|
'USR_UID' => '',
|
||||||
|
'OP_USER_RELATION' => 1,
|
||||||
|
'OP_TASK_SOURCE' => '',
|
||||||
|
'OP_PARTICIPATE' => 0,
|
||||||
|
'OP_OBJ_TYPE' => 'MSGS_HISTORY',
|
||||||
|
'OP_OBJ_UID' => '',
|
||||||
|
'OP_ACTION' => 'VIEW',
|
||||||
|
'OP_CASE_STATUS' => 'ALL'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,45 +1,57 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
namespace Database\Factories;
|
||||||
* Model factory for a output document.
|
|
||||||
*/
|
use App\Factories\Factory;
|
||||||
use Faker\Generator as Faker;
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use ProcessMaker\Model\OutputDocument;
|
use ProcessMaker\Model\OutputDocument;
|
||||||
use ProcessMaker\Model\Process;
|
use ProcessMaker\Model\Process;
|
||||||
|
|
||||||
$factory->define(OutputDocument::class, function(Faker $faker) {
|
class OutputDocumentFactory extends Factory
|
||||||
$date = $faker->dateTime();
|
{
|
||||||
return [
|
|
||||||
'OUT_DOC_UID' => G::generateUniqueID(),
|
/**
|
||||||
'OUT_DOC_ID' => $faker->unique()->numberBetween(1, 10000),
|
* Define the model's default state.
|
||||||
'OUT_DOC_TITLE' => $faker->sentence(2),
|
*
|
||||||
'OUT_DOC_DESCRIPTION' => $faker->sentence(10),
|
* @return array
|
||||||
'OUT_DOC_FILENAME' => $faker->sentence(2),
|
*/
|
||||||
'OUT_DOC_TEMPLATE' => '',
|
public function definition()
|
||||||
'PRO_UID' => function() {
|
{
|
||||||
$process = factory(Process::class)->create();
|
$date = $this->faker->dateTime();
|
||||||
return $process->PRO_UID;
|
return [
|
||||||
},
|
'OUT_DOC_UID' => G::generateUniqueID(),
|
||||||
'OUT_DOC_REPORT_GENERATOR' => 'TCPDF',
|
'OUT_DOC_ID' => $this->faker->unique()->numberBetween(1, 10000),
|
||||||
'OUT_DOC_LANDSCAPE' => 0,
|
'OUT_DOC_TITLE' => $this->faker->sentence(2),
|
||||||
'OUT_DOC_MEDIA' => 'Letter',
|
'OUT_DOC_DESCRIPTION' => $this->faker->sentence(10),
|
||||||
'OUT_DOC_LEFT_MARGIN' => 20,
|
'OUT_DOC_FILENAME' => $this->faker->sentence(2),
|
||||||
'OUT_DOC_RIGHT_MARGIN' => 20,
|
'OUT_DOC_TEMPLATE' => '',
|
||||||
'OUT_DOC_TOP_MARGIN' => 20,
|
'PRO_UID' => function () {
|
||||||
'OUT_DOC_BOTTOM_MARGIN' => 20,
|
$process = Process::factory()->create();
|
||||||
'OUT_DOC_GENERATE' => 'BOTH',
|
return $process->PRO_UID;
|
||||||
'OUT_DOC_TYPE' => 'HTML',
|
},
|
||||||
'OUT_DOC_CURRENT_REVISION' => 0,
|
'OUT_DOC_REPORT_GENERATOR' => 'TCPDF',
|
||||||
'OUT_DOC_FIELD_MAPPING' => '',
|
'OUT_DOC_LANDSCAPE' => 0,
|
||||||
'OUT_DOC_VERSIONING' => 1,
|
'OUT_DOC_MEDIA' => 'Letter',
|
||||||
'OUT_DOC_DESTINATION_PATH' => '',
|
'OUT_DOC_LEFT_MARGIN' => 20,
|
||||||
'OUT_DOC_TAGS' => '',
|
'OUT_DOC_RIGHT_MARGIN' => 20,
|
||||||
'OUT_DOC_PDF_SECURITY_ENABLED' => 0,
|
'OUT_DOC_TOP_MARGIN' => 20,
|
||||||
'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD' => '',
|
'OUT_DOC_BOTTOM_MARGIN' => 20,
|
||||||
'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD' => '',
|
'OUT_DOC_GENERATE' => 'BOTH',
|
||||||
'OUT_DOC_PDF_SECURITY_PERMISSIONS' => '',
|
'OUT_DOC_TYPE' => 'HTML',
|
||||||
'OUT_DOC_OPEN_TYPE' => 1,
|
'OUT_DOC_CURRENT_REVISION' => 0,
|
||||||
'OUT_DOC_HEADER' => null,
|
'OUT_DOC_FIELD_MAPPING' => '',
|
||||||
'OUT_DOC_FOOTER' => null
|
'OUT_DOC_VERSIONING' => 1,
|
||||||
];
|
'OUT_DOC_DESTINATION_PATH' => '',
|
||||||
});
|
'OUT_DOC_TAGS' => '',
|
||||||
|
'OUT_DOC_PDF_SECURITY_ENABLED' => 0,
|
||||||
|
'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD' => '',
|
||||||
|
'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD' => '',
|
||||||
|
'OUT_DOC_PDF_SECURITY_PERMISSIONS' => '',
|
||||||
|
'OUT_DOC_OPEN_TYPE' => 1,
|
||||||
|
'OUT_DOC_HEADER' => null,
|
||||||
|
'OUT_DOC_FOOTER' => null
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,17 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
namespace Database\Factories;
|
||||||
* Model factory for a process category
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
use App\Factories\Factory;
|
||||||
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\ProcessCategory::class, function (Faker $faker) {
|
class ProcessCategoryFactory extends Factory
|
||||||
return [
|
{
|
||||||
'CATEGORY_UID' => G::generateUniqueID(),
|
|
||||||
'CATEGORY_ID' => $faker->unique()->numberBetween(1000),
|
/**
|
||||||
'CATEGORY_PARENT' => '',
|
* Define the model's default state.
|
||||||
'CATEGORY_NAME' => $faker->sentence(5),
|
*
|
||||||
'CATEGORY_ICON' => '',
|
* @return array
|
||||||
];
|
*/
|
||||||
});
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'CATEGORY_UID' => G::generateUniqueID(),
|
||||||
|
'CATEGORY_ID' => $this->faker->unique()->numberBetween(1000),
|
||||||
|
'CATEGORY_PARENT' => '',
|
||||||
|
'CATEGORY_NAME' => $this->faker->sentence(5),
|
||||||
|
'CATEGORY_ICON' => '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,65 +1,77 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
namespace Database\Factories;
|
||||||
* Model factory for a process
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
use App\Factories\Factory;
|
||||||
|
use G;
|
||||||
use Faker\Generator as Faker;
|
use Faker\Generator as Faker;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Process::class, function (Faker $faker) {
|
class ProcessFactory extends Factory
|
||||||
|
{
|
||||||
|
|
||||||
return [
|
public function definition(): array
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
{
|
||||||
'PRO_ID' => $faker->unique()->numberBetween(2000),
|
return [
|
||||||
'PRO_TITLE' => $faker->sentence(3),
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
'PRO_DESCRIPTION' => $faker->paragraph(3),
|
'PRO_ID' => $this->faker->unique()->numberBetween(2000),
|
||||||
'PRO_PARENT' => G::generateUniqueID(),
|
'PRO_TITLE' => $this->faker->sentence(3),
|
||||||
'PRO_STATUS' => 'ACTIVE',
|
'PRO_DESCRIPTION' => $this->faker->paragraph(3),
|
||||||
'PRO_STATUS_ID' => 1,
|
'PRO_PARENT' => G::generateUniqueID(),
|
||||||
'PRO_TYPE' => 'NORMAL',
|
'PRO_STATUS' => 'ACTIVE',
|
||||||
'PRO_ASSIGNMENT' => 'FALSE',
|
'PRO_STATUS_ID' => 1,
|
||||||
'PRO_TYPE_PROCESS' => 'PUBLIC',
|
'PRO_TYPE' => 'NORMAL',
|
||||||
'PRO_UPDATE_DATE' => $faker->dateTime(),
|
'PRO_ASSIGNMENT' => 'FALSE',
|
||||||
'PRO_CREATE_DATE' => $faker->dateTime(),
|
'PRO_TYPE_PROCESS' => 'PUBLIC',
|
||||||
'PRO_CREATE_USER' => '00000000000000000000000000000001',
|
'PRO_UPDATE_DATE' => $this->faker->dateTime(),
|
||||||
'PRO_DEBUG' => 0,
|
'PRO_CREATE_DATE' => $this->faker->dateTime(),
|
||||||
'PRO_DYNAFORMS' => serialize([]),
|
'PRO_CREATE_USER' => '00000000000000000000000000000001',
|
||||||
'PRO_ITEE' => 1,
|
'PRO_DEBUG' => 0,
|
||||||
'PRO_ACTION_DONE' => serialize([]),
|
'PRO_DYNAFORMS' => serialize([]),
|
||||||
'PRO_SUBPROCESS' => 0,
|
'PRO_ITEE' => 1,
|
||||||
'PRO_CATEGORY' => function () {
|
'PRO_ACTION_DONE' => serialize([]),
|
||||||
return factory(\ProcessMaker\Model\ProcessCategory::class)->create()->CATEGORY_UID;
|
'PRO_SUBPROCESS' => 0,
|
||||||
},
|
'PRO_CATEGORY' => function () {
|
||||||
'CATEGORY_ID' => 0
|
return \ProcessMaker\Model\ProcessCategory::factory()->create()->CATEGORY_UID;
|
||||||
];
|
},
|
||||||
});
|
'CATEGORY_ID' => 0
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
// Create a process with the foreign keys
|
/**
|
||||||
$factory->state(\ProcessMaker\Model\Process::class, 'foreign_keys', function (Faker $faker) {
|
* Create a process with the foreign keys
|
||||||
// Create user
|
* @return type
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
*/
|
||||||
|
public function foreign_keys()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
// Create user
|
||||||
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
'PRO_ID' => $faker->unique()->numberBetween(1000),
|
'PRO_ID' => $this->faker->unique()->numberBetween(1000),
|
||||||
'PRO_TITLE' => $faker->sentence(3),
|
'PRO_TITLE' => $this->faker->sentence(3),
|
||||||
'PRO_DESCRIPTION' => $faker->paragraph(3),
|
'PRO_DESCRIPTION' => $this->faker->paragraph(3),
|
||||||
'PRO_PARENT' => G::generateUniqueID(),
|
'PRO_PARENT' => G::generateUniqueID(),
|
||||||
'PRO_STATUS' => 'ACTIVE',
|
'PRO_STATUS' => 'ACTIVE',
|
||||||
'PRO_STATUS_ID' => 1,
|
'PRO_STATUS_ID' => 1,
|
||||||
'PRO_TYPE' => 'NORMAL',
|
'PRO_TYPE' => 'NORMAL',
|
||||||
'PRO_ASSIGNMENT' => 'FALSE',
|
'PRO_ASSIGNMENT' => 'FALSE',
|
||||||
'PRO_TYPE_PROCESS' => 'PUBLIC',
|
'PRO_TYPE_PROCESS' => 'PUBLIC',
|
||||||
'PRO_UPDATE_DATE' => $faker->dateTime(),
|
'PRO_UPDATE_DATE' => $this->faker->dateTime(),
|
||||||
'PRO_CREATE_DATE' => $faker->dateTime(),
|
'PRO_CREATE_DATE' => $this->faker->dateTime(),
|
||||||
'PRO_CREATE_USER' => $user->USR_UID,
|
'PRO_CREATE_USER' => $user->USR_UID,
|
||||||
'PRO_DEBUG' => 0,
|
'PRO_DEBUG' => 0,
|
||||||
'PRO_DYNAFORMS' => serialize([]),
|
'PRO_DYNAFORMS' => serialize([]),
|
||||||
'PRO_ITEE' => 1,
|
'PRO_ITEE' => 1,
|
||||||
'PRO_ACTION_DONE' => serialize([]),
|
'PRO_ACTION_DONE' => serialize([]),
|
||||||
'PRO_SUBPROCESS' => 0,
|
'PRO_SUBPROCESS' => 0,
|
||||||
'PRO_CATEGORY' => function () {
|
'PRO_CATEGORY' => function () {
|
||||||
return factory(\ProcessMaker\Model\ProcessCategory::class)->create()->CATEGORY_UID;
|
return \ProcessMaker\Model\ProcessCategory::factory()->create()->CATEGORY_UID;
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
});
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,17 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\ProcessFiles::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'PRF_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'PRO_UID' => '',
|
|
||||||
'USR_UID' => '',
|
class ProcessFilesFactory extends Factory
|
||||||
'PRF_UPDATE_USR_UID' => '',
|
{
|
||||||
'PRF_PATH' => 'dummy_path',
|
|
||||||
'PRF_TYPE' => '',
|
/**
|
||||||
'PRF_EDITABLE' => 1,
|
* Define the model's default state.
|
||||||
'PRF_CREATE_DATE' => $faker->dateTime(),
|
*
|
||||||
'PRF_UPDATE_DATE' => $faker->dateTime(),
|
* @return array
|
||||||
];
|
*/
|
||||||
});
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'PRF_UID' => G::generateUniqueID(),
|
||||||
|
'PRO_UID' => '',
|
||||||
|
'USR_UID' => '',
|
||||||
|
'PRF_UPDATE_USR_UID' => '',
|
||||||
|
'PRF_PATH' => 'dummy_path',
|
||||||
|
'PRF_TYPE' => '',
|
||||||
|
'PRF_EDITABLE' => 1,
|
||||||
|
'PRF_CREATE_DATE' => $this->faker->dateTime(),
|
||||||
|
'PRF_UPDATE_DATE' => $this->faker->dateTime(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,26 +1,48 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\ProcessUser::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'PU_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
|
||||||
'USR_UID' => G::generateUniqueID(),
|
|
||||||
'PU_TYPE' => 'SUPERVISOR'
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a process with the foreign keys
|
class ProcessUserFactory extends Factory
|
||||||
$factory->state(\ProcessMaker\Model\ProcessUser::class, 'foreign_keys', function (Faker $faker) {
|
{
|
||||||
// Create user
|
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
|
||||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
|
||||||
|
|
||||||
return [
|
/**
|
||||||
'PU_UID' => G::generateUniqueID(),
|
* Define the model's default state.
|
||||||
'PRO_UID' => $process->PRO_UID,
|
*
|
||||||
'USR_UID' => $user->USR_UID,
|
* @return array
|
||||||
'PU_TYPE' => 'SUPERVISOR'
|
*/
|
||||||
];
|
public function definition()
|
||||||
});
|
{
|
||||||
|
return [
|
||||||
|
'PU_UID' => G::generateUniqueID(),
|
||||||
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
|
'USR_UID' => G::generateUniqueID(),
|
||||||
|
'PU_TYPE' => 'SUPERVISOR'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a process with the foreign keys
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function foreign_keys()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
// Create user
|
||||||
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
|
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'PU_UID' => G::generateUniqueID(),
|
||||||
|
'PRO_UID' => $process->PRO_UID,
|
||||||
|
'USR_UID' => $user->USR_UID,
|
||||||
|
'PU_TYPE' => 'SUPERVISOR'
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,49 +1,71 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use App\Factories\Factory;
|
||||||
|
use G;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use ProcessMaker\Model\ProcessVariables;
|
use ProcessMaker\Model\ProcessVariables;
|
||||||
|
|
||||||
$factory->define(ProcessVariables::class, function (Faker $faker) {
|
class ProcessVariablesFactory extends Factory
|
||||||
return [
|
{
|
||||||
'VAR_UID' => G::generateUniqueID(),
|
|
||||||
'PRO_ID' => G::generateUniqueID(),
|
|
||||||
'PRJ_UID' => G::generateUniqueID(),
|
|
||||||
'VAR_NAME' => $faker->word,
|
|
||||||
'VAR_FIELD_TYPE' => G::generateUniqueID(),
|
|
||||||
'VAR_FIELD_TYPE_ID' => G::generateUniqueID(),
|
|
||||||
'VAR_FIELD_SIZE' => 10,
|
|
||||||
'VAR_LABEL' => 'string',
|
|
||||||
'VAR_DBCONNECTION' => 'workflow',
|
|
||||||
'VAR_SQL' => '',
|
|
||||||
'VAR_NULL' => 0,
|
|
||||||
'VAR_DEFAULT' => '',
|
|
||||||
'VAR_ACCEPTED_VALUES' => '[]',
|
|
||||||
'INP_DOC_UID' => ''
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a processVariables with the foreign keys
|
/**
|
||||||
$factory->state(ProcessVariables::class, 'foreign_keys', function (Faker $faker) {
|
* Define the model's default state.
|
||||||
$types = ['string', 'integer', 'float', 'boolean', 'datetime', 'grid', 'array', 'file', 'multiplefile', 'object'];
|
*
|
||||||
$varType = $faker->randomElement($types);
|
* @return array
|
||||||
$varTypeId = array_search($varType, $types) + 1;
|
*/
|
||||||
// Create values in the foreign key relations
|
public function definition()
|
||||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
{
|
||||||
|
return [
|
||||||
|
'VAR_UID' => G::generateUniqueID(),
|
||||||
|
'PRO_ID' => G::generateUniqueID(),
|
||||||
|
'PRJ_UID' => G::generateUniqueID(),
|
||||||
|
'VAR_NAME' => $this->faker->word,
|
||||||
|
'VAR_FIELD_TYPE' => G::generateUniqueID(),
|
||||||
|
'VAR_FIELD_TYPE_ID' => G::generateUniqueID(),
|
||||||
|
'VAR_FIELD_SIZE' => 10,
|
||||||
|
'VAR_LABEL' => 'string',
|
||||||
|
'VAR_DBCONNECTION' => 'workflow',
|
||||||
|
'VAR_SQL' => '',
|
||||||
|
'VAR_NULL' => 0,
|
||||||
|
'VAR_DEFAULT' => '',
|
||||||
|
'VAR_ACCEPTED_VALUES' => '[]',
|
||||||
|
'INP_DOC_UID' => ''
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
/**
|
||||||
'VAR_UID' => G::generateUniqueID(),
|
* Create a processVariables with the foreign keys
|
||||||
'PRO_ID' => $process->PRO_ID,
|
* @return type
|
||||||
'PRJ_UID' => $process->PRO_UID,
|
*/
|
||||||
'VAR_NAME' => $faker->word,
|
public function foreign_keys()
|
||||||
'VAR_FIELD_TYPE' => $varType,
|
{
|
||||||
'VAR_FIELD_TYPE_ID' => $varTypeId,
|
$state = function (array $attributes) {
|
||||||
'VAR_FIELD_SIZE' => 10,
|
$types = ['string', 'integer', 'float', 'boolean', 'datetime', 'grid', 'array', 'file', 'multiplefile', 'object'];
|
||||||
'VAR_LABEL' => 'string',
|
$varType = $this->faker->randomElement($types);
|
||||||
'VAR_DBCONNECTION' => 'workflow',
|
$varTypeId = array_search($varType, $types) + 1;
|
||||||
'VAR_SQL' => '',
|
// Create values in the foreign key relations
|
||||||
'VAR_NULL' => 0,
|
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||||
'VAR_DEFAULT' => '',
|
|
||||||
'VAR_ACCEPTED_VALUES' => '[]',
|
return [
|
||||||
'INP_DOC_UID' => ''
|
'VAR_UID' => G::generateUniqueID(),
|
||||||
];
|
'PRO_ID' => $process->PRO_ID,
|
||||||
});
|
'PRJ_UID' => $process->PRO_UID,
|
||||||
|
'VAR_NAME' => $this->faker->word,
|
||||||
|
'VAR_FIELD_TYPE' => $varType,
|
||||||
|
'VAR_FIELD_TYPE_ID' => $varTypeId,
|
||||||
|
'VAR_FIELD_SIZE' => 10,
|
||||||
|
'VAR_LABEL' => 'string',
|
||||||
|
'VAR_DBCONNECTION' => 'workflow',
|
||||||
|
'VAR_SQL' => '',
|
||||||
|
'VAR_NULL' => 0,
|
||||||
|
'VAR_DEFAULT' => '',
|
||||||
|
'VAR_ACCEPTED_VALUES' => '[]',
|
||||||
|
'INP_DOC_UID' => ''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,22 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\RbacAuthenticationSource::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'AUTH_SOURCE_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'AUTH_SOURCE_NAME' => $faker->title,
|
|
||||||
'AUTH_SOURCE_PROVIDER' => 'ldapAdvanced',
|
class RbacAuthenticationSourceFactory extends Factory
|
||||||
'AUTH_SOURCE_SERVER_NAME' => $faker->domainName,
|
{
|
||||||
'AUTH_SOURCE_PORT' => $faker->numberBetween(100, 1000),
|
|
||||||
'AUTH_SOURCE_ENABLED_TLS' => 0,
|
/**
|
||||||
'AUTH_SOURCE_VERSION' => 3,
|
* Define the model's default state.
|
||||||
'AUTH_SOURCE_BASE_DN' => 'dc=processmaker,dc=test',
|
*
|
||||||
'AUTH_ANONYMOUS' => 0,
|
* @return array
|
||||||
'AUTH_SOURCE_SEARCH_USER' => $faker->userName,
|
*/
|
||||||
'AUTH_SOURCE_PASSWORD' => $faker->password,
|
public function definition()
|
||||||
'AUTH_SOURCE_ATTRIBUTES' => '',
|
{
|
||||||
'AUTH_SOURCE_OBJECT_CLASSES' => '',
|
return [
|
||||||
'AUTH_SOURCE_DATA' => 'a:8:{s:9:"LDAP_TYPE";s:4:"ldap";s:25:"AUTH_SOURCE_AUTO_REGISTER";s:1:"0";s:31:"AUTH_SOURCE_IDENTIFIER_FOR_USER";s:3:"uid";s:24:"AUTH_SOURCE_USERS_FILTER";s:0:"";s:22:"AUTH_SOURCE_RETIRED_OU";s:0:"";s:20:"AUTH_SOURCE_SHOWGRID";s:2:"on";s:26:"AUTH_SOURCE_GRID_ATTRIBUTE";a:1:{i:1;a:2:{s:13:"attributeLdap";s:4:"test";s:13:"attributeUser";s:13:"USR_FIRSTNAME";}}s:20:"LDAP_PAGE_SIZE_LIMIT";i:1000;}'
|
'AUTH_SOURCE_UID' => G::generateUniqueID(),
|
||||||
];
|
'AUTH_SOURCE_NAME' => $this->faker->title,
|
||||||
});
|
'AUTH_SOURCE_PROVIDER' => 'ldapAdvanced',
|
||||||
|
'AUTH_SOURCE_SERVER_NAME' => $this->faker->domainName,
|
||||||
|
'AUTH_SOURCE_PORT' => $this->faker->numberBetween(100, 1000),
|
||||||
|
'AUTH_SOURCE_ENABLED_TLS' => 0,
|
||||||
|
'AUTH_SOURCE_VERSION' => 3,
|
||||||
|
'AUTH_SOURCE_BASE_DN' => 'dc=processmaker,dc=test',
|
||||||
|
'AUTH_ANONYMOUS' => 0,
|
||||||
|
'AUTH_SOURCE_SEARCH_USER' => $this->faker->userName,
|
||||||
|
'AUTH_SOURCE_PASSWORD' => $this->faker->password,
|
||||||
|
'AUTH_SOURCE_ATTRIBUTES' => '',
|
||||||
|
'AUTH_SOURCE_OBJECT_CLASSES' => '',
|
||||||
|
'AUTH_SOURCE_DATA' => 'a:8:{s:9:"LDAP_TYPE";s:4:"ldap";s:25:"AUTH_SOURCE_AUTO_REGISTER";s:1:"0";s:31:"AUTH_SOURCE_IDENTIFIER_FOR_USER";s:3:"uid";s:24:"AUTH_SOURCE_USERS_FILTER";s:0:"";s:22:"AUTH_SOURCE_RETIRED_OU";s:0:"";s:20:"AUTH_SOURCE_SHOWGRID";s:2:"on";s:26:"AUTH_SOURCE_GRID_ATTRIBUTE";a:1:{i:1;a:2:{s:13:"attributeLdap";s:4:"test";s:13:"attributeUser";s:13:"USR_FIRSTNAME";}}s:20:"LDAP_PAGE_SIZE_LIMIT";i:1000;}'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,17 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for a role
|
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\RbacRoles::class, function(Faker $faker) {
|
namespace Database\Factories;
|
||||||
return [
|
|
||||||
'ROL_UID' => G::generateUniqueID(),
|
use App\Factories\Factory;
|
||||||
'ROL_PARENT' => '', // This value is empty because actually don't exists this type of relations between roles
|
use G;
|
||||||
'ROL_SYSTEM' => '00000000000000000000000000000002', // Hardcoded value, this value refers to ProcessMaker
|
use Illuminate\Support\Str;
|
||||||
'ROL_CODE' => strtoupper($faker->word),
|
|
||||||
'ROL_CREATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
class RbacRolesFactory extends Factory
|
||||||
'ROL_UPDATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
{
|
||||||
'ROL_STATUS' => $faker->randomElement([0, 1])
|
|
||||||
];
|
/**
|
||||||
});
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'ROL_UID' => G::generateUniqueID(),
|
||||||
|
'ROL_PARENT' => '', // This value is empty because actually don't exists this type of relations between roles
|
||||||
|
'ROL_SYSTEM' => '00000000000000000000000000000002', // Hardcoded value, this value refers to ProcessMaker
|
||||||
|
'ROL_CODE' => strtoupper($this->faker->word),
|
||||||
|
'ROL_CREATE_DATE' => $this->faker->date('Y-m-d H:i:s', 'now'),
|
||||||
|
'ROL_UPDATE_DATE' => $this->faker->date('Y-m-d H:i:s', 'now'),
|
||||||
|
'ROL_STATUS' => $this->faker->randomElement([0, 1])
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,46 +1,82 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\RbacUsers::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'USR_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'USR_USERNAME' => $faker->unique()->userName,
|
|
||||||
'USR_PASSWORD' => $faker->password,
|
|
||||||
'USR_FIRSTNAME' => $faker->firstName,
|
|
||||||
'USR_LASTNAME' => $faker->lastName,
|
|
||||||
'USR_EMAIL' => $faker->unique()->email,
|
|
||||||
'USR_DUE_DATE' => $faker->dateTimeInInterval('now', '+1 year')->format('Y-m-d H:i:s'),
|
|
||||||
'USR_CREATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
|
||||||
'USR_UPDATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
|
||||||
'USR_STATUS' => $faker->randomElement([0, 1]),
|
|
||||||
'USR_AUTH_TYPE' => 'MYSQL', // Authentication type, by default is MySQL
|
|
||||||
'UID_AUTH_SOURCE' => '00000000000000000000000000000000', // When the type is "MYSQL" the value for this field is this...
|
|
||||||
'USR_AUTH_USER_DN' => '', // Don't required for now
|
|
||||||
'USR_AUTH_SUPERVISOR_DN' => '' // Don't required for now
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a deleted user
|
class RbacUsersFactory extends Factory
|
||||||
$factory->state(\ProcessMaker\Model\RbacUsers::class, 'deleted', function () {
|
{
|
||||||
return [
|
|
||||||
'USR_USERNAME' => '',
|
|
||||||
'USR_STATUS' => 0,
|
|
||||||
'USR_AUTH_TYPE' => '',
|
|
||||||
'UID_AUTH_SOURCE' => ''
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create an active user
|
/**
|
||||||
$factory->state(\ProcessMaker\Model\RbacUsers::class, 'active', function () {
|
* Define the model's default state.
|
||||||
return [
|
*
|
||||||
'USR_STATUS' => 1
|
* @return array
|
||||||
];
|
*/
|
||||||
});
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'USR_UID' => G::generateUniqueID(),
|
||||||
|
'USR_USERNAME' => $this->faker->unique()->userName,
|
||||||
|
'USR_PASSWORD' => $this->faker->password,
|
||||||
|
'USR_FIRSTNAME' => $this->faker->firstName,
|
||||||
|
'USR_LASTNAME' => $this->faker->lastName,
|
||||||
|
'USR_EMAIL' => $this->faker->unique()->email,
|
||||||
|
'USR_DUE_DATE' => $this->faker->dateTimeInInterval('now', '+1 year')->format('Y-m-d H:i:s'),
|
||||||
|
'USR_CREATE_DATE' => $this->faker->date('Y-m-d H:i:s', 'now'),
|
||||||
|
'USR_UPDATE_DATE' => $this->faker->date('Y-m-d H:i:s', 'now'),
|
||||||
|
'USR_STATUS' => $this->faker->randomElement([0, 1]),
|
||||||
|
'USR_AUTH_TYPE' => 'MYSQL', // Authentication type, by default is MySQL
|
||||||
|
'UID_AUTH_SOURCE' => '00000000000000000000000000000000', // When the type is "MYSQL" the value for this field is this...
|
||||||
|
'USR_AUTH_USER_DN' => '', // Don't required for now
|
||||||
|
'USR_AUTH_SUPERVISOR_DN' => '' // Don't required for now
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
// Create an inactive user
|
/**
|
||||||
$factory->state(\ProcessMaker\Model\RbacUsers::class, 'inactive', function () {
|
* Create a deleted user
|
||||||
return [
|
* @return type
|
||||||
'USR_STATUS' => 0
|
*/
|
||||||
];
|
public function deleted()
|
||||||
});
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
return [
|
||||||
|
'USR_USERNAME' => '',
|
||||||
|
'USR_STATUS' => 0,
|
||||||
|
'USR_AUTH_TYPE' => '',
|
||||||
|
'UID_AUTH_SOURCE' => ''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an active user
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function active()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
return [
|
||||||
|
'USR_STATUS' => 1
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an inactive user
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function inactive()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
return [
|
||||||
|
'USR_STATUS' => 0
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,17 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for a role assigned to an user
|
|
||||||
*/
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\RbacUsersRoles::class, function() {
|
namespace Database\Factories;
|
||||||
return [
|
|
||||||
'USR_UID' => function() {
|
use App\Factories\Factory;
|
||||||
$rbacUser = factory(\ProcessMaker\Model\RbacUsers::class)->create();
|
use Illuminate\Support\Str;
|
||||||
return $rbacUser->USR_UID;
|
|
||||||
},
|
class RbacUsersRolesFactory extends Factory
|
||||||
'ROL_UID' => function() {
|
{
|
||||||
$rbacRole = factory(\ProcessMaker\Model\RbacRoles::class)->create();
|
|
||||||
return $rbacRole->ROL_UID;
|
/**
|
||||||
}
|
* Define the model's default state.
|
||||||
];
|
*
|
||||||
});
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'USR_UID' => function () {
|
||||||
|
$rbacUser = \ProcessMaker\Model\RbacUsers::factory()->create();
|
||||||
|
return $rbacUser->USR_UID;
|
||||||
|
},
|
||||||
|
'ROL_UID' => function () {
|
||||||
|
$rbacRole = \ProcessMaker\Model\RbacRoles::factory()->create();
|
||||||
|
return $rbacRole->ROL_UID;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,22 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for a process
|
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Route::class, function(Faker $faker) {
|
namespace Database\Factories;
|
||||||
return [
|
|
||||||
'PRO_UID' => function() {
|
use App\Factories\Factory;
|
||||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
use G;
|
||||||
return $process->PRO_UID;
|
use Illuminate\Support\Str;
|
||||||
},
|
|
||||||
'TAS_UID' => function() {
|
class RouteFactory extends Factory
|
||||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
{
|
||||||
return $task->TAS_UID;
|
|
||||||
},
|
/**
|
||||||
'ROU_UID' => G::generateUniqueID(),
|
* Define the model's default state.
|
||||||
'ROU_PARENT' => 0,
|
*
|
||||||
'ROU_CASE' => 1,
|
* @return array
|
||||||
'ROU_TYPE' => 'SEQUENTIAL'
|
*/
|
||||||
];
|
public function definition()
|
||||||
});
|
{
|
||||||
|
return [
|
||||||
|
'PRO_UID' => function () {
|
||||||
|
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||||
|
return $process->PRO_UID;
|
||||||
|
},
|
||||||
|
'TAS_UID' => function () {
|
||||||
|
$task = \ProcessMaker\Model\Task::factory()->create();
|
||||||
|
return $task->TAS_UID;
|
||||||
|
},
|
||||||
|
'ROU_UID' => G::generateUniqueID(),
|
||||||
|
'ROU_PARENT' => 0,
|
||||||
|
'ROU_CASE' => 1,
|
||||||
|
'ROU_TYPE' => 'SEQUENTIAL'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,16 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Step::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'STEP_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
|
||||||
'TAS_UID' => G::generateUniqueID(),
|
class StepFactory extends Factory
|
||||||
'STEP_TYPE_OBJ' => 'DYNAFORM',
|
{
|
||||||
'STEP_UID_OBJ' => '0',
|
|
||||||
'STEP_CONDITION' => 'None',
|
/**
|
||||||
'STEP_POSITION' => 0,
|
* Define the model's default state.
|
||||||
'STEP_MODE' => 'EDIT'
|
*
|
||||||
];
|
* @return array
|
||||||
});
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'STEP_UID' => G::generateUniqueID(),
|
||||||
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
|
'TAS_UID' => G::generateUniqueID(),
|
||||||
|
'STEP_TYPE_OBJ' => 'DYNAFORM',
|
||||||
|
'STEP_UID_OBJ' => '0',
|
||||||
|
'STEP_CONDITION' => 'None',
|
||||||
|
'STEP_POSITION' => 0,
|
||||||
|
'STEP_MODE' => 'EDIT'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,18 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\StepTrigger::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
'STEP_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
|
||||||
'TAS_UID' => function() {
|
class StepTriggerFactory extends Factory
|
||||||
return factory(\ProcessMaker\Model\Task::class)->create()->TAS_UID;
|
{
|
||||||
},
|
|
||||||
'TRI_UID' => function() {
|
/**
|
||||||
return factory(\ProcessMaker\Model\Triggers::class)->create()->TRI_UID;
|
* Define the model's default state.
|
||||||
},
|
*
|
||||||
'ST_TYPE' => 'BEFORE',
|
* @return array
|
||||||
'ST_CONDITION' => '',
|
*/
|
||||||
'ST_POSITION' => 1,
|
public function definition()
|
||||||
];
|
{
|
||||||
});
|
return [
|
||||||
|
'STEP_UID' => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||||
|
'TAS_UID' => function () {
|
||||||
|
return \ProcessMaker\Model\Task::factory()->create()->TAS_UID;
|
||||||
|
},
|
||||||
|
'TRI_UID' => function () {
|
||||||
|
return \ProcessMaker\Model\Triggers::factory()->create()->TRI_UID;
|
||||||
|
},
|
||||||
|
'ST_TYPE' => 'BEFORE',
|
||||||
|
'ST_CONDITION' => '',
|
||||||
|
'ST_POSITION' => 1,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,17 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\SubApplication::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'APP_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'APP_PARENT' => G::generateUniqueID(),
|
|
||||||
'DEL_INDEX_PARENT' => 2,
|
class SubApplicationFactory extends Factory
|
||||||
'DEL_THREAD_PARENT' => 1,
|
{
|
||||||
'SA_STATUS' => 'ACTIVE',
|
|
||||||
'SA_VALUES_OUT' => 'a:0:{}',
|
/**
|
||||||
'SA_VALUES_IN' => 'a:0:{}',
|
* Define the model's default state.
|
||||||
'SA_INIT_DATE' => $faker->dateTime(),
|
*
|
||||||
'SA_FINISH_DATE' => $faker->dateTime(),
|
* @return array
|
||||||
];
|
*/
|
||||||
});
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'APP_UID' => G::generateUniqueID(),
|
||||||
|
'APP_PARENT' => G::generateUniqueID(),
|
||||||
|
'DEL_INDEX_PARENT' => 2,
|
||||||
|
'DEL_THREAD_PARENT' => 1,
|
||||||
|
'SA_STATUS' => 'ACTIVE',
|
||||||
|
'SA_VALUES_OUT' => 'a:0:{}',
|
||||||
|
'SA_VALUES_IN' => 'a:0:{}',
|
||||||
|
'SA_INIT_DATE' => $this->faker->dateTime(),
|
||||||
|
'SA_FINISH_DATE' => $this->faker->dateTime(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,18 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\SubProcess::class, function () {
|
namespace Database\Factories;
|
||||||
return [
|
|
||||||
'SP_UID' => G::generateUniqueID(),
|
use App\Factories\Factory;
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
use G;
|
||||||
'TAS_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'PRO_PARENT' => G::generateUniqueID(),
|
|
||||||
'TAS_PARENT' => G::generateUniqueID(),
|
class SubProcessFactory extends Factory
|
||||||
'SP_TYPE' => '',
|
{
|
||||||
'SP_SYNCHRONOUS' => 0,
|
|
||||||
'SP_SYNCHRONOUS_TYPE' => '',
|
/**
|
||||||
'SP_SYNCHRONOUS_WAIT' => 0,
|
* Define the model's default state.
|
||||||
'SP_VARIABLES_OUT' => '',
|
*
|
||||||
'SP_VARIABLES_IN' => '',
|
* @return array
|
||||||
'SP_GRID_IN' => ''
|
*/
|
||||||
];
|
public function definition()
|
||||||
});
|
{
|
||||||
|
return [
|
||||||
|
'SP_UID' => G::generateUniqueID(),
|
||||||
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
|
'TAS_UID' => G::generateUniqueID(),
|
||||||
|
'PRO_PARENT' => G::generateUniqueID(),
|
||||||
|
'TAS_PARENT' => G::generateUniqueID(),
|
||||||
|
'SP_TYPE' => '',
|
||||||
|
'SP_SYNCHRONOUS' => 0,
|
||||||
|
'SP_SYNCHRONOUS_TYPE' => '',
|
||||||
|
'SP_SYNCHRONOUS_WAIT' => 0,
|
||||||
|
'SP_VARIABLES_OUT' => '',
|
||||||
|
'SP_VARIABLES_IN' => '',
|
||||||
|
'SP_GRID_IN' => ''
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,90 +1,116 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
namespace Database\Factories;
|
||||||
* Model factory for a process
|
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\Task::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
use G;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
'PRO_UID' => $process->PRO_UID,
|
|
||||||
'PRO_ID' => $process->PRO_ID,
|
|
||||||
'TAS_UID' => G::generateUniqueID(),
|
|
||||||
'TAS_TITLE' => $faker->sentence(2),
|
|
||||||
'TAS_TYPE' => 'NORMAL',
|
|
||||||
'TAS_TYPE_DAY' => 1,
|
|
||||||
'TAS_DURATION' => 1,
|
|
||||||
'TAS_ASSIGN_TYPE' => 'BALANCED',
|
|
||||||
'TAS_DEF_TITLE' => $faker->sentence(2),
|
|
||||||
'TAS_DEF_DESCRIPTION' => $faker->sentence(2),
|
|
||||||
'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED',
|
|
||||||
'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE',
|
|
||||||
'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE',
|
|
||||||
'TAS_ASSIGN_LOCATION' => 'FALSE',
|
|
||||||
'TAS_ASSIGN_LOCATION_ADHOC' => 'FALSE',
|
|
||||||
'TAS_TRANSFER_FLY' => 'FALSE',
|
|
||||||
'TAS_LAST_ASSIGNED' => 0,
|
|
||||||
'TAS_USER' => 0,
|
|
||||||
'TAS_CAN_UPLOAD' => 'FALSE',
|
|
||||||
'TAS_CAN_CANCEL' => 'FALSE',
|
|
||||||
'TAS_OWNER_APP' => 'FALSE',
|
|
||||||
'TAS_CAN_SEND_MESSAGE' => 'FALSE',
|
|
||||||
'TAS_SEND_LAST_EMAIL' => 'FALSE',
|
|
||||||
'TAS_SELFSERVICE_TIMEOUT' => 0,
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a task with the foreign keys
|
class TaskFactory extends Factory
|
||||||
$factory->state(\ProcessMaker\Model\Task::class, 'foreign_keys', function (Faker $faker) {
|
{
|
||||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
|
||||||
return [
|
|
||||||
'PRO_UID' => $process->PRO_UID,
|
|
||||||
'PRO_ID' => $process->PRO_ID,
|
|
||||||
'TAS_UID' => G::generateUniqueID(),
|
|
||||||
'TAS_TITLE' => $faker->sentence(2),
|
|
||||||
'TAS_TYPE' => 'NORMAL',
|
|
||||||
'TAS_TYPE_DAY' => 1,
|
|
||||||
'TAS_DURATION' => 1,
|
|
||||||
'TAS_ASSIGN_TYPE' => 'BALANCED',
|
|
||||||
'TAS_DEF_TITLE' => $faker->sentence(2),
|
|
||||||
'TAS_DEF_DESCRIPTION' => $faker->sentence(2),
|
|
||||||
'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED',
|
|
||||||
'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE',
|
|
||||||
'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE',
|
|
||||||
'TAS_ASSIGN_LOCATION' => 'FALSE',
|
|
||||||
'TAS_ASSIGN_LOCATION_ADHOC' => 'FALSE',
|
|
||||||
'TAS_TRANSFER_FLY' => 'FALSE',
|
|
||||||
'TAS_LAST_ASSIGNED' => 0,
|
|
||||||
'TAS_USER' => 0,
|
|
||||||
'TAS_CAN_UPLOAD' => 'FALSE',
|
|
||||||
'TAS_CAN_CANCEL' => 'FALSE',
|
|
||||||
'TAS_OWNER_APP' => 'FALSE',
|
|
||||||
'TAS_CAN_SEND_MESSAGE' => 'FALSE',
|
|
||||||
'TAS_SEND_LAST_EMAIL' => 'FALSE',
|
|
||||||
'TAS_SELFSERVICE_TIMEOUT' => 0,
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a task related with the self-service timeout execution
|
/**
|
||||||
$factory->state(\ProcessMaker\Model\Task::class, 'sef_service_timeout', function (Faker $faker) {
|
* Define the model's default state.
|
||||||
$timeUnit = $faker->randomElement(['MINUTES', 'HOURS', 'DAYS']);
|
*
|
||||||
$execution = $faker->randomElement(['EVERY_TIME', 'ONCE']);
|
* @return array
|
||||||
return [
|
*/
|
||||||
'TAS_UID' => G::generateUniqueID(),
|
public function definition()
|
||||||
'TAS_ID' => $faker->unique()->numberBetween(1, 200000),
|
{
|
||||||
'TAS_TITLE' => $faker->sentence(2),
|
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||||
'TAS_TYPE' => 'NORMAL',
|
return [
|
||||||
'TAS_TYPE_DAY' => 1,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_DURATION' => 1,
|
'PRO_ID' => $process->PRO_ID,
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_UID' => G::generateUniqueID(),
|
||||||
'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED',
|
'TAS_TITLE' => $this->faker->sentence(2),
|
||||||
'TAS_SELFSERVICE_TIMEOUT' => 1,
|
'TAS_TYPE' => 'NORMAL',
|
||||||
'TAS_SELFSERVICE_TIME' => $faker->unique()->numberBetween(1, 24),
|
'TAS_TYPE_DAY' => 1,
|
||||||
'TAS_SELFSERVICE_TIME_UNIT' => $timeUnit,
|
'TAS_DURATION' => 1,
|
||||||
'TAS_SELFSERVICE_TRIGGER_UID' => function() {
|
'TAS_ASSIGN_TYPE' => 'BALANCED',
|
||||||
return $trigger = factory(\ProcessMaker\Model\Triggers::class)->create()->TRI_UID;
|
'TAS_DEF_TITLE' => $this->faker->sentence(2),
|
||||||
},
|
'TAS_DEF_DESCRIPTION' => $this->faker->sentence(2),
|
||||||
'TAS_SELFSERVICE_EXECUTION' => $execution,
|
'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED',
|
||||||
];
|
'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE',
|
||||||
});
|
'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE',
|
||||||
|
'TAS_ASSIGN_LOCATION' => 'FALSE',
|
||||||
|
'TAS_ASSIGN_LOCATION_ADHOC' => 'FALSE',
|
||||||
|
'TAS_TRANSFER_FLY' => 'FALSE',
|
||||||
|
'TAS_LAST_ASSIGNED' => 0,
|
||||||
|
'TAS_USER' => 0,
|
||||||
|
'TAS_CAN_UPLOAD' => 'FALSE',
|
||||||
|
'TAS_CAN_CANCEL' => 'FALSE',
|
||||||
|
'TAS_OWNER_APP' => 'FALSE',
|
||||||
|
'TAS_CAN_SEND_MESSAGE' => 'FALSE',
|
||||||
|
'TAS_SEND_LAST_EMAIL' => 'FALSE',
|
||||||
|
'TAS_SELFSERVICE_TIMEOUT' => 0,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a task with the foreign keys
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function foreign_keys()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||||
|
return [
|
||||||
|
'PRO_UID' => $process->PRO_UID,
|
||||||
|
'PRO_ID' => $process->PRO_ID,
|
||||||
|
'TAS_UID' => G::generateUniqueID(),
|
||||||
|
'TAS_TITLE' => $this->faker->sentence(2),
|
||||||
|
'TAS_TYPE' => 'NORMAL',
|
||||||
|
'TAS_TYPE_DAY' => 1,
|
||||||
|
'TAS_DURATION' => 1,
|
||||||
|
'TAS_ASSIGN_TYPE' => 'BALANCED',
|
||||||
|
'TAS_DEF_TITLE' => $this->faker->sentence(2),
|
||||||
|
'TAS_DEF_DESCRIPTION' => $this->faker->sentence(2),
|
||||||
|
'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED',
|
||||||
|
'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE',
|
||||||
|
'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE',
|
||||||
|
'TAS_ASSIGN_LOCATION' => 'FALSE',
|
||||||
|
'TAS_ASSIGN_LOCATION_ADHOC' => 'FALSE',
|
||||||
|
'TAS_TRANSFER_FLY' => 'FALSE',
|
||||||
|
'TAS_LAST_ASSIGNED' => 0,
|
||||||
|
'TAS_USER' => 0,
|
||||||
|
'TAS_CAN_UPLOAD' => 'FALSE',
|
||||||
|
'TAS_CAN_CANCEL' => 'FALSE',
|
||||||
|
'TAS_OWNER_APP' => 'FALSE',
|
||||||
|
'TAS_CAN_SEND_MESSAGE' => 'FALSE',
|
||||||
|
'TAS_SEND_LAST_EMAIL' => 'FALSE',
|
||||||
|
'TAS_SELFSERVICE_TIMEOUT' => 0,
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a task related with the self-service timeout execution
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function sef_service_timeout()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
$timeUnit = $this->faker->randomElement(['MINUTES', 'HOURS', 'DAYS']);
|
||||||
|
$execution = $this->faker->randomElement(['EVERY_TIME', 'ONCE']);
|
||||||
|
return [
|
||||||
|
'TAS_UID' => G::generateUniqueID(),
|
||||||
|
'TAS_ID' => $this->faker->unique()->numberBetween(1, 200000),
|
||||||
|
'TAS_TITLE' => $this->faker->sentence(2),
|
||||||
|
'TAS_TYPE' => 'NORMAL',
|
||||||
|
'TAS_TYPE_DAY' => 1,
|
||||||
|
'TAS_DURATION' => 1,
|
||||||
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
|
'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED',
|
||||||
|
'TAS_SELFSERVICE_TIMEOUT' => 1,
|
||||||
|
'TAS_SELFSERVICE_TIME' => $this->faker->unique()->numberBetween(1, 24),
|
||||||
|
'TAS_SELFSERVICE_TIME_UNIT' => $timeUnit,
|
||||||
|
'TAS_SELFSERVICE_TRIGGER_UID' => function () {
|
||||||
|
return $trigger = \ProcessMaker\Model\Triggers::factory()->create()->TRI_UID;
|
||||||
|
},
|
||||||
|
'TAS_SELFSERVICE_EXECUTION' => $execution,
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,27 +1,38 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
namespace Database\Factories;
|
||||||
* Model factory for a task scheduler
|
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\TaskScheduler::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
'id' => $faker->unique()->numberBetween(5000),
|
|
||||||
'title' => $faker->title,
|
class TaskSchedulerFactory extends Factory
|
||||||
'startingTime' => $faker->dateTime(),
|
{
|
||||||
'endingTime' => $faker->dateTime(),
|
|
||||||
'everyOn' => "",
|
/**
|
||||||
'interval' => "",
|
* Define the model's default state.
|
||||||
'description' => "",
|
*
|
||||||
'expression' => "",
|
* @return array
|
||||||
'body' => "",
|
*/
|
||||||
'type' => "",
|
public function definition()
|
||||||
'category' => "emails_notifications", //emails_notifications, case_actions, plugins, processmaker_sync
|
{
|
||||||
'system' => "",
|
return [
|
||||||
'timezone' => "",
|
'id' => $this->faker->unique()->numberBetween(5000),
|
||||||
'enable' => "",
|
'title' => $this->faker->title,
|
||||||
'creation_date' => $faker->dateTime(),
|
'startingTime' => $this->faker->dateTime(),
|
||||||
'last_update' => $faker->dateTime()
|
'endingTime' => $this->faker->dateTime(),
|
||||||
];
|
'everyOn' => "",
|
||||||
});
|
'interval' => "",
|
||||||
|
'description' => "",
|
||||||
|
'expression' => "",
|
||||||
|
'body' => "",
|
||||||
|
'type' => "",
|
||||||
|
'category' => "emails_notifications", //emails_notifications, case_actions, plugins, processmaker_sync
|
||||||
|
'system' => "",
|
||||||
|
'timezone' => "",
|
||||||
|
'enable' => "",
|
||||||
|
'creation_date' => $this->faker->dateTime(),
|
||||||
|
'last_update' => $this->faker->dateTime()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,70 +1,106 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\TaskUser::class, function(Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use Illuminate\Support\Str;
|
||||||
'TAS_UID' => function() {
|
|
||||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
|
||||||
return $task->TAS_UID;
|
|
||||||
},
|
|
||||||
'TU_TYPE' => 1,
|
|
||||||
'TU_RELATION' => 1
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a delegation with the foreign keys
|
class TaskUserFactory extends Factory
|
||||||
$factory->state(\ProcessMaker\Model\TaskUser::class, 'foreign_keys', function (Faker $faker) {
|
{
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
|
||||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
|
||||||
return [
|
|
||||||
'TAS_UID' => $task->TAS_UID,
|
|
||||||
'USR_UID' => $user->USR_UID,
|
|
||||||
'TU_TYPE' => 1,
|
|
||||||
'TU_RELATION' => 1
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\TaskUser::class, 'normal_assigment_user', function (Faker $faker) {
|
/**
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
* Define the model's default state.
|
||||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
*
|
||||||
return [
|
* @return array
|
||||||
'TAS_UID' => $task->TAS_UID,
|
*/
|
||||||
'USR_UID' => $user->USR_UID,
|
public function definition()
|
||||||
'TU_RELATION' => 1,
|
{
|
||||||
'TU_TYPE' => 1,
|
return [
|
||||||
];
|
'TAS_UID' => function () {
|
||||||
});
|
$task = \ProcessMaker\Model\Task::factory()->create();
|
||||||
|
return $task->TAS_UID;
|
||||||
|
},
|
||||||
|
'TU_TYPE' => 1,
|
||||||
|
'TU_RELATION' => 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\TaskUser::class, 'normal_assigment_group', function (Faker $faker) {
|
/**
|
||||||
$group = factory(\ProcessMaker\Model\Groupwf::class)->create();
|
* Create a delegation with the foreign keys.
|
||||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
*/
|
||||||
return [
|
public function foreign_keys()
|
||||||
'TAS_UID' => $task->TAS_UID,
|
{
|
||||||
'USR_UID' => $group->GRP_UID,
|
$state = function (array $attributes) {
|
||||||
'TU_RELATION' => 2,
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
'TU_TYPE' => 1,
|
$task = \ProcessMaker\Model\Task::factory()->create();
|
||||||
];
|
return [
|
||||||
});
|
'TAS_UID' => $task->TAS_UID,
|
||||||
|
'USR_UID' => $user->USR_UID,
|
||||||
|
'TU_TYPE' => 1,
|
||||||
|
'TU_RELATION' => 1
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\TaskUser::class, 'adhoc_assigment_user', function (Faker $faker) {
|
public function normal_assigment_user()
|
||||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
{
|
||||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
$state = function (array $attributes) {
|
||||||
return [
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
'TAS_UID' => $task->TAS_UID,
|
$task = \ProcessMaker\Model\Task::factory()->create();
|
||||||
'USR_UID' => $user->USR_UID,
|
return [
|
||||||
'TU_RELATION' => 1,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'TU_TYPE' => 2,
|
'USR_UID' => $user->USR_UID,
|
||||||
];
|
'TU_RELATION' => 1,
|
||||||
});
|
'TU_TYPE' => 1,
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
$factory->state(\ProcessMaker\Model\TaskUser::class, 'adhoc_assigment_group', function (Faker $faker) {
|
public function normal_assigment_group()
|
||||||
$group = factory(\ProcessMaker\Model\Groupwf::class)->create();
|
{
|
||||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
$state = function (array $attributes) {
|
||||||
return [
|
$group = \ProcessMaker\Model\Groupwf::factory()->create();
|
||||||
'TAS_UID' => $task->TAS_UID,
|
$task = \ProcessMaker\Model\Task::factory()->create();
|
||||||
'USR_UID' => $group->GRP_UID,
|
return [
|
||||||
'TU_RELATION' => 2,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'TU_TYPE' => 2,
|
'USR_UID' => $group->GRP_UID,
|
||||||
];
|
'TU_RELATION' => 2,
|
||||||
});
|
'TU_TYPE' => 1,
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function adhoc_assigment_user()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
$user = \ProcessMaker\Model\User::factory()->create();
|
||||||
|
$task = \ProcessMaker\Model\Task::factory()->create();
|
||||||
|
return [
|
||||||
|
'TAS_UID' => $task->TAS_UID,
|
||||||
|
'USR_UID' => $user->USR_UID,
|
||||||
|
'TU_RELATION' => 1,
|
||||||
|
'TU_TYPE' => 2,
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function adhoc_assigment_group()
|
||||||
|
{
|
||||||
|
$state = function (array $attributes) {
|
||||||
|
$group = \ProcessMaker\Model\Groupwf::factory()->create();
|
||||||
|
$task = \ProcessMaker\Model\Task::factory()->create();
|
||||||
|
return [
|
||||||
|
'TAS_UID' => $task->TAS_UID,
|
||||||
|
'USR_UID' => $group->GRP_UID,
|
||||||
|
'TU_RELATION' => 2,
|
||||||
|
'TU_TYPE' => 2,
|
||||||
|
];
|
||||||
|
};
|
||||||
|
return $this->state($state);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,18 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use App\Factories\Factory;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use ProcessMaker\Model\Triggers;
|
use ProcessMaker\Model\Triggers;
|
||||||
|
|
||||||
$factory->define(Triggers::class, function (Faker $faker) {
|
class TriggersFactory extends Factory
|
||||||
return [
|
{
|
||||||
'TRI_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
|
||||||
'TRI_TITLE' => $faker->sentence(5),
|
/**
|
||||||
'TRI_DESCRIPTION' => $faker->text,
|
* Define the model's default state.
|
||||||
'PRO_UID' => function() {
|
*
|
||||||
return factory(\ProcessMaker\Model\Process::class)->create()->PRO_UID;
|
* @return array
|
||||||
},
|
*/
|
||||||
'TRI_TYPE' => 'SCRIPT',
|
public function definition()
|
||||||
'TRI_WEBBOT' => '$var = 1;',
|
{
|
||||||
'TRI_PARAM' => '',
|
return [
|
||||||
];
|
'TRI_UID' => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||||
});
|
'TRI_TITLE' => $this->faker->sentence(5),
|
||||||
|
'TRI_DESCRIPTION' => $this->faker->text,
|
||||||
|
'PRO_UID' => function () {
|
||||||
|
return \ProcessMaker\Model\Process::factory()->create()->PRO_UID;
|
||||||
|
},
|
||||||
|
'TRI_TYPE' => 'SCRIPT',
|
||||||
|
'TRI_WEBBOT' => '$var = 1;',
|
||||||
|
'TRI_PARAM' => '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,21 +1,36 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\User::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'USR_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'USR_USERNAME' => $faker->unique()->userName,
|
|
||||||
'USR_PASSWORD' => $faker->password,
|
class UserFactory extends Factory
|
||||||
'USR_FIRSTNAME' => $faker->firstName,
|
{
|
||||||
'USR_LASTNAME' => $faker->lastName,
|
|
||||||
'USR_EMAIL' => $faker->unique()->email,
|
/**
|
||||||
'USR_DUE_DATE' => new \Carbon\Carbon(2030, 1, 1),
|
* Define the model's default state.
|
||||||
'USR_STATUS' => 'ACTIVE',
|
*
|
||||||
'USR_ROLE' => $faker->randomElement(['PROCESSMAKER_ADMIN', 'PROCESSMAKER_OPERATOR']),
|
* @return array
|
||||||
'USR_UX' => 'NORMAL',
|
*/
|
||||||
'USR_TIME_ZONE' => 'America/Anguilla',
|
public function definition()
|
||||||
'USR_DEFAULT_LANG' => 'en',
|
{
|
||||||
'USR_LAST_LOGIN' => new \Carbon\Carbon(2019, 1, 1)
|
return [
|
||||||
];
|
'USR_UID' => G::generateUniqueID(),
|
||||||
});
|
'USR_USERNAME' => $this->faker->unique()->userName,
|
||||||
|
'USR_PASSWORD' => $this->faker->password,
|
||||||
|
'USR_FIRSTNAME' => $this->faker->firstName,
|
||||||
|
'USR_LASTNAME' => $this->faker->lastName,
|
||||||
|
'USR_EMAIL' => $this->faker->unique()->email,
|
||||||
|
'USR_DUE_DATE' => new \Carbon\Carbon(2030, 1, 1),
|
||||||
|
'USR_STATUS' => 'ACTIVE',
|
||||||
|
'USR_ROLE' => $this->faker->randomElement(['PROCESSMAKER_ADMIN', 'PROCESSMAKER_OPERATOR']),
|
||||||
|
'USR_UX' => 'NORMAL',
|
||||||
|
'USR_TIME_ZONE' => 'America/Anguilla',
|
||||||
|
'USR_DEFAULT_LANG' => 'en',
|
||||||
|
'USR_LAST_LOGIN' => new \Carbon\Carbon(2019, 1, 1)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,13 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
namespace Database\Factories;
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\UserReporting::class, function (Faker $faker) {
|
use App\Factories\Factory;
|
||||||
return [
|
use G;
|
||||||
'USR_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'TAS_UID' => G::generateUniqueID(),
|
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
class UserReportingFactory extends Factory
|
||||||
'MONTH' => 12,
|
{
|
||||||
'YEAR' => 2020,
|
|
||||||
];
|
/**
|
||||||
});
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'USR_UID' => G::generateUniqueID(),
|
||||||
|
'TAS_UID' => G::generateUniqueID(),
|
||||||
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
|
'MONTH' => 12,
|
||||||
|
'YEAR' => 2020,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,33 +1,46 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Model factory for web entries
|
|
||||||
*/
|
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(\ProcessMaker\Model\WebEntry::class, function(Faker $faker) {
|
namespace Database\Factories;
|
||||||
return [
|
|
||||||
'WE_UID' => G::generateUniqueID(),
|
use App\Factories\Factory;
|
||||||
'PRO_UID' => G::generateUniqueID(),
|
use G;
|
||||||
'TAS_UID' => G::generateUniqueID(),
|
use Illuminate\Support\Str;
|
||||||
'DYN_UID' => G::generateUniqueID(),
|
|
||||||
'USR_UID' => G::generateUniqueID(),
|
class WebEntryFactory extends Factory
|
||||||
'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(),
|
* Define the model's default state.
|
||||||
'WE_UPDATE_USR_UID' => G::generateUniqueID(),
|
*
|
||||||
'WE_CREATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
* @return array
|
||||||
'WE_UPDATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
*/
|
||||||
'WE_TYPE' => $faker->randomElement(['SINGLE', 'MULTIPLE']),
|
public function definition()
|
||||||
'WE_CUSTOM_TITLE' => $faker->words(5, true),
|
{
|
||||||
'WE_AUTHENTICATION' => $faker->randomElement(['LOGIN_REQUIRED', 'ANONYMOUS']),
|
return [
|
||||||
'WE_HIDE_INFORMATION_BAR' => $faker->randomElement(['0', '1']),
|
'WE_UID' => G::generateUniqueID(),
|
||||||
'WE_CALLBACK' => $faker->randomElement(['PROCESSMAKER', 'CUSTOM', 'CUSTOM_CLEAR']),
|
'PRO_UID' => G::generateUniqueID(),
|
||||||
'WE_CALLBACK_URL' => $faker->url,
|
'TAS_UID' => G::generateUniqueID(),
|
||||||
'WE_LINK_GENERATION' => $faker->randomElement(['DEFAULT', 'ADVANCED']),
|
'DYN_UID' => G::generateUniqueID(),
|
||||||
'WE_LINK_SKIN' => 'classic',
|
'USR_UID' => G::generateUniqueID(),
|
||||||
'WE_LINK_LANGUAGE' => 'en',
|
'WE_METHOD' => $this->faker->randomElement(['WS', 'HTML']),
|
||||||
'WE_LINK_DOMAIN' => $faker->domainName,
|
'WE_INPUT_DOCUMENT_ACCESS' => $this->faker->randomElement([0, 1]),
|
||||||
'WE_SHOW_IN_NEW_CASE' => $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_LINK_SKIN' => 'classic',
|
||||||
|
'WE_LINK_LANGUAGE' => 'en',
|
||||||
|
'WE_LINK_DOMAIN' => $this->faker->domainName,
|
||||||
|
'WE_SHOW_IN_NEW_CASE' => $this->faker->randomElement(['0', '1'])
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ class Bootstrap
|
|||||||
* @param array list plugins active
|
* @param array list plugins active
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function LoadTranslationPlugins($lang = SYS_LANG, $listPluginsActive)
|
public static function LoadTranslationPlugins($lang = SYS_LANG, $listPluginsActive = [])
|
||||||
{
|
{
|
||||||
if (! (is_array($listPluginsActive))) {
|
if (! (is_array($listPluginsActive))) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace Tests\Feature;
|
namespace Tests\Feature;
|
||||||
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use ProcessMaker\Model\DbSource;
|
use ProcessMaker\Model\DbSource;
|
||||||
use ProcessMaker\Model\Process;
|
use ProcessMaker\Model\Process;
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class DBQueryTest extends TestCase
|
class DBQueryTest extends TestCase
|
||||||
@@ -16,7 +16,7 @@ class DBQueryTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* Sets up the unit tests.
|
* Sets up the unit tests.
|
||||||
*/
|
*/
|
||||||
protected function setUp()
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,9 @@ class DBQueryTest extends TestCase
|
|||||||
'USR_UID' => '00000000000000000000000000000001',
|
'USR_UID' => '00000000000000000000000000000001',
|
||||||
'USR_USERNAME' => 'admin'
|
'USR_USERNAME' => 'admin'
|
||||||
];
|
];
|
||||||
$this->assertArraySubset($expected, $results[1]);
|
foreach ($expected as $key => $value) {
|
||||||
|
$this->assertEquals($value, $results[1][$key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,9 +58,9 @@ class DBQueryTest extends TestCase
|
|||||||
{
|
{
|
||||||
// Our test external database is created in our tests/bootstrap.php file
|
// Our test external database is created in our tests/bootstrap.php file
|
||||||
// We'll use our factories to create our process and database
|
// We'll use our factories to create our process and database
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
// Let's create an external DB to ourselves
|
// Let's create an external DB to ourselves
|
||||||
$externalDB = factory(DbSource::class)->create([
|
$externalDB = DbSource::factory()->create([
|
||||||
'DBS_SERVER' => config('database.connections.testexternal.host'),
|
'DBS_SERVER' => config('database.connections.testexternal.host'),
|
||||||
'DBS_PORT' => '3306',
|
'DBS_PORT' => '3306',
|
||||||
'DBS_USERNAME' => config('database.connections.testexternal.username'),
|
'DBS_USERNAME' => config('database.connections.testexternal.username'),
|
||||||
@@ -90,9 +92,9 @@ class DBQueryTest extends TestCase
|
|||||||
}
|
}
|
||||||
// Our test external database is created in our tests/bootstrap.php file
|
// Our test external database is created in our tests/bootstrap.php file
|
||||||
// We'll use our factories to create our process and database
|
// We'll use our factories to create our process and database
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
// Let's create an external DB to ourselves
|
// Let's create an external DB to ourselves
|
||||||
$externalDB = factory(DbSource::class)->create([
|
$externalDB = DbSource::factory()->create([
|
||||||
'DBS_SERVER' => env('MSSQL_HOST'),
|
'DBS_SERVER' => env('MSSQL_HOST'),
|
||||||
'DBS_PORT' => env('MSSQL_PORT'),
|
'DBS_PORT' => env('MSSQL_PORT'),
|
||||||
'DBS_TYPE' => 'mssql',
|
'DBS_TYPE' => 'mssql',
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Perfomance\workflow\src\ProcessMaker\Model;
|
namespace Tests\Perfomance\workflow\src\ProcessMaker\Model;
|
||||||
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
@@ -48,24 +49,24 @@ class DelegationTest extends TestCase
|
|||||||
//Define the maximum time of execution
|
//Define the maximum time of execution
|
||||||
$maximumTime = $this->maximumExecutionTime;
|
$maximumTime = $this->maximumExecutionTime;
|
||||||
//Create process
|
//Create process
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
//Create user
|
//Create user
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
//Create a task self service
|
//Create a task self service
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '',
|
'TAS_GROUP_VARIABLE' => '',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Assign a user in the task
|
//Assign a user in the task
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
'TU_RELATION' => 1, //Related to the user
|
'TU_RELATION' => 1, //Related to the user
|
||||||
'TU_TYPE' => 1
|
'TU_TYPE' => 1
|
||||||
]);
|
]);
|
||||||
//Create the register in delegation relate to self-service
|
//Create the register in delegation relate to self-service
|
||||||
factory(Delegation::class, $total)->create([
|
Delegation::factory($total)->create([
|
||||||
'TAS_ID' => $task->TAS_ID,
|
'TAS_ID' => $task->TAS_ID,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
'USR_ID' => 0,
|
'USR_ID' => 0,
|
||||||
@@ -93,31 +94,31 @@ class DelegationTest extends TestCase
|
|||||||
//Define the maximum time of execution
|
//Define the maximum time of execution
|
||||||
$maximumTime = $this->maximumExecutionTime;
|
$maximumTime = $this->maximumExecutionTime;
|
||||||
//Create process
|
//Create process
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
//Create a case
|
//Create a case
|
||||||
$application = factory(Application::class)->create();
|
$application = Application::factory()->create();
|
||||||
//Create user
|
//Create user
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
//Create a task self service value based
|
//Create a task self service value based
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Create the relation for the value assigned in the TAS_GROUP_VARIABLE
|
//Create the relation for the value assigned in the TAS_GROUP_VARIABLE
|
||||||
$appSelfValue = factory(AppAssignSelfServiceValue::class)->create([
|
$appSelfValue = AppAssignSelfServiceValue::factory()->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'TAS_ID' => $task->TAS_ID
|
'TAS_ID' => $task->TAS_ID
|
||||||
]);
|
]);
|
||||||
factory(AppAssignSelfServiceValueGroup::class)->create([
|
AppAssignSelfServiceValueGroup::factory()->create([
|
||||||
'ID' => $appSelfValue->ID,
|
'ID' => $appSelfValue->ID,
|
||||||
'GRP_UID' => $user->USR_UID,
|
'GRP_UID' => $user->USR_UID,
|
||||||
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
||||||
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
||||||
]);
|
]);
|
||||||
//Create the register in self-service
|
//Create the register in self-service
|
||||||
factory(Delegation::class, $total)->create([
|
Delegation::factory($total)->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
||||||
'TAS_ID' => $task->TAS_ID,
|
'TAS_ID' => $task->TAS_ID,
|
||||||
@@ -146,50 +147,50 @@ class DelegationTest extends TestCase
|
|||||||
//Define the maximum time of execution
|
//Define the maximum time of execution
|
||||||
$maximumTime = $this->maximumExecutionTime;
|
$maximumTime = $this->maximumExecutionTime;
|
||||||
//Create process
|
//Create process
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
//Create a case
|
//Create a case
|
||||||
$application = factory(Application::class)->create();
|
$application = Application::factory()->create();
|
||||||
//Create user
|
//Create user
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
//Create a task self service
|
//Create a task self service
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '',
|
'TAS_GROUP_VARIABLE' => '',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Assign a user in the task
|
//Assign a user in the task
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
'TU_RELATION' => 1, //Related to the user
|
'TU_RELATION' => 1, //Related to the user
|
||||||
'TU_TYPE' => 1
|
'TU_TYPE' => 1
|
||||||
]);
|
]);
|
||||||
//Create the register in self service
|
//Create the register in self service
|
||||||
factory(Delegation::class, $total / 2)->create([
|
Delegation::factory($total / 2)->create([
|
||||||
'TAS_ID' => $task->TAS_ID,
|
'TAS_ID' => $task->TAS_ID,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
'USR_ID' => 0,
|
'USR_ID' => 0,
|
||||||
]);
|
]);
|
||||||
//Create a task self service value based
|
//Create a task self service value based
|
||||||
$task1 = factory(Task::class)->create([
|
$task1 = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Create the relation for the value assigned in the TAS_GROUP_VARIABLE
|
//Create the relation for the value assigned in the TAS_GROUP_VARIABLE
|
||||||
$appSelfValue = factory(AppAssignSelfServiceValue::class)->create([
|
$appSelfValue = AppAssignSelfServiceValue::factory()->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'TAS_ID' => $task1->TAS_ID
|
'TAS_ID' => $task1->TAS_ID
|
||||||
]);
|
]);
|
||||||
factory(AppAssignSelfServiceValueGroup::class)->create([
|
AppAssignSelfServiceValueGroup::factory()->create([
|
||||||
'ID' => $appSelfValue->ID,
|
'ID' => $appSelfValue->ID,
|
||||||
'GRP_UID' => $user->USR_UID,
|
'GRP_UID' => $user->USR_UID,
|
||||||
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
||||||
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
||||||
]);
|
]);
|
||||||
//Create the register in self service value based
|
//Create the register in self service value based
|
||||||
factory(Delegation::class, $total / 2)->create([
|
Delegation::factory($total / 2)->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
||||||
'TAS_ID' => $task->TAS_ID,
|
'TAS_ID' => $task->TAS_ID,
|
||||||
@@ -218,32 +219,32 @@ class DelegationTest extends TestCase
|
|||||||
//Define the maximum time of execution
|
//Define the maximum time of execution
|
||||||
$maximumTime = $this->maximumExecutionTime;
|
$maximumTime = $this->maximumExecutionTime;
|
||||||
//Create process
|
//Create process
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
//Create group
|
//Create group
|
||||||
$group = factory(Groupwf::class)->create();
|
$group = Groupwf::factory()->create();
|
||||||
//Create user
|
//Create user
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
//Assign a user in the group
|
//Assign a user in the group
|
||||||
factory(GroupUser::class)->create([
|
GroupUser::factory()->create([
|
||||||
'GRP_UID' => $group->GRP_UID,
|
'GRP_UID' => $group->GRP_UID,
|
||||||
'GRP_ID' => $group->GRP_ID,
|
'GRP_ID' => $group->GRP_ID,
|
||||||
'USR_UID' => $user->USR_UID
|
'USR_UID' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
//Create a task self service
|
//Create a task self service
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '',
|
'TAS_GROUP_VARIABLE' => '',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Assign a user in the task
|
//Assign a user in the task
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
'TU_RELATION' => 2, //Related to the group
|
'TU_RELATION' => 2, //Related to the group
|
||||||
'TU_TYPE' => 1
|
'TU_TYPE' => 1
|
||||||
]);
|
]);
|
||||||
//Create the register in self-service
|
//Create the register in self-service
|
||||||
factory(Delegation::class, $total)->create([
|
Delegation::factory($total)->create([
|
||||||
'TAS_ID' => $task->TAS_ID,
|
'TAS_ID' => $task->TAS_ID,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
'USR_ID' => 0,
|
'USR_ID' => 0,
|
||||||
@@ -271,44 +272,44 @@ class DelegationTest extends TestCase
|
|||||||
//Define the maximum time of execution
|
//Define the maximum time of execution
|
||||||
$maximumTime = $this->maximumExecutionTime;
|
$maximumTime = $this->maximumExecutionTime;
|
||||||
//Create process
|
//Create process
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
//Create a task self service value based
|
//Create a task self service value based
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Create a case
|
//Create a case
|
||||||
$application = factory(Application::class)->create();
|
$application = Application::factory()->create();
|
||||||
//Create group
|
//Create group
|
||||||
$group = factory(Groupwf::class)->create();
|
$group = Groupwf::factory()->create();
|
||||||
//Create user
|
//Create user
|
||||||
$user = factory(User::class)->create([
|
$user = User::factory()->create([
|
||||||
'USR_USERNAME' => 'gary',
|
'USR_USERNAME' => 'gary',
|
||||||
'USR_LASTNAME' => 'Gary',
|
'USR_LASTNAME' => 'Gary',
|
||||||
'USR_FIRSTNAME' => 'Bailey',
|
'USR_FIRSTNAME' => 'Bailey',
|
||||||
]);
|
]);
|
||||||
//Assign a user in the group
|
//Assign a user in the group
|
||||||
factory(GroupUser::class)->create([
|
GroupUser::factory()->create([
|
||||||
'GRP_UID' => $group->GRP_UID,
|
'GRP_UID' => $group->GRP_UID,
|
||||||
'GRP_ID' => $group->GRP_ID,
|
'GRP_ID' => $group->GRP_ID,
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
]);
|
]);
|
||||||
//Create the relation for the value assigned in the TAS_GROUP_VARIABLE
|
//Create the relation for the value assigned in the TAS_GROUP_VARIABLE
|
||||||
$appSelfValue = factory(AppAssignSelfServiceValue::class)->create([
|
$appSelfValue = AppAssignSelfServiceValue::factory()->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'TAS_ID' => $task->TAS_ID
|
'TAS_ID' => $task->TAS_ID
|
||||||
]);
|
]);
|
||||||
factory(AppAssignSelfServiceValueGroup::class)->create([
|
AppAssignSelfServiceValueGroup::factory()->create([
|
||||||
'ID' => $appSelfValue->ID,
|
'ID' => $appSelfValue->ID,
|
||||||
'GRP_UID' => $group->GRP_UID,
|
'GRP_UID' => $group->GRP_UID,
|
||||||
'ASSIGNEE_ID' => $group->GRP_ID, //The usrId or grpId
|
'ASSIGNEE_ID' => $group->GRP_ID, //The usrId or grpId
|
||||||
'ASSIGNEE_TYPE' => 2 //Related to the user=1 related to the group=2
|
'ASSIGNEE_TYPE' => 2 //Related to the user=1 related to the group=2
|
||||||
]);
|
]);
|
||||||
//Create the register in self-service
|
//Create the register in self-service
|
||||||
factory(Delegation::class, $total)->create([
|
Delegation::factory($total)->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'TAS_ID' => $task->TAS_ID,
|
'TAS_ID' => $task->TAS_ID,
|
||||||
@@ -337,89 +338,89 @@ class DelegationTest extends TestCase
|
|||||||
//Define the maximum time of execution
|
//Define the maximum time of execution
|
||||||
$maximumTime = $this->maximumExecutionTime;
|
$maximumTime = $this->maximumExecutionTime;
|
||||||
//Create process
|
//Create process
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
//Create group
|
//Create group
|
||||||
$group = factory(Groupwf::class)->create();
|
$group = Groupwf::factory()->create();
|
||||||
//Create user
|
//Create user
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
//Assign a user in the group
|
//Assign a user in the group
|
||||||
factory(GroupUser::class)->create([
|
GroupUser::factory()->create([
|
||||||
'GRP_UID' => $group->GRP_UID,
|
'GRP_UID' => $group->GRP_UID,
|
||||||
'GRP_ID' => $group->GRP_ID,
|
'GRP_ID' => $group->GRP_ID,
|
||||||
'USR_UID' => $user->USR_UID
|
'USR_UID' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
//Create a task self service
|
//Create a task self service
|
||||||
$task1 = factory(Task::class)->create([
|
$task1 = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '',
|
'TAS_GROUP_VARIABLE' => '',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Assign a user in the task1
|
//Assign a user in the task1
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task1->TAS_UID,
|
'TAS_UID' => $task1->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
'TU_RELATION' => 1, //Related to the user
|
'TU_RELATION' => 1, //Related to the user
|
||||||
'TU_TYPE' => 1
|
'TU_TYPE' => 1
|
||||||
]);
|
]);
|
||||||
//Create a task self service
|
//Create a task self service
|
||||||
$task2 = factory(Task::class)->create([
|
$task2 = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '',
|
'TAS_GROUP_VARIABLE' => '',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Assign a user in the task2
|
//Assign a user in the task2
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task2->TAS_UID,
|
'TAS_UID' => $task2->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
'TU_RELATION' => 1, //Related to the user
|
'TU_RELATION' => 1, //Related to the user
|
||||||
'TU_TYPE' => 1
|
'TU_TYPE' => 1
|
||||||
]);
|
]);
|
||||||
//Create a task self service
|
//Create a task self service
|
||||||
$task3 = factory(Task::class)->create([
|
$task3 = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '',
|
'TAS_GROUP_VARIABLE' => '',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Assign a user in the task
|
//Assign a user in the task
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task3->TAS_UID,
|
'TAS_UID' => $task3->TAS_UID,
|
||||||
'USR_UID' => $group->GRP_UID,
|
'USR_UID' => $group->GRP_UID,
|
||||||
'TU_RELATION' => 2, //Related to the group
|
'TU_RELATION' => 2, //Related to the group
|
||||||
'TU_TYPE' => 1
|
'TU_TYPE' => 1
|
||||||
]);
|
]);
|
||||||
//Create a task self service
|
//Create a task self service
|
||||||
$task4 = factory(Task::class)->create([
|
$task4 = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '',
|
'TAS_GROUP_VARIABLE' => '',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Assign a user in the task
|
//Assign a user in the task
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task4->TAS_UID,
|
'TAS_UID' => $task4->TAS_UID,
|
||||||
'USR_UID' => $group->GRP_UID,
|
'USR_UID' => $group->GRP_UID,
|
||||||
'TU_RELATION' => 2, //Related to the group
|
'TU_RELATION' => 2, //Related to the group
|
||||||
'TU_TYPE' => 1
|
'TU_TYPE' => 1
|
||||||
]);
|
]);
|
||||||
//Create the register in self-service related to the task1
|
//Create the register in self-service related to the task1
|
||||||
factory(Delegation::class, $total / 4)->create([
|
Delegation::factory($total / 4)->create([
|
||||||
'TAS_ID' => $task1->TAS_ID,
|
'TAS_ID' => $task1->TAS_ID,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
'USR_ID' => 0,
|
'USR_ID' => 0,
|
||||||
]);
|
]);
|
||||||
//Create the register in self-service related to the task2
|
//Create the register in self-service related to the task2
|
||||||
factory(Delegation::class, $total / 4)->create([
|
Delegation::factory($total / 4)->create([
|
||||||
'TAS_ID' => $task2->TAS_ID,
|
'TAS_ID' => $task2->TAS_ID,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
'USR_ID' => 0,
|
'USR_ID' => 0,
|
||||||
]);
|
]);
|
||||||
//Create the register in self-service related to the task3
|
//Create the register in self-service related to the task3
|
||||||
factory(Delegation::class, $total / 4)->create([
|
Delegation::factory($total / 4)->create([
|
||||||
'TAS_ID' => $task3->TAS_ID,
|
'TAS_ID' => $task3->TAS_ID,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
'USR_ID' => 0,
|
'USR_ID' => 0,
|
||||||
]);
|
]);
|
||||||
//Create the register in self-service related to the task4
|
//Create the register in self-service related to the task4
|
||||||
factory(Delegation::class, $total / 4)->create([
|
Delegation::factory($total / 4)->create([
|
||||||
'TAS_ID' => $task4->TAS_ID,
|
'TAS_ID' => $task4->TAS_ID,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN',
|
'DEL_THREAD_STATUS' => 'OPEN',
|
||||||
'USR_ID' => 0,
|
'USR_ID' => 0,
|
||||||
@@ -447,30 +448,30 @@ class DelegationTest extends TestCase
|
|||||||
//Define the maximum time of execution
|
//Define the maximum time of execution
|
||||||
$maximumTime = $this->maximumExecutionTime;
|
$maximumTime = $this->maximumExecutionTime;
|
||||||
//Create process
|
//Create process
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
//Create a case
|
//Create a case
|
||||||
$application = factory(Application::class)->create();
|
$application = Application::factory()->create();
|
||||||
//Create user
|
//Create user
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
//Create a task1 self service value based
|
//Create a task1 self service value based
|
||||||
$task1 = factory(Task::class)->create([
|
$task1 = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Create the relation for the value assigned in the TAS_GROUP_VARIABLE
|
//Create the relation for the value assigned in the TAS_GROUP_VARIABLE
|
||||||
$appSelfValue = factory(AppAssignSelfServiceValue::class)->create([
|
$appSelfValue = AppAssignSelfServiceValue::factory()->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'TAS_ID' => $task1->TAS_ID
|
'TAS_ID' => $task1->TAS_ID
|
||||||
]);
|
]);
|
||||||
factory(AppAssignSelfServiceValueGroup::class)->create([
|
AppAssignSelfServiceValueGroup::factory()->create([
|
||||||
'ID' => $appSelfValue->ID,
|
'ID' => $appSelfValue->ID,
|
||||||
'GRP_UID' => $user->USR_UID,
|
'GRP_UID' => $user->USR_UID,
|
||||||
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
||||||
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
||||||
]);
|
]);
|
||||||
//Create the register in self-service
|
//Create the register in self-service
|
||||||
factory(Delegation::class, $total / 2)->create([
|
Delegation::factory($total / 2)->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
||||||
'TAS_ID' => $task1->TAS_ID,
|
'TAS_ID' => $task1->TAS_ID,
|
||||||
@@ -478,24 +479,24 @@ class DelegationTest extends TestCase
|
|||||||
'USR_ID' => 0,
|
'USR_ID' => 0,
|
||||||
]);
|
]);
|
||||||
//Create a task2 self service value based
|
//Create a task2 self service value based
|
||||||
$task2 = factory(Task::class)->create([
|
$task2 = Task::factory()->create([
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||||
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
//Create the relation for the value assigned in the TAS_GROUP_VARIABLE
|
//Create the relation for the value assigned in the TAS_GROUP_VARIABLE
|
||||||
$appSelfValue = factory(AppAssignSelfServiceValue::class)->create([
|
$appSelfValue = AppAssignSelfServiceValue::factory()->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'TAS_ID' => $task2->TAS_ID
|
'TAS_ID' => $task2->TAS_ID
|
||||||
]);
|
]);
|
||||||
factory(AppAssignSelfServiceValueGroup::class)->create([
|
AppAssignSelfServiceValueGroup::factory()->create([
|
||||||
'ID' => $appSelfValue->ID,
|
'ID' => $appSelfValue->ID,
|
||||||
'GRP_UID' => $user->USR_UID,
|
'GRP_UID' => $user->USR_UID,
|
||||||
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
||||||
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
||||||
]);
|
]);
|
||||||
//Create the register in self-service
|
//Create the register in self-service
|
||||||
factory(Delegation::class, $total / 2)->create([
|
Delegation::factory($total / 2)->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
||||||
'TAS_ID' => $task2->TAS_ID,
|
'TAS_ID' => $task2->TAS_ID,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Tests;
|
namespace Tests;
|
||||||
|
|
||||||
|
use App\Factories\Factory;
|
||||||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Propel;
|
use Propel;
|
||||||
@@ -20,6 +21,12 @@ abstract class TestCase extends BaseTestCase
|
|||||||
*/
|
*/
|
||||||
protected $currentArgv;
|
protected $currentArgv;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The array of the initial tables to be dropped.
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $truncateInitialTables = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create application
|
* Create application
|
||||||
*/
|
*/
|
||||||
@@ -61,6 +68,7 @@ abstract class TestCase extends BaseTestCase
|
|||||||
* Lost config are restored.
|
* Lost config are restored.
|
||||||
*/
|
*/
|
||||||
app()->instance('config', $this->currentConfig);
|
app()->instance('config', $this->currentConfig);
|
||||||
|
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,4 +79,68 @@ abstract class TestCase extends BaseTestCase
|
|||||||
{
|
{
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* truncate non-initial Models.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function truncateNonInitialModels(): void
|
||||||
|
{
|
||||||
|
DB::statement("set global max_connections = 300;");
|
||||||
|
if (empty(static::$truncateInitialTables)) {
|
||||||
|
$initialTables = [
|
||||||
|
'RBAC_PERMISSIONS',
|
||||||
|
'RBAC_ROLES',
|
||||||
|
'RBAC_ROLES_PERMISSIONS',
|
||||||
|
'RBAC_SYSTEMS',
|
||||||
|
'RBAC_USERS',
|
||||||
|
'RBAC_USERS_ROLES',
|
||||||
|
'USERS',
|
||||||
|
'CONTENT',
|
||||||
|
'LANGUAGE',
|
||||||
|
'ISO_COUNTRY',
|
||||||
|
'ISO_SUBDIVISION',
|
||||||
|
'ISO_LOCATION',
|
||||||
|
'TRANSLATION',
|
||||||
|
'DASHLET',
|
||||||
|
'DASHLET_INSTANCE',
|
||||||
|
'CONFIGURATION',
|
||||||
|
'CATALOG',
|
||||||
|
'ADDONS_MANAGER',
|
||||||
|
'APP_SEQUENCE',
|
||||||
|
'OAUTH_CLIENTS',
|
||||||
|
'OAUTH_ACCESS_TOKENS'
|
||||||
|
];
|
||||||
|
$directory = Factory::$customDirectoryForModels;
|
||||||
|
if (file_exists($directory)) {
|
||||||
|
$files = scandir($directory);
|
||||||
|
$files = array_diff($files, ['.', '..']);
|
||||||
|
$tables = [];
|
||||||
|
foreach ($files as $filename) {
|
||||||
|
$filepath = $directory . $filename;
|
||||||
|
$ext = pathinfo($filepath, PATHINFO_EXTENSION);
|
||||||
|
if (strtolower($ext) !== 'php') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$modelName = pathinfo($filepath, PATHINFO_FILENAME);
|
||||||
|
$model = Factory::$customNameSpaceForModels . $modelName;
|
||||||
|
$tableName = (new $model())->getTable();
|
||||||
|
$tables[] = $tableName;
|
||||||
|
}
|
||||||
|
$result = array_diff($tables, $initialTables);
|
||||||
|
$result = array_values($result);
|
||||||
|
$truncates = [];
|
||||||
|
foreach ($result as $value) {
|
||||||
|
$truncates[] = 'TRUNCATE TABLE ' . $value;
|
||||||
|
}
|
||||||
|
static::$truncateInitialTables = implode(';', $truncates);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
DB::unprepared(
|
||||||
|
"SET FOREIGN_KEY_CHECKS = 0;" .
|
||||||
|
static::$truncateInitialTables .
|
||||||
|
";SET FOREIGN_KEY_CHECKS = 1;"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,6 +136,15 @@ if (env('RUN_MSSQL_TESTS')) {
|
|||||||
* This is for standard ProcessMaker tables
|
* This is for standard ProcessMaker tables
|
||||||
*/
|
*/
|
||||||
if (!env('POPULATE_DATABASE')) {
|
if (!env('POPULATE_DATABASE')) {
|
||||||
|
refreshDatabases();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refresh databases.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function refreshDatabases(): void
|
||||||
|
{
|
||||||
// Create a table for define the connection
|
// Create a table for define the connection
|
||||||
Schema::connection('testexternal')->dropIfExists('test');
|
Schema::connection('testexternal')->dropIfExists('test');
|
||||||
Schema::connection('testexternal')->create('test', function ($table) {
|
Schema::connection('testexternal')->create('test', function ($table) {
|
||||||
|
|||||||
@@ -68,6 +68,6 @@ class CustomizeFormatterTest extends TestCase
|
|||||||
$this->assertCount(1, $files);
|
$this->assertCount(1, $files);
|
||||||
|
|
||||||
$string = File::get($files[0]);
|
$string = File::get($files[0]);
|
||||||
$this->assertRegExp("/{$message}/", $string);
|
$this->assertMatchesRegularExpression("/{$message}/", $string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,16 @@ use Tests\TestCase;
|
|||||||
|
|
||||||
class DefaultAjaxTest extends TestCase
|
class DefaultAjaxTest extends TestCase
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Set up method.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function setUp(): void
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
|
parent::setUp();
|
||||||
$this->markTestSkipped('Issues with php 8');
|
$this->markTestSkipped('Issues with php 8');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This gets data from a json file.
|
* This gets data from a json file.
|
||||||
* @param string $pathData
|
* @param string $pathData
|
||||||
|
|||||||
@@ -34,35 +34,35 @@ class BootstrapTest extends TestCase
|
|||||||
$result = Bootstrap::streamCSSBigFile($filename);
|
$result = Bootstrap::streamCSSBigFile($filename);
|
||||||
|
|
||||||
//add more assertions
|
//add more assertions
|
||||||
$this->assertRegexp("/{$filename}/", $result);
|
$this->assertMatchesRegularExpression("/{$filename}/", $result);
|
||||||
$this->assertRegexp("/font-face/", $result);
|
$this->assertMatchesRegularExpression("/font-face/", $result);
|
||||||
$this->assertRegexp("/font-family/", $result);
|
$this->assertMatchesRegularExpression("/font-family/", $result);
|
||||||
|
|
||||||
$filename = "jscolors";
|
$filename = "jscolors";
|
||||||
$result = Bootstrap::streamCSSBigFile($filename);
|
$result = Bootstrap::streamCSSBigFile($filename);
|
||||||
|
|
||||||
//add more assertions
|
//add more assertions
|
||||||
$this->assertRegexp("/{$filename}/", $result);
|
$this->assertMatchesRegularExpression("/{$filename}/", $result);
|
||||||
|
|
||||||
$filename = "xmlcolors";
|
$filename = "xmlcolors";
|
||||||
$result = Bootstrap::streamCSSBigFile($filename);
|
$result = Bootstrap::streamCSSBigFile($filename);
|
||||||
|
|
||||||
//add more assertions
|
//add more assertions
|
||||||
$this->assertRegexp("/{$filename}/", $result);
|
$this->assertMatchesRegularExpression("/{$filename}/", $result);
|
||||||
|
|
||||||
$filename = "classic";
|
$filename = "classic";
|
||||||
$result = Bootstrap::streamCSSBigFile($filename);
|
$result = Bootstrap::streamCSSBigFile($filename);
|
||||||
|
|
||||||
//add more assertions
|
//add more assertions
|
||||||
$this->assertRegexp("/{$filename}/", $result);
|
$this->assertMatchesRegularExpression("/{$filename}/", $result);
|
||||||
$this->assertRegexp("/font-family/", $result);
|
$this->assertMatchesRegularExpression("/font-family/", $result);
|
||||||
$this->assertRegexp("/ss_group_suit/", $result);
|
$this->assertMatchesRegularExpression("/ss_group_suit/", $result);
|
||||||
|
|
||||||
$filename = "classic-extjs";
|
$filename = "classic-extjs";
|
||||||
$result = Bootstrap::streamCSSBigFile($filename);
|
$result = Bootstrap::streamCSSBigFile($filename);
|
||||||
|
|
||||||
//add more assertions
|
//add more assertions
|
||||||
$this->assertRegexp("/{$filename}/", $result);
|
$this->assertMatchesRegularExpression("/{$filename}/", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,7 +101,7 @@ class BootstrapTest extends TestCase
|
|||||||
foreach ($files as $value) {
|
foreach ($files as $value) {
|
||||||
$result = $result . File::get($value->getPathname());
|
$result = $result . File::get($value->getPathname());
|
||||||
}
|
}
|
||||||
$this->assertRegExp("/{$channel}/", $result);
|
$this->assertMatchesRegularExpression("/{$channel}/", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -136,6 +136,6 @@ class BootstrapTest extends TestCase
|
|||||||
foreach ($files as $value) {
|
foreach ($files as $value) {
|
||||||
$result = $result . File::get($value->getPathname());
|
$result = $result . File::get($value->getPathname());
|
||||||
}
|
}
|
||||||
$this->assertRegExp("/{$channel}/", $result);
|
$this->assertMatchesRegularExpression("/{$channel}/", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ class CodeScannerTest extends TestCase
|
|||||||
$result = $codeScanner->checkDisabledCode('PATH', $this->pathPlugin);
|
$result = $codeScanner->checkDisabledCode('PATH', $this->pathPlugin);
|
||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
} else {
|
} else {
|
||||||
$this->markTestIncomplete(
|
$this->markTestSkipped(
|
||||||
'Please check the configurations to the Code Security Scanner'
|
'Please check the configurations to the Code Security Scanner'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class ReplaceDataFieldTest extends TestCase
|
|||||||
$stringToCheck = G::replaceDataField($string, $result, $dbEngine, $recursive);
|
$stringToCheck = G::replaceDataField($string, $result, $dbEngine, $recursive);
|
||||||
|
|
||||||
// Assert the @qq is not being set as an empty value
|
// Assert the @qq is not being set as an empty value
|
||||||
$this->assertRegExp("/asa@qq.fds/", $stringToCheck);
|
$this->assertMatchesRegularExpression("/asa@qq.fds/", $stringToCheck);
|
||||||
|
|
||||||
// Testing with a "@qstring" value
|
// Testing with a "@qstring" value
|
||||||
$result = [
|
$result = [
|
||||||
@@ -48,7 +48,7 @@ class ReplaceDataFieldTest extends TestCase
|
|||||||
$stringToCheck = G::replaceDataField($string, $result, $dbEngine, $recursive);
|
$stringToCheck = G::replaceDataField($string, $result, $dbEngine, $recursive);
|
||||||
|
|
||||||
// Assert the @qstring is not being set as an empty value
|
// Assert the @qstring is not being set as an empty value
|
||||||
$this->assertRegExp("/@qstring/", $stringToCheck);
|
$this->assertMatchesRegularExpression("/@qstring/", $stringToCheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -80,7 +80,7 @@ class ReplaceDataFieldTest extends TestCase
|
|||||||
$stringToCheck = G::replaceDataField($string, $result, $dbEngine, $recursive);
|
$stringToCheck = G::replaceDataField($string, $result, $dbEngine, $recursive);
|
||||||
|
|
||||||
// Assert the @qq is not being set as an empty value
|
// Assert the @qq is not being set as an empty value
|
||||||
$this->assertRegExp("/asa@qq.fds/", $stringToCheck);
|
$this->assertMatchesRegularExpression("/asa@qq.fds/", $stringToCheck);
|
||||||
|
|
||||||
// Testing with a "@qstring" value
|
// Testing with a "@qstring" value
|
||||||
$result = [
|
$result = [
|
||||||
@@ -95,7 +95,7 @@ class ReplaceDataFieldTest extends TestCase
|
|||||||
$stringToCheck = G::replaceDataField($string, $result, $dbEngine, $recursive);
|
$stringToCheck = G::replaceDataField($string, $result, $dbEngine, $recursive);
|
||||||
|
|
||||||
// Assert the @qstring is not being set as an empty value
|
// Assert the @qstring is not being set as an empty value
|
||||||
$this->assertRegExp("/@qstring/", $stringToCheck);
|
$this->assertMatchesRegularExpression("/@qstring/", $stringToCheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -119,7 +119,7 @@ class ReplaceDataFieldTest extends TestCase
|
|||||||
$stringToCheck = G::replaceDataField($string, $variables, $dbEngine, $recursive);
|
$stringToCheck = G::replaceDataField($string, $variables, $dbEngine, $recursive);
|
||||||
|
|
||||||
// The variable @#DOC_UID inside in the variable "@#upload_New" shouldn't be replaced
|
// The variable @#DOC_UID inside in the variable "@#upload_New" shouldn't be replaced
|
||||||
$this->assertRegExp("/@#DOC_UID/", $stringToCheck);
|
$this->assertMatchesRegularExpression("/@#DOC_UID/", $stringToCheck);
|
||||||
|
|
||||||
// Set parameters to test the method
|
// Set parameters to test the method
|
||||||
$dbEngine = 'mysql';
|
$dbEngine = 'mysql';
|
||||||
@@ -129,7 +129,7 @@ class ReplaceDataFieldTest extends TestCase
|
|||||||
$stringToCheck = G::replaceDataField($string, $variables, $dbEngine, $recursive);
|
$stringToCheck = G::replaceDataField($string, $variables, $dbEngine, $recursive);
|
||||||
|
|
||||||
// The variable @#DOC_UID inside in the variable "@#upload_New" should be replaced correctly
|
// The variable @#DOC_UID inside in the variable "@#upload_New" should be replaced correctly
|
||||||
$this->assertRegExp("/1988828025cc89aba0cd2b8079038028/", $stringToCheck);
|
$this->assertMatchesRegularExpression("/1988828025cc89aba0cd2b8079038028/", $stringToCheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -153,7 +153,7 @@ class ReplaceDataFieldTest extends TestCase
|
|||||||
$stringToCheck = G::replaceDataField($string, $variables, $dbEngine, $recursive);
|
$stringToCheck = G::replaceDataField($string, $variables, $dbEngine, $recursive);
|
||||||
|
|
||||||
// The variable @=DOC_UID inside in the variable "@=upload_New" shouldn't be replaced
|
// The variable @=DOC_UID inside in the variable "@=upload_New" shouldn't be replaced
|
||||||
$this->assertRegExp("/@=DOC_UID/", $stringToCheck);
|
$this->assertMatchesRegularExpression("/@=DOC_UID/", $stringToCheck);
|
||||||
|
|
||||||
// Set parameters to test the method
|
// Set parameters to test the method
|
||||||
$dbEngine = 'mysql';
|
$dbEngine = 'mysql';
|
||||||
@@ -163,6 +163,6 @@ class ReplaceDataFieldTest extends TestCase
|
|||||||
$stringToCheck = G::replaceDataField($string, $variables, $dbEngine, $recursive);
|
$stringToCheck = G::replaceDataField($string, $variables, $dbEngine, $recursive);
|
||||||
|
|
||||||
// The variable @=DOC_UID inside in the variable "@=upload_New" should be replaced correctly
|
// The variable @=DOC_UID inside in the variable "@=upload_New" should be replaced correctly
|
||||||
$this->assertRegExp("/1988828025cc89aba0cd2b8079038028/", $stringToCheck);
|
$this->assertMatchesRegularExpression("/1988828025cc89aba0cd2b8079038028/", $stringToCheck);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ class RolesTest extends TestCase
|
|||||||
$rolesInstance = new Roles();
|
$rolesInstance = new Roles();
|
||||||
|
|
||||||
// Create elements
|
// Create elements
|
||||||
$role = factory(RbacRoles::class)->create();
|
$role = RbacRoles::factory()->create();
|
||||||
$deletedUser = factory(RbacUsers::class)->states('deleted')->create();
|
$deletedUser = RbacUsers::factory()->deleted()->create();
|
||||||
$activeUser = factory(RbacUsers::class)->states('active')->create();
|
$activeUser = RbacUsers::factory()->active()->create();
|
||||||
$inactiveUser = factory(RbacUsers::class)->states('inactive')->create();
|
$inactiveUser = RbacUsers::factory()->inactive()->create();
|
||||||
|
|
||||||
// Assign the role to a deleted user
|
// Assign the role to a deleted user
|
||||||
factory(RbacUsersRoles::class)->create([
|
RbacUsersRoles::factory()->create([
|
||||||
'ROL_UID' => $role->ROL_UID,
|
'ROL_UID' => $role->ROL_UID,
|
||||||
'USR_UID' => $deletedUser->USR_UID
|
'USR_UID' => $deletedUser->USR_UID
|
||||||
]);
|
]);
|
||||||
@@ -37,7 +37,7 @@ class RolesTest extends TestCase
|
|||||||
$this->assertEquals(0, $rolesInstance->numUsersWithRole($role->ROL_UID));
|
$this->assertEquals(0, $rolesInstance->numUsersWithRole($role->ROL_UID));
|
||||||
|
|
||||||
// Assign the role to an active user
|
// Assign the role to an active user
|
||||||
factory(RbacUsersRoles::class)->create([
|
RbacUsersRoles::factory()->create([
|
||||||
'ROL_UID' => $role->ROL_UID,
|
'ROL_UID' => $role->ROL_UID,
|
||||||
'USR_UID' => $activeUser->USR_UID
|
'USR_UID' => $activeUser->USR_UID
|
||||||
]);
|
]);
|
||||||
@@ -45,7 +45,7 @@ class RolesTest extends TestCase
|
|||||||
$this->assertEquals(1, $rolesInstance->numUsersWithRole($role->ROL_UID));
|
$this->assertEquals(1, $rolesInstance->numUsersWithRole($role->ROL_UID));
|
||||||
|
|
||||||
// Assign the role to an inactive user
|
// Assign the role to an inactive user
|
||||||
factory(RbacUsersRoles::class)->create([
|
RbacUsersRoles::factory()->create([
|
||||||
'ROL_UID' => $role->ROL_UID,
|
'ROL_UID' => $role->ROL_UID,
|
||||||
'USR_UID' => $inactiveUser->USR_UID
|
'USR_UID' => $inactiveUser->USR_UID
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -7,11 +7,13 @@ use ProcessMaker\Model\Dynaform;
|
|||||||
use ProcessMaker\Model\Process;
|
use ProcessMaker\Model\Process;
|
||||||
use ProcessMaker\Model\ProcessVariables;
|
use ProcessMaker\Model\ProcessVariables;
|
||||||
use ProcessMaker\Model\Triggers;
|
use ProcessMaker\Model\Triggers;
|
||||||
|
use Tests\CreateTestSite;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class CliWorkspacesTest extends TestCase
|
class CliWorkspacesTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseTransactions;
|
use DatabaseTransactions;
|
||||||
|
use CreateTestSite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that the deprecated files are removed successfully
|
* Test that the deprecated files are removed successfully
|
||||||
@@ -21,6 +23,7 @@ class CliWorkspacesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_delete_the_deprecated_files()
|
public function it_should_delete_the_deprecated_files()
|
||||||
{
|
{
|
||||||
|
ob_start();
|
||||||
include(PATH_TRUNK . 'workflow/engine/bin/tasks/cliWorkspaces.php');
|
include(PATH_TRUNK . 'workflow/engine/bin/tasks/cliWorkspaces.php');
|
||||||
if (!file_exists(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php')) {
|
if (!file_exists(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php')) {
|
||||||
$filename = PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php';
|
$filename = PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php';
|
||||||
@@ -79,6 +82,7 @@ class CliWorkspacesTest extends TestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ob_get_clean();
|
||||||
// This assert the data_usersList.php does not exist anymore
|
// This assert the data_usersList.php does not exist anymore
|
||||||
$this->assertFalse(file_exists(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php'));
|
$this->assertFalse(file_exists(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php'));
|
||||||
}
|
}
|
||||||
@@ -150,33 +154,34 @@ class CliWorkspacesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_the_incompatibilities_in_the_dynaforms_queries()
|
public function it_should_test_the_incompatibilities_in_the_dynaforms_queries()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete();//This can't be tested due to the db.php invocation
|
|
||||||
config(["system.workspace" => 'workflow']);
|
config(["system.workspace" => 'workflow']);
|
||||||
|
$workspace = config("system.workspace");
|
||||||
|
$this->createDBFile($workspace);
|
||||||
|
|
||||||
$process = factory(Process::class, 2)->create();
|
$process = Process::factory(2)->create();
|
||||||
|
|
||||||
factory(Dynaform::class)->create(
|
Dynaform::factory()->create(
|
||||||
[
|
[
|
||||||
'PRO_UID' => $process[0]['PRO_UID'],
|
'PRO_UID' => $process[0]['PRO_UID'],
|
||||||
'DYN_CONTENT' => '{"name":"2","description":"","items":[{"type":"form","variable":"","var_uid":"","dataType":"","id":"6170264265d1b544bebdbd5098250194","name":"2","description":"","mode":"edit","script":"","language":"en","externalLibs":"","printable":false,"items":[[{"type":"title","id":"title0000000001","label":"title_1","colSpan":12}],[{"type":"text","variable":"textVar002","var_uid":"9778460595d1b545088dd69091601043","dataType":"string","protectedValue":false,"id":"textVar002","name":"textVar002","label":"text_1","defaultValue":"","placeholder":"","hint":"","required":false,"requiredFieldErrorMessage":"","textTransform":"none","validate":"","validateMessage":"","maxLength":1000,"formula":"","mode":"parent","operation":"","dbConnection":"workflow","dbConnectionLabel":"PM Database","sql":"","var_name":"textVar002","colSpan":12}],[{"type":"textarea","variable":"textareaVar001","var_uid":"2934510045d1b5453f21373072798412","dataType":"string","protectedValue":false,"id":"textareaVar001","name":"textareaVar001","label":"textarea_1","defaultValue":"","placeholder":"","hint":"","required":false,"requiredFieldErrorMessage":"","validate":"","validateMessage":"","mode":"parent","dbConnection":"workflow","dbConnectionLabel":"PM Database","sql":"","rows":"5","var_name":"textareaVar001","colSpan":12}],[{"type":"datetime","variable":"datetimeVar001","var_uid":"9780823375d1b5455e9c3a2064729484","dataType":"datetime","protectedValue":false,"id":"datetimeVar001","name":"datetimeVar001","label":"datetime_1","placeholder":"","hint":"","required":false,"requiredFieldErrorMessage":"","mode":"parent","format":"YYYY-MM-DD","dayViewHeaderFormat":"MMMM YYYY","extraFormats":false,"stepping":1,"minDate":"","maxDate":"","useCurrent":"false","collapse":true,"locale":"","defaultDate":"","disabledDates":false,"enabledDates":false,"icons":{"time":"glyphicon glyphicon-time","date":"glyphicon glyphicon-calendar","up":"glyphicon glyphicon-chevron-up","down":"glyphicon glyphicon-chevron-down","previous":"glyphicon glyphicon-chevron-left","next":"glyphicon glyphicon-chevron-right","today":"glyphicon glyphicon-screenshot","clear":"glyphicon glyphicon-trash"},"useStrict":false,"sideBySide":false,"daysOfWeekDisabled":false,"calendarWeeks":false,"viewMode":"days","toolbarPlacement":"default","showTodayButton":false,"showClear":"false","widgetPositioning":{"horizontal":"auto","vertical":"auto"},"widgetParent":null,"keepOpen":false,"var_name":"datetimeVar001","colSpan":12}],[{"type":"submit","id":"submit0000000001","name":"submit0000000001","label":"submit_1","colSpan":12}]],"variables":[{"var_uid":"9778460595d1b545088dd69091601043","prj_uid":"5139642915ccb3fca429a36061714972","var_name":"textVar002","var_field_type":"string","var_field_size":10,"var_label":"string","var_dbconnection":"workflow","var_dbconnection_label":"PM Database","var_sql":"","var_null":0,"var_default":"","var_accepted_values":"[]","inp_doc_uid":""},{"var_uid":"2934510045d1b5453f21373072798412","prj_uid":"5139642915ccb3fca429a36061714972","var_name":"textareaVar001","var_field_type":"string","var_field_size":10,"var_label":"string","var_dbconnection":"workflow","var_dbconnection_label":"PM Database","var_sql":"","var_null":0,"var_default":"","var_accepted_values":"[]","inp_doc_uid":""},{"var_uid":"9780823375d1b5455e9c3a2064729484","prj_uid":"5139642915ccb3fca429a36061714972","var_name":"datetimeVar001","var_field_type":"datetime","var_field_size":10,"var_label":"datetime","var_dbconnection":"workflow","var_dbconnection_label":"PM Database","var_sql":"","var_null":0,"var_default":"","var_accepted_values":"[]","inp_doc_uid":""}]}]}'
|
'DYN_CONTENT' => '{"name":"2","description":"","items":[{"type":"form","variable":"","var_uid":"","dataType":"","id":"6170264265d1b544bebdbd5098250194","name":"2","description":"","mode":"edit","script":"","language":"en","externalLibs":"","printable":false,"items":[[{"type":"title","id":"title0000000001","label":"title_1","colSpan":12}],[{"type":"text","variable":"textVar002","var_uid":"9778460595d1b545088dd69091601043","dataType":"string","protectedValue":false,"id":"textVar002","name":"textVar002","label":"text_1","defaultValue":"","placeholder":"","hint":"","required":false,"requiredFieldErrorMessage":"","textTransform":"none","validate":"","validateMessage":"","maxLength":1000,"formula":"","mode":"parent","operation":"","dbConnection":"workflow","dbConnectionLabel":"PM Database","sql":"","var_name":"textVar002","colSpan":12}],[{"type":"textarea","variable":"textareaVar001","var_uid":"2934510045d1b5453f21373072798412","dataType":"string","protectedValue":false,"id":"textareaVar001","name":"textareaVar001","label":"textarea_1","defaultValue":"","placeholder":"","hint":"","required":false,"requiredFieldErrorMessage":"","validate":"","validateMessage":"","mode":"parent","dbConnection":"workflow","dbConnectionLabel":"PM Database","sql":"","rows":"5","var_name":"textareaVar001","colSpan":12}],[{"type":"datetime","variable":"datetimeVar001","var_uid":"9780823375d1b5455e9c3a2064729484","dataType":"datetime","protectedValue":false,"id":"datetimeVar001","name":"datetimeVar001","label":"datetime_1","placeholder":"","hint":"","required":false,"requiredFieldErrorMessage":"","mode":"parent","format":"YYYY-MM-DD","dayViewHeaderFormat":"MMMM YYYY","extraFormats":false,"stepping":1,"minDate":"","maxDate":"","useCurrent":"false","collapse":true,"locale":"","defaultDate":"","disabledDates":false,"enabledDates":false,"icons":{"time":"glyphicon glyphicon-time","date":"glyphicon glyphicon-calendar","up":"glyphicon glyphicon-chevron-up","down":"glyphicon glyphicon-chevron-down","previous":"glyphicon glyphicon-chevron-left","next":"glyphicon glyphicon-chevron-right","today":"glyphicon glyphicon-screenshot","clear":"glyphicon glyphicon-trash"},"useStrict":false,"sideBySide":false,"daysOfWeekDisabled":false,"calendarWeeks":false,"viewMode":"days","toolbarPlacement":"default","showTodayButton":false,"showClear":"false","widgetPositioning":{"horizontal":"auto","vertical":"auto"},"widgetParent":null,"keepOpen":false,"var_name":"datetimeVar001","colSpan":12}],[{"type":"submit","id":"submit0000000001","name":"submit0000000001","label":"submit_1","colSpan":12}]],"variables":[{"var_uid":"9778460595d1b545088dd69091601043","prj_uid":"5139642915ccb3fca429a36061714972","var_name":"textVar002","var_field_type":"string","var_field_size":10,"var_label":"string","var_dbconnection":"workflow","var_dbconnection_label":"PM Database","var_sql":"","var_null":0,"var_default":"","var_accepted_values":"[]","inp_doc_uid":""},{"var_uid":"2934510045d1b5453f21373072798412","prj_uid":"5139642915ccb3fca429a36061714972","var_name":"textareaVar001","var_field_type":"string","var_field_size":10,"var_label":"string","var_dbconnection":"workflow","var_dbconnection_label":"PM Database","var_sql":"","var_null":0,"var_default":"","var_accepted_values":"[]","inp_doc_uid":""},{"var_uid":"9780823375d1b5455e9c3a2064729484","prj_uid":"5139642915ccb3fca429a36061714972","var_name":"datetimeVar001","var_field_type":"datetime","var_field_size":10,"var_label":"datetime","var_dbconnection":"workflow","var_dbconnection_label":"PM Database","var_sql":"","var_null":0,"var_default":"","var_accepted_values":"[]","inp_doc_uid":""}]}]}'
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class)->create(
|
$dynaform = Dynaform::factory()->create(
|
||||||
[
|
[
|
||||||
'PRO_UID' => $process[1]['PRO_UID'],
|
'PRO_UID' => $process[1]['PRO_UID'],
|
||||||
'DYN_CONTENT' => '{"name":"1","description":"","items":[{"type":"form","variable":"","var_uid":"","dataType":"","id":"6817532755d16225629cb05061521548","name":"1","description":"","mode":"edit","script":"","language":"en","externalLibs":"","printable":false,"items":[[{"type":"text","variable":"textVar001","var_uid":"4746221155d1622658943d1014840579","dataType":"string","protectedValue":false,"id":"textVar001","name":"textVar001","label":"text_1","defaultValue":"","placeholder":"","hint":"","required":false,"requiredFieldErrorMessage":"","textTransform":"none","validate":"","validateMessage":"","maxLength":1000,"formula":"","mode":"parent","operation":"","dbConnection":"workflow","dbConnectionLabel":"PM Database","sql":"SELECT * FROM USERS WHERE \nUSR_UID=\'$UID\' UNION SELECT * from PROCESS","var_name":"textVar001","colSpan":12}]],"variables":[{"var_uid":"4746221155d1622658943d1014840579","prj_uid":"5139642915ccb3fca429a36061714972","var_name":"textVar001","var_field_type":"string","var_field_size":10,"var_label":"string","var_dbconnection":"workflow","var_dbconnection_label":"PM Database","var_sql":"","var_null":0,"var_default":"","var_accepted_values":"[]","inp_doc_uid":""}]}]}'
|
'DYN_CONTENT' => '{"name":"1","description":"","items":[{"type":"form","variable":"","var_uid":"","dataType":"","id":"6817532755d16225629cb05061521548","name":"1","description":"","mode":"edit","script":"","language":"en","externalLibs":"","printable":false,"items":[[{"type":"text","variable":"textVar001","var_uid":"4746221155d1622658943d1014840579","dataType":"string","protectedValue":false,"id":"textVar001","name":"textVar001","label":"text_1","defaultValue":"","placeholder":"","hint":"","required":false,"requiredFieldErrorMessage":"","textTransform":"none","validate":"","validateMessage":"","maxLength":1000,"formula":"","mode":"parent","operation":"","dbConnection":"workflow","dbConnectionLabel":"PM Database","sql":"SELECT * FROM USERS WHERE \nUSR_UID=\'$UID\' UNION SELECT * from PROCESS","var_name":"textVar001","colSpan":12}]],"variables":[{"var_uid":"4746221155d1622658943d1014840579","prj_uid":"5139642915ccb3fca429a36061714972","var_name":"textVar001","var_field_type":"string","var_field_size":10,"var_label":"string","var_dbconnection":"workflow","var_dbconnection_label":"PM Database","var_sql":"","var_null":0,"var_default":"","var_accepted_values":"[]","inp_doc_uid":""}]}]}'
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$variables = factory(ProcessVariables::class)->create(
|
$variables = ProcessVariables::factory()->create(
|
||||||
[
|
[
|
||||||
'PRJ_UID' => $process[0]['PRO_UID'],
|
'PRJ_UID' => $process[0]['PRO_UID'],
|
||||||
'VAR_SQL' => 'SELECT * FROM USERS WHERE USR_UID="213" UNION SELECT * from PROCESS'
|
'VAR_SQL' => 'SELECT * FROM USERS WHERE USR_UID="213" UNION SELECT * from PROCESS'
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$trigger = factory(Triggers::class)->create(
|
$trigger = Triggers::factory()->create(
|
||||||
[
|
[
|
||||||
'PRO_UID' => $process[0]['PRO_UID'],
|
'PRO_UID' => $process[0]['PRO_UID'],
|
||||||
'TRI_WEBBOT' => '$text=222;
|
'TRI_WEBBOT' => '$text=222;
|
||||||
@@ -203,26 +208,28 @@ class CliWorkspacesTest extends TestCase
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ob_start();
|
||||||
check_queries_incompatibilities('workflow');
|
check_queries_incompatibilities('workflow');
|
||||||
|
|
||||||
$result = ob_get_contents();
|
$result = ob_get_contents();
|
||||||
|
ob_get_clean();
|
||||||
|
|
||||||
// This assert that the message contains the second process name
|
// This assert that the message contains the second process name
|
||||||
$this->assertRegExp('/'.$process[1]['PRO_TITLE'].'/',$result);
|
$this->assertMatchesRegularExpression('/'.$process[1]['PRO_TITLE'].'/',$result);
|
||||||
|
|
||||||
// This assert that the message contains the second dynaform with the UNION query
|
// This assert that the message contains the second dynaform with the UNION query
|
||||||
$this->assertRegExp('/'.$dynaform['DYN_TITLE'].'/',$result);
|
$this->assertMatchesRegularExpression('/'.$dynaform['DYN_TITLE'].'/',$result);
|
||||||
|
|
||||||
// This assert that the message contains the first process name
|
// This assert that the message contains the first process name
|
||||||
$this->assertRegExp('/'.$process[0]['PRO_TITLE'].'/',$result);
|
$this->assertMatchesRegularExpression('/'.$process[0]['PRO_TITLE'].'/',$result);
|
||||||
|
|
||||||
// This assert that the message contains the first dynaform with the UNION query
|
// This assert that the message contains the first dynaform with the UNION query
|
||||||
$this->assertRegExp('/'.$variables['VAR_TITLE'].'/',$result);
|
$this->assertMatchesRegularExpression('/'.$variables['VAR_TITLE'].'/',$result);
|
||||||
|
|
||||||
// This assert that the message contains the first process name
|
// This assert that the message contains the first process name
|
||||||
$this->assertRegExp('/'.$process[0]['PRO_TITLE'].'/',$result);
|
$this->assertMatchesRegularExpression('/'.$process[0]['PRO_TITLE'].'/',$result);
|
||||||
|
|
||||||
// This assert that the message contains the first trigger with the UNION query
|
// This assert that the message contains the first trigger with the UNION query
|
||||||
$this->assertRegExp('/'.$trigger['TRI_TITLE'].'/',$result);
|
$this->assertMatchesRegularExpression('/'.$trigger['TRI_TITLE'].'/',$result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,14 +52,14 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||||
->get()
|
->get()
|
||||||
->first();
|
->first();
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -91,17 +91,17 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||||
->get()
|
->get()
|
||||||
->first();
|
->first();
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$abeConfiguration = [
|
$abeConfiguration = [
|
||||||
'ABE_EMAIL_SERVER_UID' => ''
|
'ABE_EMAIL_SERVER_UID' => ''
|
||||||
];
|
];
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -133,15 +133,15 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||||
->get()
|
->get()
|
||||||
->first();
|
->first();
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => '',
|
'TAS_UID' => '',
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
@@ -151,10 +151,10 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
$abeConfiguration = $abeConfiguration->toArray();
|
$abeConfiguration = $abeConfiguration->toArray();
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -186,19 +186,19 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_sendActionsByEmail_method_with_exception_if_email_to_is_empty()
|
public function it_should_test_sendActionsByEmail_method_with_exception_if_email_to_is_empty()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create([
|
$user = User::factory()->create([
|
||||||
'USR_EMAIL' => ''
|
'USR_EMAIL' => ''
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
@@ -209,10 +209,10 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
$abeConfiguration = $abeConfiguration->toArray();
|
$abeConfiguration = $abeConfiguration->toArray();
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -245,17 +245,17 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_sendActionsByEmail_method_with_exception_if_email_type_is_empty()
|
public function it_should_test_sendActionsByEmail_method_with_exception_if_email_type_is_empty()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
|
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
@@ -266,10 +266,10 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
$abeConfiguration = $abeConfiguration->toArray();
|
$abeConfiguration = $abeConfiguration->toArray();
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -304,15 +304,15 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||||
->get()
|
->get()
|
||||||
->first();
|
->first();
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
@@ -322,11 +322,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
$abeConfiguration = $abeConfiguration->toArray();
|
$abeConfiguration = $abeConfiguration->toArray();
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -363,15 +363,15 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||||
->get()
|
->get()
|
||||||
->first();
|
->first();
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
@@ -382,11 +382,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
$abeConfiguration = $abeConfiguration->toArray();
|
$abeConfiguration = $abeConfiguration->toArray();
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -423,15 +423,15 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||||
->get()
|
->get()
|
||||||
->first();
|
->first();
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
@@ -442,11 +442,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
$abeConfiguration = $abeConfiguration->toArray();
|
$abeConfiguration = $abeConfiguration->toArray();
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -483,16 +483,16 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||||
->get()
|
->get()
|
||||||
->first();
|
->first();
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform2.json")
|
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform2.json")
|
||||||
]);
|
]);
|
||||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
@@ -503,11 +503,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
$abeConfiguration = $abeConfiguration->toArray();
|
$abeConfiguration = $abeConfiguration->toArray();
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -544,16 +544,16 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||||
->get()
|
->get()
|
||||||
->first();
|
->first();
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
||||||
]);
|
]);
|
||||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
@@ -565,11 +565,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
$abeConfiguration = $abeConfiguration->toArray();
|
$abeConfiguration = $abeConfiguration->toArray();
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -598,11 +598,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
|
|
||||||
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
||||||
|
|
||||||
$this->assertContains('jsondata', $result);
|
$this->assertStringContainsString('jsondata', $result);
|
||||||
$this->assertContains('httpServerHostname', $result);
|
$this->assertStringContainsString('httpServerHostname', $result);
|
||||||
$this->assertContains('pm_run_outside_main_app', $result);
|
$this->assertStringContainsString('pm_run_outside_main_app', $result);
|
||||||
$this->assertContains('pathRTLCss', $result);
|
$this->assertStringContainsString('pathRTLCss', $result);
|
||||||
$this->assertContains('fieldsRequired', $result);
|
$this->assertStringContainsString('fieldsRequired', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -615,16 +615,16 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||||
->get()
|
->get()
|
||||||
->first();
|
->first();
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
||||||
]);
|
]);
|
||||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
@@ -636,11 +636,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
$abeConfiguration = $abeConfiguration->toArray();
|
$abeConfiguration = $abeConfiguration->toArray();
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -669,11 +669,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
|
|
||||||
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
||||||
|
|
||||||
$this->assertContains('jsondata', $result);
|
$this->assertStringContainsString('jsondata', $result);
|
||||||
$this->assertContains('httpServerHostname', $result);
|
$this->assertStringContainsString('httpServerHostname', $result);
|
||||||
$this->assertContains('pm_run_outside_main_app', $result);
|
$this->assertStringContainsString('pm_run_outside_main_app', $result);
|
||||||
$this->assertContains('pathRTLCss', $result);
|
$this->assertStringContainsString('pathRTLCss', $result);
|
||||||
$this->assertContains('fieldsRequired', $result);
|
$this->assertStringContainsString('fieldsRequired', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -687,16 +687,16 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||||
->get()
|
->get()
|
||||||
->first();
|
->first();
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
||||||
]);
|
]);
|
||||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'DYN_UID' => $dynaform->DYN_UID,
|
'DYN_UID' => $dynaform->DYN_UID,
|
||||||
@@ -708,11 +708,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
$abeConfiguration = $abeConfiguration->toArray();
|
$abeConfiguration = $abeConfiguration->toArray();
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$delegation = factory(Delegation::class)->create([
|
$delegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
@@ -741,10 +741,10 @@ class ActionsByEmailCoreClassTest extends TestCase
|
|||||||
|
|
||||||
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
||||||
|
|
||||||
$this->assertContains('jsondata', $result);
|
$this->assertStringContainsString('jsondata', $result);
|
||||||
$this->assertContains('httpServerHostname', $result);
|
$this->assertStringContainsString('httpServerHostname', $result);
|
||||||
$this->assertContains('pm_run_outside_main_app', $result);
|
$this->assertStringContainsString('pm_run_outside_main_app', $result);
|
||||||
$this->assertContains('pathRTLCss', $result);
|
$this->assertStringContainsString('pathRTLCss', $result);
|
||||||
$this->assertContains('fieldsRequired', $result);
|
$this->assertStringContainsString('fieldsRequired', $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_get_next_step_method()
|
public function it_should_test_get_next_step_method()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
@@ -68,19 +68,19 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_get_next_step_method_position()
|
public function it_should_test_get_next_step_method_position()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||||
]);
|
]);
|
||||||
factory(Step::class)->create([
|
Step::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $appDelegation->TAS_UID,
|
'TAS_UID' => $appDelegation->TAS_UID,
|
||||||
'STEP_POSITION' => 2,
|
'STEP_POSITION' => 2,
|
||||||
@@ -99,19 +99,19 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_get_next_step_method_output_document()
|
public function it_should_test_get_next_step_method_output_document()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||||
]);
|
]);
|
||||||
factory(Step::class)->create([
|
Step::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $appDelegation->TAS_UID,
|
'TAS_UID' => $appDelegation->TAS_UID,
|
||||||
'STEP_POSITION' => 2,
|
'STEP_POSITION' => 2,
|
||||||
@@ -131,19 +131,19 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_get_next_step_method_input_document()
|
public function it_should_test_get_next_step_method_input_document()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||||
]);
|
]);
|
||||||
factory(Step::class)->create([
|
Step::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $appDelegation->TAS_UID,
|
'TAS_UID' => $appDelegation->TAS_UID,
|
||||||
'STEP_POSITION' => 2,
|
'STEP_POSITION' => 2,
|
||||||
@@ -163,19 +163,19 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_get_next_step_method_external()
|
public function it_should_test_get_next_step_method_external()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||||
]);
|
]);
|
||||||
factory(Step::class)->create([
|
Step::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $appDelegation->TAS_UID,
|
'TAS_UID' => $appDelegation->TAS_UID,
|
||||||
'STEP_POSITION' => 2,
|
'STEP_POSITION' => 2,
|
||||||
@@ -195,19 +195,19 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_get_next_step_method_message()
|
public function it_should_test_get_next_step_method_message()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||||
]);
|
]);
|
||||||
factory(Step::class)->create([
|
Step::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $appDelegation->TAS_UID,
|
'TAS_UID' => $appDelegation->TAS_UID,
|
||||||
'STEP_POSITION' => 2,
|
'STEP_POSITION' => 2,
|
||||||
@@ -227,13 +227,13 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_get_next_step_method_step_does_not_exists()
|
public function it_should_test_get_next_step_method_step_does_not_exists()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
@@ -265,9 +265,9 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_get_next_step_method_step_false()
|
public function it_should_test_get_next_step_method_step_false()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$application = factory(Application::class)->create();
|
$application = Application::factory()->create();
|
||||||
$appDelegation = factory(Delegation::class)->create();
|
$appDelegation = Delegation::factory()->create();
|
||||||
$cases = new Cases();
|
$cases = new Cases();
|
||||||
$res = $cases->getNextStep($process->PRO_UID, $application->APP_UID, $appDelegation->DEL_INDEX);
|
$res = $cases->getNextStep($process->PRO_UID, $application->APP_UID, $appDelegation->DEL_INDEX);
|
||||||
$this->assertFalse($res);
|
$this->assertFalse($res);
|
||||||
@@ -282,19 +282,19 @@ class CasesTest extends TestCase
|
|||||||
public function it_should_test_get_next_step_method_gmail()
|
public function it_should_test_get_next_step_method_gmail()
|
||||||
{
|
{
|
||||||
$_SESSION['gmail'] = '';
|
$_SESSION['gmail'] = '';
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||||
]);
|
]);
|
||||||
factory(Step::class)->create([
|
Step::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $appDelegation->TAS_UID,
|
'TAS_UID' => $appDelegation->TAS_UID,
|
||||||
'STEP_POSITION' => 2,
|
'STEP_POSITION' => 2,
|
||||||
@@ -315,19 +315,19 @@ class CasesTest extends TestCase
|
|||||||
public function it_should_test_get_next_step_method_gmail_nextstep()
|
public function it_should_test_get_next_step_method_gmail_nextstep()
|
||||||
{
|
{
|
||||||
$_SESSION['gmail'] = '';
|
$_SESSION['gmail'] = '';
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||||
]);
|
]);
|
||||||
factory(Step::class)->create([
|
Step::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $appDelegation->TAS_UID,
|
'TAS_UID' => $appDelegation->TAS_UID,
|
||||||
'STEP_POSITION' => 1,
|
'STEP_POSITION' => 1,
|
||||||
@@ -348,19 +348,19 @@ class CasesTest extends TestCase
|
|||||||
public function it_should_test_get_next_step_method_condition_empty()
|
public function it_should_test_get_next_step_method_condition_empty()
|
||||||
{
|
{
|
||||||
$_SESSION['gmail'] = '';
|
$_SESSION['gmail'] = '';
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||||
]);
|
]);
|
||||||
factory(Step::class)->create([
|
Step::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_UID' => $appDelegation->TAS_UID,
|
'TAS_UID' => $appDelegation->TAS_UID,
|
||||||
'STEP_POSITION' => 2,
|
'STEP_POSITION' => 2,
|
||||||
@@ -381,24 +381,24 @@ class CasesTest extends TestCase
|
|||||||
public function it_should_test_get_start_cases()
|
public function it_should_test_get_start_cases()
|
||||||
{
|
{
|
||||||
// Creating a process with initial tasks
|
// Creating a process with initial tasks
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
$normalTask = factory(Task::class)->create([
|
$normalTask = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'PRO_ID' => $process->PRO_ID,
|
'PRO_ID' => $process->PRO_ID,
|
||||||
'TAS_START' => 'TRUE'
|
'TAS_START' => 'TRUE'
|
||||||
]);
|
]);
|
||||||
$webEntryTask = factory(Task::class)->create([
|
$webEntryTask = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'PRO_ID' => $process->PRO_ID,
|
'PRO_ID' => $process->PRO_ID,
|
||||||
'TAS_START' => 'TRUE',
|
'TAS_START' => 'TRUE',
|
||||||
'TAS_TYPE' => 'WEBENTRYEVENT'
|
'TAS_TYPE' => 'WEBENTRYEVENT'
|
||||||
]);
|
]);
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $normalTask->TAS_UID,
|
'TAS_UID' => $normalTask->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID
|
'USR_UID' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $webEntryTask->TAS_UID,
|
'TAS_UID' => $webEntryTask->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID
|
'USR_UID' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
@@ -423,8 +423,8 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_shoult_test_the_get_to_method_with_default_tas_assign_type()
|
public function it_shoult_test_the_get_to_method_with_default_tas_assign_type()
|
||||||
{
|
{
|
||||||
$task = factory(Task::class)->create();
|
$task = Task::factory()->create();
|
||||||
$user = factory(User::class)->create([
|
$user = User::factory()->create([
|
||||||
'USR_EMAIL' => 'test@test.com'
|
'USR_EMAIL' => 'test@test.com'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -432,7 +432,7 @@ class CasesTest extends TestCase
|
|||||||
$cases = new Cases();
|
$cases = new Cases();
|
||||||
$result = $cases->getTo($task->TAS_UID, $user->USR_UID, '');
|
$result = $cases->getTo($task->TAS_UID, $user->USR_UID, '');
|
||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
$this->assertRegExp("/{$user->USR_EMAIL}/", $result["to"]);
|
$this->assertMatchesRegularExpression("/{$user->USR_EMAIL}/", $result["to"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -443,41 +443,41 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_shoult_test_the_get_to_method_with_self_service_tas_assign_type()
|
public function it_shoult_test_the_get_to_method_with_self_service_tas_assign_type()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
|
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_ASSIGN_TYPE' => 'BALANCED'
|
'TAS_ASSIGN_TYPE' => 'BALANCED'
|
||||||
]);
|
]);
|
||||||
$task2 = factory(Task::class)->create([
|
$task2 = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE'
|
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$user = factory(User::class)->create([
|
$user = User::factory()->create([
|
||||||
'USR_EMAIL' => 'test@test.com'
|
'USR_EMAIL' => 'test@test.com'
|
||||||
]);
|
]);
|
||||||
$user2 = factory(User::class)->create([
|
$user2 = User::factory()->create([
|
||||||
'USR_EMAIL' => 'test2@test2.com'
|
'USR_EMAIL' => 'test2@test2.com'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task2->TAS_UID,
|
'TAS_UID' => $task2->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID
|
'USR_UID' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task2->TAS_UID,
|
'TAS_UID' => $task2->TAS_UID,
|
||||||
'USR_UID' => $user2->USR_UID
|
'USR_UID' => $user2->USR_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'APP_STATUS_ID' => 2,
|
'APP_STATUS_ID' => 2,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'APP_INIT_USER' => "00000000000000000000000000000001",
|
'APP_INIT_USER' => "00000000000000000000000000000001",
|
||||||
'APP_CUR_USER' => $user2->USR_UID
|
'APP_CUR_USER' => $user2->USR_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 1,
|
'DEL_INDEX' => 1,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
@@ -488,7 +488,7 @@ class CasesTest extends TestCase
|
|||||||
'DEL_THREAD' => 1,
|
'DEL_THREAD' => 1,
|
||||||
'DEL_THREAD_STATUS' => 'CLOSED'
|
'DEL_THREAD_STATUS' => 'CLOSED'
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
@@ -499,7 +499,7 @@ class CasesTest extends TestCase
|
|||||||
'DEL_THREAD' => 2,
|
'DEL_THREAD' => 2,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN'
|
'DEL_THREAD_STATUS' => 'OPEN'
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 3,
|
'DEL_INDEX' => 3,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
@@ -534,8 +534,8 @@ class CasesTest extends TestCase
|
|||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
|
|
||||||
// Asserts the emails of both users are contained in the result
|
// Asserts the emails of both users are contained in the result
|
||||||
$this->assertRegExp("/{$user->USR_EMAIL}/", $result["to"]);
|
$this->assertMatchesRegularExpression("/{$user->USR_EMAIL}/", $result["to"]);
|
||||||
$this->assertRegExp("/{$user2->USR_EMAIL}/", $result["to"]);
|
$this->assertMatchesRegularExpression("/{$user2->USR_EMAIL}/", $result["to"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -546,41 +546,41 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_shoult_test_the_get_to_method_with_multiple_instance_tas_assign_type()
|
public function it_shoult_test_the_get_to_method_with_multiple_instance_tas_assign_type()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
|
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_ASSIGN_TYPE' => 'BALANCED'
|
'TAS_ASSIGN_TYPE' => 'BALANCED'
|
||||||
]);
|
]);
|
||||||
$task2 = factory(Task::class)->create([
|
$task2 = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_ASSIGN_TYPE' => 'MULTIPLE_INSTANCE'
|
'TAS_ASSIGN_TYPE' => 'MULTIPLE_INSTANCE'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$user = factory(User::class)->create([
|
$user = User::factory()->create([
|
||||||
'USR_EMAIL' => 'test@test.com'
|
'USR_EMAIL' => 'test@test.com'
|
||||||
]);
|
]);
|
||||||
$user2 = factory(User::class)->create([
|
$user2 = User::factory()->create([
|
||||||
'USR_EMAIL' => 'test2@test2.com'
|
'USR_EMAIL' => 'test2@test2.com'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task2->TAS_UID,
|
'TAS_UID' => $task2->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID
|
'USR_UID' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task2->TAS_UID,
|
'TAS_UID' => $task2->TAS_UID,
|
||||||
'USR_UID' => $user2->USR_UID
|
'USR_UID' => $user2->USR_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'APP_STATUS_ID' => 2,
|
'APP_STATUS_ID' => 2,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'APP_INIT_USER' => "00000000000000000000000000000001",
|
'APP_INIT_USER' => "00000000000000000000000000000001",
|
||||||
'APP_CUR_USER' => $user2->USR_UID
|
'APP_CUR_USER' => $user2->USR_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 1,
|
'DEL_INDEX' => 1,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
@@ -591,7 +591,7 @@ class CasesTest extends TestCase
|
|||||||
'DEL_THREAD' => 1,
|
'DEL_THREAD' => 1,
|
||||||
'DEL_THREAD_STATUS' => 'CLOSED'
|
'DEL_THREAD_STATUS' => 'CLOSED'
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
@@ -602,7 +602,7 @@ class CasesTest extends TestCase
|
|||||||
'DEL_THREAD' => 2,
|
'DEL_THREAD' => 2,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN'
|
'DEL_THREAD_STATUS' => 'OPEN'
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 3,
|
'DEL_INDEX' => 3,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
@@ -637,7 +637,7 @@ class CasesTest extends TestCase
|
|||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
|
|
||||||
// Asserts the emails of both users are contained in the result
|
// Asserts the emails of both users are contained in the result
|
||||||
$this->assertRegExp("/{$user->USR_EMAIL}/", $result["to"]);
|
$this->assertMatchesRegularExpression("/{$user->USR_EMAIL}/", $result["to"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -648,42 +648,42 @@ class CasesTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_shoult_test_the_get_to_method_with_multiple_instance_value_based_tas_assign_type()
|
public function it_shoult_test_the_get_to_method_with_multiple_instance_value_based_tas_assign_type()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
|
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_ASSIGN_TYPE' => 'BALANCED'
|
'TAS_ASSIGN_TYPE' => 'BALANCED'
|
||||||
]);
|
]);
|
||||||
$task2 = factory(Task::class)->create([
|
$task2 = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_ASSIGN_TYPE' => 'MULTIPLE_INSTANCE_VALUE_BASED',
|
'TAS_ASSIGN_TYPE' => 'MULTIPLE_INSTANCE_VALUE_BASED',
|
||||||
'TAS_ASSIGN_VARIABLE' => '@@users'
|
'TAS_ASSIGN_VARIABLE' => '@@users'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$user = factory(User::class)->create([
|
$user = User::factory()->create([
|
||||||
'USR_EMAIL' => 'test@test.com'
|
'USR_EMAIL' => 'test@test.com'
|
||||||
]);
|
]);
|
||||||
$user2 = factory(User::class)->create([
|
$user2 = User::factory()->create([
|
||||||
'USR_EMAIL' => 'test2@test2.com'
|
'USR_EMAIL' => 'test2@test2.com'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task2->TAS_UID,
|
'TAS_UID' => $task2->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID
|
'USR_UID' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task2->TAS_UID,
|
'TAS_UID' => $task2->TAS_UID,
|
||||||
'USR_UID' => $user2->USR_UID
|
'USR_UID' => $user2->USR_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'APP_STATUS_ID' => 2,
|
'APP_STATUS_ID' => 2,
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'APP_INIT_USER' => "00000000000000000000000000000001",
|
'APP_INIT_USER' => "00000000000000000000000000000001",
|
||||||
'APP_CUR_USER' => $user2->USR_UID
|
'APP_CUR_USER' => $user2->USR_UID
|
||||||
]);
|
]);
|
||||||
|
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 1,
|
'DEL_INDEX' => 1,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
@@ -694,7 +694,7 @@ class CasesTest extends TestCase
|
|||||||
'DEL_THREAD' => 1,
|
'DEL_THREAD' => 1,
|
||||||
'DEL_THREAD_STATUS' => 'CLOSED'
|
'DEL_THREAD_STATUS' => 'CLOSED'
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 2,
|
'DEL_INDEX' => 2,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
@@ -705,7 +705,7 @@ class CasesTest extends TestCase
|
|||||||
'DEL_THREAD' => 2,
|
'DEL_THREAD' => 2,
|
||||||
'DEL_THREAD_STATUS' => 'OPEN'
|
'DEL_THREAD_STATUS' => 'OPEN'
|
||||||
]);
|
]);
|
||||||
factory(Delegation::class)->create([
|
Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'DEL_INDEX' => 3,
|
'DEL_INDEX' => 3,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
@@ -741,6 +741,6 @@ class CasesTest extends TestCase
|
|||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
|
|
||||||
// Asserts the emails of both users are contained in the result
|
// Asserts the emails of both users are contained in the result
|
||||||
$this->assertRegExp("/{$user->USR_EMAIL}/", $result["to"]);
|
$this->assertMatchesRegularExpression("/{$user->USR_EMAIL}/", $result["to"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class ConfigurationsTest extends TestCase
|
|||||||
public function it_should_return_empty_preferences()
|
public function it_should_return_empty_preferences()
|
||||||
{
|
{
|
||||||
//Define a user preferences empty
|
//Define a user preferences empty
|
||||||
$configuration = factory(Configuration::class)->states('userPreferencesEmpty')->create();
|
$configuration = Configuration::factory()->userPreferencesEmpty()->create();
|
||||||
|
|
||||||
//Get the user preferences
|
//Get the user preferences
|
||||||
$conf = new Configurations();
|
$conf = new Configurations();
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ class DbConnectionsTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_loadAdditionalConnections_method()
|
public function it_should_test_loadAdditionalConnections_method()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
|
|
||||||
$dbName = env('DB_DATABASE');
|
$dbName = env('DB_DATABASE');
|
||||||
$dbSource = factory(DbSource::class)->create([
|
$dbSource = DbSource::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DBS_TYPE' => 'mysql',
|
'DBS_TYPE' => 'mysql',
|
||||||
'DBS_SERVER' => env('DB_HOST'),
|
'DBS_SERVER' => env('DB_HOST'),
|
||||||
@@ -60,10 +60,10 @@ class DbConnectionsTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_loadAdditionalConnections_method_with_force_option_true()
|
public function it_should_test_loadAdditionalConnections_method_with_force_option_true()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
|
|
||||||
$dbName = env('DB_DATABASE');
|
$dbName = env('DB_DATABASE');
|
||||||
$dbSource = factory(DbSource::class)->create([
|
$dbSource = DbSource::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DBS_TYPE' => 'mysql',
|
'DBS_TYPE' => 'mysql',
|
||||||
'DBS_SERVER' => env('DB_HOST'),
|
'DBS_SERVER' => env('DB_HOST'),
|
||||||
@@ -88,10 +88,10 @@ class DbConnectionsTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_loadAdditionalConnections_method_with_force_option_false()
|
public function it_should_test_loadAdditionalConnections_method_with_force_option_false()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class)->create();
|
$process = Process::factory()->create();
|
||||||
|
|
||||||
$dbName = env('DB_DATABASE');
|
$dbName = env('DB_DATABASE');
|
||||||
$dbSource = factory(DbSource::class)->create([
|
$dbSource = DbSource::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'DBS_TYPE' => 'mysql',
|
'DBS_TYPE' => 'mysql',
|
||||||
'DBS_SERVER' => env('DB_HOST'),
|
'DBS_SERVER' => env('DB_HOST'),
|
||||||
|
|||||||
@@ -119,23 +119,23 @@ class DerivationTest extends TestCase
|
|||||||
public function it_should_test_the_do_derivation_method_sending_variables_synchronously()
|
public function it_should_test_the_do_derivation_method_sending_variables_synchronously()
|
||||||
{
|
{
|
||||||
// Create the models
|
// Create the models
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
$process = factory(Process::class)->create([
|
$process = Process::factory()->create([
|
||||||
'PRO_CREATE_USER' => $user->USR_UID
|
'PRO_CREATE_USER' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
]);
|
]);
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'APP_INIT_USER' => $user->USR_UID,
|
'APP_INIT_USER' => $user->USR_UID,
|
||||||
'APP_CUR_USER' => $user->USR_UID
|
'APP_CUR_USER' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER
|
'APP_NUMBER' => $application->APP_NUMBER
|
||||||
]);
|
]);
|
||||||
factory(SubApplication::class)->create([
|
SubApplication::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'APP_PARENT' => $application->APP_UID,
|
'APP_PARENT' => $application->APP_UID,
|
||||||
'DEL_INDEX_PARENT' => $appDelegation->DEL_INDEX
|
'DEL_INDEX_PARENT' => $appDelegation->DEL_INDEX
|
||||||
@@ -203,35 +203,35 @@ class DerivationTest extends TestCase
|
|||||||
public function it_should_test_the_do_derivation_method_sending_variables_asynchronously()
|
public function it_should_test_the_do_derivation_method_sending_variables_asynchronously()
|
||||||
{
|
{
|
||||||
// Create the models
|
// Create the models
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
$process = factory(Process::class)->create([
|
$process = Process::factory()->create([
|
||||||
'PRO_CREATE_USER' => $user->USR_UID
|
'PRO_CREATE_USER' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
$task = factory(Task::class)->create([
|
$task = Task::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'TAS_USER' => $user->USR_UID
|
'TAS_USER' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
factory(TaskUser::class)->create([
|
TaskUser::factory()->create([
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'USR_UID' => $user->USR_UID
|
'USR_UID' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
$application = factory(Application::class)->create([
|
$application = Application::factory()->create([
|
||||||
'PRO_UID' => $process->PRO_UID,
|
'PRO_UID' => $process->PRO_UID,
|
||||||
'APP_INIT_USER' => $user->USR_UID,
|
'APP_INIT_USER' => $user->USR_UID,
|
||||||
'APP_CUR_USER' => $user->USR_UID
|
'APP_CUR_USER' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
$appDelegation = factory(Delegation::class)->create([
|
$appDelegation = Delegation::factory()->create([
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'APP_NUMBER' => $application->APP_NUMBER
|
'APP_NUMBER' => $application->APP_NUMBER
|
||||||
]);
|
]);
|
||||||
factory(SubApplication::class)->create([
|
SubApplication::factory()->create([
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
'APP_PARENT' => $application->APP_UID,
|
'APP_PARENT' => $application->APP_UID,
|
||||||
'DEL_INDEX_PARENT' => $appDelegation->DEL_INDEX,
|
'DEL_INDEX_PARENT' => $appDelegation->DEL_INDEX,
|
||||||
'SA_STATUS' => 'FINISHED'
|
'SA_STATUS' => 'FINISHED'
|
||||||
]);
|
]);
|
||||||
factory(Route::class)->create([
|
Route::factory()->create([
|
||||||
'TAS_UID' => $task->TAS_UID,
|
'TAS_UID' => $task->TAS_UID,
|
||||||
'ROU_NEXT_TASK' => $task->TAS_UID,
|
'ROU_NEXT_TASK' => $task->TAS_UID,
|
||||||
'PRO_UID' => $process->PRO_UID
|
'PRO_UID' => $process->PRO_UID
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Faker\Factory;
|
use Faker\Factory;
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
||||||
use ProcessMaker\Model\Dynaform;
|
use ProcessMaker\Model\Dynaform;
|
||||||
use ProcessMaker\Model\Process;
|
use ProcessMaker\Model\Process;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
@@ -36,7 +35,7 @@ class PmDynaformTest extends TestCase
|
|||||||
if (!defined("DB_PASS")) {
|
if (!defined("DB_PASS")) {
|
||||||
define("DB_PASS", env('DB_PASSWORD'));
|
define("DB_PASS", env('DB_PASSWORD'));
|
||||||
}
|
}
|
||||||
Dynaform::truncate();
|
$this->truncateNonInitialModels();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,9 +47,9 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 6,
|
'DYN_ID' => 6,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -72,9 +71,9 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 5,
|
'DYN_ID' => 5,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -96,9 +95,9 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 5,
|
'DYN_ID' => 5,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -120,9 +119,9 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 5,
|
'DYN_ID' => 5,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -144,9 +143,9 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 5,
|
'DYN_ID' => 5,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -169,9 +168,9 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 5,
|
'DYN_ID' => 5,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -194,9 +193,9 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 4,
|
'DYN_ID' => 4,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -223,9 +222,9 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 6,
|
'DYN_ID' => 6,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -247,9 +246,9 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 5,
|
'DYN_ID' => 5,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -271,9 +270,9 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 3,
|
'DYN_ID' => 3,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -294,10 +293,10 @@ class PmDynaformTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_return_null_when_not_exist_dynaform()
|
public function it_should_return_null_when_not_exist_dynaform()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 7,
|
'DYN_ID' => 7,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -330,10 +329,10 @@ class PmDynaformTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_return_array_dynaforms_except_current_dynaform_in_second_execution()
|
public function it_should_return_array_dynaforms_except_current_dynaform_in_second_execution()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 7,
|
'DYN_ID' => 7,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -341,7 +340,7 @@ class PmDynaformTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$arrayForm2 = $this->createArrayDynaform();
|
$arrayForm2 = $this->createArrayDynaform();
|
||||||
$dynaform2 = factory(Dynaform::class, 1)->create([
|
$dynaform2 = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 9,
|
'DYN_ID' => 9,
|
||||||
'DYN_UID' => $arrayForm2['items'][0]['id'],
|
'DYN_UID' => $arrayForm2['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -364,10 +363,10 @@ class PmDynaformTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_return_array_dynaforms_except_current_dynaform()
|
public function it_should_return_array_dynaforms_except_current_dynaform()
|
||||||
{
|
{
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 7,
|
'DYN_ID' => 7,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -375,7 +374,7 @@ class PmDynaformTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$arrayForm2 = $this->createArrayDynaform();
|
$arrayForm2 = $this->createArrayDynaform();
|
||||||
$dynaform2 = factory(Dynaform::class, 1)->create([
|
$dynaform2 = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 9,
|
'DYN_ID' => 9,
|
||||||
'DYN_UID' => $arrayForm2['items'][0]['id'],
|
'DYN_UID' => $arrayForm2['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -416,9 +415,9 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 1,
|
'DYN_ID' => 1,
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
@@ -443,9 +442,9 @@ class PmDynaformTest extends TestCase
|
|||||||
|
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
|
|
||||||
$process = factory(Process::class, 1)->create();
|
$process = Process::factory(1)->create();
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class, 1)->create([
|
$dynaform = Dynaform::factory(1)->create([
|
||||||
'DYN_ID' => 2,
|
'DYN_ID' => 2,
|
||||||
'PRO_UID' => $process[0]->PRO_UID,
|
'PRO_UID' => $process[0]->PRO_UID,
|
||||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||||
@@ -831,7 +830,7 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
// Create a form without translations defined
|
// Create a form without translations defined
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
$form = factory(Dynaform::class)->create([
|
$form = Dynaform::factory()->create([
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||||
]);
|
]);
|
||||||
@@ -841,7 +840,7 @@ class PmDynaformTest extends TestCase
|
|||||||
|
|
||||||
// Create a form with translations defined
|
// Create a form with translations defined
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
$form = factory(Dynaform::class)->states('translations')->create([
|
$form = Dynaform::factory()->translations()->create([
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||||
]);
|
]);
|
||||||
@@ -861,7 +860,7 @@ class PmDynaformTest extends TestCase
|
|||||||
{
|
{
|
||||||
$arrayForm = $this->createArrayDynaform();
|
$arrayForm = $this->createArrayDynaform();
|
||||||
// Create a translations related to ["es", "es-Es"]
|
// Create a translations related to ["es", "es-Es"]
|
||||||
$form = factory(Dynaform::class)->states('translations')->create([
|
$form = Dynaform::factory()->translations()->create([
|
||||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||||
]);
|
]);
|
||||||
@@ -963,7 +962,7 @@ class PmDynaformTest extends TestCase
|
|||||||
public function it_should_get_dynaform_title()
|
public function it_should_get_dynaform_title()
|
||||||
{
|
{
|
||||||
// Create a Dynaform
|
// Create a Dynaform
|
||||||
$dynaform = factory(Dynaform::class)->create([]);
|
$dynaform = Dynaform::factory()->create([]);
|
||||||
|
|
||||||
// Instance the class to test
|
// Instance the class to test
|
||||||
$pmDynaform = new PmDynaform();
|
$pmDynaform = new PmDynaform();
|
||||||
@@ -1082,10 +1081,10 @@ class PmDynaformTest extends TestCase
|
|||||||
$data2 = file_get_contents($pathData2);
|
$data2 = file_get_contents($pathData2);
|
||||||
$json2 = json_decode($data2);
|
$json2 = json_decode($data2);
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'DYN_CONTENT' => $data
|
'DYN_CONTENT' => $data
|
||||||
]);
|
]);
|
||||||
factory(Dynaform::class)->create([
|
Dynaform::factory()->create([
|
||||||
'DYN_CONTENT' => $data,
|
'DYN_CONTENT' => $data,
|
||||||
'PRO_UID' => $dynaform->PRO_UID
|
'PRO_UID' => $dynaform->PRO_UID
|
||||||
]);
|
]);
|
||||||
@@ -1160,10 +1159,10 @@ class PmDynaformTest extends TestCase
|
|||||||
$data2 = file_get_contents($pathData2);
|
$data2 = file_get_contents($pathData2);
|
||||||
$json2 = json_decode($data2);
|
$json2 = json_decode($data2);
|
||||||
|
|
||||||
$dynaform = factory(Dynaform::class)->create([
|
$dynaform = Dynaform::factory()->create([
|
||||||
'DYN_CONTENT' => $data
|
'DYN_CONTENT' => $data
|
||||||
]);
|
]);
|
||||||
factory(Dynaform::class)->create([
|
Dynaform::factory()->create([
|
||||||
'DYN_CONTENT' => $data,
|
'DYN_CONTENT' => $data,
|
||||||
'PRO_UID' => $dynaform->PRO_UID
|
'PRO_UID' => $dynaform->PRO_UID
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
|||||||
|
|
||||||
use Faker\Factory;
|
use Faker\Factory;
|
||||||
use G;
|
use G;
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
||||||
use ProcessMaker\Model\DbSource;
|
use ProcessMaker\Model\DbSource;
|
||||||
use ProcessMaker\Model\ProcessCategory;
|
use ProcessMaker\Model\ProcessCategory;
|
||||||
use ProcessMaker\Model\User;
|
use ProcessMaker\Model\User;
|
||||||
@@ -25,7 +24,7 @@ class ExecuteQueryTest extends TestCase
|
|||||||
public function setUp(): void
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
ProcessCategory::truncate();
|
$this->truncateNonInitialModels();
|
||||||
$this->oldContentSystemTables = "";
|
$this->oldContentSystemTables = "";
|
||||||
$path = PATH_CONFIG . $this->nameSystemTables;
|
$path = PATH_CONFIG . $this->nameSystemTables;
|
||||||
if (file_exists($path)) {
|
if (file_exists($path)) {
|
||||||
@@ -47,7 +46,7 @@ class ExecuteQueryTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_must_return_the_result_of_execute_query_method()
|
public function it_must_return_the_result_of_execute_query_method()
|
||||||
{
|
{
|
||||||
$user = factory(User::class, 5)->create();
|
$user = User::factory(5)->create();
|
||||||
|
|
||||||
$user = $user->sortByDesc('USR_UID')->values()->map(function($item) {
|
$user = $user->sortByDesc('USR_UID')->values()->map(function($item) {
|
||||||
$result = [
|
$result = [
|
||||||
@@ -139,7 +138,7 @@ class ExecuteQueryTest extends TestCase
|
|||||||
$id = $faker->unique()->numberBetween(1, 10000000);
|
$id = $faker->unique()->numberBetween(1, 10000000);
|
||||||
$newName = str_replace("'", " ", $faker->name);
|
$newName = str_replace("'", " ", $faker->name);
|
||||||
|
|
||||||
$category = factory(ProcessCategory::class)->create([
|
$category = ProcessCategory::factory()->create([
|
||||||
'CATEGORY_ID' => $id
|
'CATEGORY_ID' => $id
|
||||||
]);
|
]);
|
||||||
$expected = $category->toArray();
|
$expected = $category->toArray();
|
||||||
@@ -176,7 +175,7 @@ class ExecuteQueryTest extends TestCase
|
|||||||
$id = $faker->unique()->numberBetween(1, 10000000);
|
$id = $faker->unique()->numberBetween(1, 10000000);
|
||||||
$newName = str_replace("'", " ", $faker->name);
|
$newName = str_replace("'", " ", $faker->name);
|
||||||
|
|
||||||
$category = factory(ProcessCategory::class)->create([
|
$category = ProcessCategory::factory()->create([
|
||||||
'CATEGORY_ID' => $id
|
'CATEGORY_ID' => $id
|
||||||
]);
|
]);
|
||||||
$expected = $category->toArray();
|
$expected = $category->toArray();
|
||||||
@@ -205,7 +204,7 @@ class ExecuteQueryTest extends TestCase
|
|||||||
{
|
{
|
||||||
$this->expectException(SQLException::class);
|
$this->expectException(SQLException::class);
|
||||||
$database = env('DB_DATABASE');
|
$database = env('DB_DATABASE');
|
||||||
$category = factory(ProcessCategory::class)->create();
|
$category = ProcessCategory::factory()->create();
|
||||||
|
|
||||||
$sql = ""
|
$sql = ""
|
||||||
. "DELETE FROM {$database}.PROCESS_CATEGORY "
|
. "DELETE FROM {$database}.PROCESS_CATEGORY "
|
||||||
@@ -228,7 +227,7 @@ class ExecuteQueryTest extends TestCase
|
|||||||
public function this_connects_to_an_external_database_using_the_execute_query_method()
|
public function this_connects_to_an_external_database_using_the_execute_query_method()
|
||||||
{
|
{
|
||||||
$dbName = env('DB_DATABASE');
|
$dbName = env('DB_DATABASE');
|
||||||
$dbSource = factory(DbSource::class)->create([
|
$dbSource = DbSource::factory()->create([
|
||||||
'DBS_TYPE' => 'mysql',
|
'DBS_TYPE' => 'mysql',
|
||||||
'DBS_SERVER' => env('DB_HOST'),
|
'DBS_SERVER' => env('DB_HOST'),
|
||||||
'DBS_DATABASE_NAME' => $dbName,
|
'DBS_DATABASE_NAME' => $dbName,
|
||||||
@@ -253,10 +252,10 @@ class ExecuteQueryTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function this_connects_to_an_external_oracle_database_using_the_execute_query_method()
|
public function this_connects_to_an_external_oracle_database_using_the_execute_query_method()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete('This test has not been implemented yet.');
|
$this->markTestSkipped('This test has not been implemented yet.');
|
||||||
|
|
||||||
$dbName = "XE";
|
$dbName = "XE";
|
||||||
$dbSource = factory(DbSource::class)->create([
|
$dbSource = DbSource::factory()->create([
|
||||||
'DBS_TYPE' => 'oracle',
|
'DBS_TYPE' => 'oracle',
|
||||||
'DBS_CONNECTION_TYPE' => 'NORMAL',
|
'DBS_CONNECTION_TYPE' => 'NORMAL',
|
||||||
'DBS_SERVER' => 'localhost',
|
'DBS_SERVER' => 'localhost',
|
||||||
@@ -322,7 +321,7 @@ class ExecuteQueryTest extends TestCase
|
|||||||
$id = $faker->unique()->numberBetween(1, 10000000);
|
$id = $faker->unique()->numberBetween(1, 10000000);
|
||||||
$newName = str_replace("'", " ", $faker->name);
|
$newName = str_replace("'", " ", $faker->name);
|
||||||
|
|
||||||
$category = factory(ProcessCategory::class)->create([
|
$category = ProcessCategory::factory()->create([
|
||||||
'CATEGORY_ID' => $id
|
'CATEGORY_ID' => $id
|
||||||
]);
|
]);
|
||||||
$expected = $category->toArray();
|
$expected = $category->toArray();
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class PMFAddCaseNoteTest extends TestCase
|
|||||||
public function it_add_case_notes()
|
public function it_add_case_notes()
|
||||||
{
|
{
|
||||||
// Create notes
|
// Create notes
|
||||||
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
$table = Delegation::factory()->foreign_keys()->create();
|
||||||
// Force commit for propel
|
// Force commit for propel
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFAddCaseNote($table->APP_UID, $table->PRO_UID, $table->TAS_UID, $table->USR_UID, 'note');
|
$result = PMFAddCaseNote($table->APP_UID, $table->PRO_UID, $table->TAS_UID, $table->USR_UID, 'note');
|
||||||
|
|||||||
@@ -26,15 +26,15 @@ class PMFAssignUserToGroupTest extends TestCase
|
|||||||
{
|
{
|
||||||
// Create user
|
// Create user
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
factory(RbacUsers::class)->create([
|
RbacUsers::factory()->create([
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
'USR_USERNAME' => $user->USR_USERNAME,
|
'USR_USERNAME' => $user->USR_USERNAME,
|
||||||
'USR_FIRSTNAME' => $user->USR_FIRSTNAME,
|
'USR_FIRSTNAME' => $user->USR_FIRSTNAME,
|
||||||
'USR_LASTNAME' => $user->USR_LASTNAME
|
'USR_LASTNAME' => $user->USR_LASTNAME
|
||||||
]);
|
]);
|
||||||
// Create group
|
// Create group
|
||||||
$group = factory(Groupwf::class)->create();
|
$group = Groupwf::factory()->create();
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFAssignUserToGroup($user->USR_UID, $group->GRP_UID);
|
$result = PMFAssignUserToGroup($user->USR_UID, $group->GRP_UID);
|
||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
@@ -13,7 +13,7 @@ use Tests\TestCase;
|
|||||||
*
|
*
|
||||||
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFCaseInformation.28.29
|
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFCaseInformation.28.29
|
||||||
*/
|
*/
|
||||||
class PMFCaseInformation extends TestCase
|
class PMFCaseInformationTest extends TestCase
|
||||||
{
|
{
|
||||||
use DatabaseTransactions;
|
use DatabaseTransactions;
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ class PMFCaseInformation extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_this_pmfunction_default_parameters()
|
public function it_should_test_this_pmfunction_default_parameters()
|
||||||
{
|
{
|
||||||
$table = factory(Application::class)->states('foreign_keys')->create();
|
$table = Application::factory()->foreign_keys()->create();
|
||||||
// Force commit for propel
|
// Force commit for propel
|
||||||
DB::commit();
|
DB::commit();
|
||||||
// Call the funtion
|
// Call the funtion
|
||||||
@@ -74,8 +74,8 @@ class PMFCaseInformation extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_this_pmfunction_index_parameter()
|
public function it_should_test_this_pmfunction_index_parameter()
|
||||||
{
|
{
|
||||||
$application = factory(Application::class)->states('todo')->create();
|
$application = Application::factory()->todo()->create();
|
||||||
$table = factory(Delegation::class)->states('foreign_keys')->create([
|
$table = Delegation::factory()->foreign_keys()->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
]);
|
]);
|
||||||
@@ -104,8 +104,8 @@ class PMFCaseInformation extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_this_pmfunction_app_data_parameter()
|
public function it_should_test_this_pmfunction_app_data_parameter()
|
||||||
{
|
{
|
||||||
$application = factory(Application::class)->states('todo')->create();
|
$application = Application::factory()->todo()->create();
|
||||||
$table = factory(Delegation::class)->states('foreign_keys')->create([
|
$table = Delegation::factory()->foreign_keys()->create([
|
||||||
'APP_NUMBER' => $application->APP_NUMBER,
|
'APP_NUMBER' => $application->APP_NUMBER,
|
||||||
'APP_UID' => $application->APP_UID,
|
'APP_UID' => $application->APP_UID,
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ class PMFCaseListTest extends TestCase
|
|||||||
public function it_return_list_of_cases()
|
public function it_return_list_of_cases()
|
||||||
{
|
{
|
||||||
// Create delegation
|
// Create delegation
|
||||||
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
$table = Delegation::factory()->foreign_keys()->create();
|
||||||
factory(AppThread::class)->create([
|
AppThread::factory()->create([
|
||||||
'APP_THREAD_STATUS' => 'OPEN',
|
'APP_THREAD_STATUS' => 'OPEN',
|
||||||
'APP_UID' => $table->APP_UID
|
'APP_UID' => $table->APP_UID
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ class PMFCreateUserTest extends TestCase
|
|||||||
public function it_create_user()
|
public function it_create_user()
|
||||||
{
|
{
|
||||||
// Create User
|
// Create User
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
factory(RbacUsers::class)->create([
|
RbacUsers::factory()->create([
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
'USR_USERNAME' => $user->USR_USERNAME,
|
'USR_USERNAME' => $user->USR_USERNAME,
|
||||||
'USR_FIRSTNAME' => $user->USR_FIRSTNAME,
|
'USR_FIRSTNAME' => $user->USR_FIRSTNAME,
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ class PMFDeleteCaseTest extends TestCase
|
|||||||
public function it_should_test_this_pmfunction_default_parameters()
|
public function it_should_test_this_pmfunction_default_parameters()
|
||||||
{
|
{
|
||||||
$this->expectException(Exception::class);
|
$this->expectException(Exception::class);
|
||||||
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
$table = Delegation::factory()->foreign_keys()->create();
|
||||||
factory(Triggers::class)->create([
|
Triggers::factory()->create([
|
||||||
'PRO_UID' => $table->PRO_UID
|
'PRO_UID' => $table->PRO_UID
|
||||||
]);
|
]);
|
||||||
// Force commit for propel
|
// Force commit for propel
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ class PMFGetCaseNotesTest extends TestCase
|
|||||||
public function it_get_case_notes()
|
public function it_get_case_notes()
|
||||||
{
|
{
|
||||||
// Create notes
|
// Create notes
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
$table = factory(AppNotes::class)->create([
|
$table = AppNotes::factory()->create([
|
||||||
'USR_UID' => $user->USR_UID
|
'USR_UID' => $user->USR_UID
|
||||||
]);
|
]);
|
||||||
// Force commit for propel
|
// Force commit for propel
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class PMFGetGroupNameTest extends TestCase
|
|||||||
public function it_get_group_name()
|
public function it_get_group_name()
|
||||||
{
|
{
|
||||||
// Create group
|
// Create group
|
||||||
$group = factory(Groupwf::class)->create();
|
$group = Groupwf::factory()->create();
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFGetGroupName($group->GRP_TITLE, 'en');
|
$result = PMFGetGroupName($group->GRP_TITLE, 'en');
|
||||||
$this->assertFalse($result);
|
$this->assertFalse($result);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class PMFGetGroupUIDTest extends TestCase
|
|||||||
public function it_group_uid()
|
public function it_group_uid()
|
||||||
{
|
{
|
||||||
// Create group
|
// Create group
|
||||||
$group = factory(Groupwf::class)->create();
|
$group = Groupwf::factory()->create();
|
||||||
$result = PMFGetGroupUID($group->GRP_UID);
|
$result = PMFGetGroupUID($group->GRP_UID);
|
||||||
$this->assertFalse($result);
|
$this->assertFalse($result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class PMFGetGroupUsersTest extends TestCase
|
|||||||
public function it_return_list_of_groups()
|
public function it_return_list_of_groups()
|
||||||
{
|
{
|
||||||
// Create group
|
// Create group
|
||||||
$group = factory(Groupwf::class)->create();
|
$group = Groupwf::factory()->create();
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFGetGroupUsers($group->GRP_UID);
|
$result = PMFGetGroupUsers($group->GRP_UID);
|
||||||
$this->assertEmpty($result);
|
$this->assertEmpty($result);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class PMFGetProcessUidByNameTest extends TestCase
|
|||||||
public function it_return_process()
|
public function it_return_process()
|
||||||
{
|
{
|
||||||
// Create process
|
// Create process
|
||||||
$table = factory(Process::class)->create();
|
$table = Process::factory()->create();
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFGetProcessUidByName($table->PRO_TITLE);
|
$result = PMFGetProcessUidByName($table->PRO_TITLE);
|
||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class PMFGetTaskNameTest extends TestCase
|
|||||||
public function it_return_task_name()
|
public function it_return_task_name()
|
||||||
{
|
{
|
||||||
// Create task
|
// Create task
|
||||||
$task = factory(Task::class)->create();
|
$task = Task::factory()->create();
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFGetTaskName($task->TAS_UID);
|
$result = PMFGetTaskName($task->TAS_UID);
|
||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class PMFGetTaskUIDTest extends TestCase
|
|||||||
public function it_return_task_uid()
|
public function it_return_task_uid()
|
||||||
{
|
{
|
||||||
// Create task
|
// Create task
|
||||||
$table = factory(Task::class)->states('foreign_keys')->create();
|
$table = Task::factory()->foreign_keys()->create();
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFGetTaskUID($table->TAS_TITLE);
|
$result = PMFGetTaskUID($table->TAS_TITLE);
|
||||||
$this->assertFalse($result);
|
$this->assertFalse($result);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class PMFGetUserEmailAddressTest extends TestCase
|
|||||||
{
|
{
|
||||||
// Create User
|
// Create User
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFGetUserEmailAddress([$user->USR_UID], null);
|
$result = PMFGetUserEmailAddress([$user->USR_UID], null);
|
||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class PMFGroupListTest extends TestCase
|
|||||||
public function it_return_list_of_groups()
|
public function it_return_list_of_groups()
|
||||||
{
|
{
|
||||||
// Create group
|
// Create group
|
||||||
factory(Groupwf::class)->create();
|
Groupwf::factory()->create();
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFGroupList();
|
$result = PMFGroupList();
|
||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class PMFInformationUserTest extends TestCase
|
|||||||
{
|
{
|
||||||
// Create User
|
// Create User
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->create();
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFInformationUser($user->USR_UID);
|
$result = PMFInformationUser($user->USR_UID);
|
||||||
$this->assertNotEmpty($result);
|
$this->assertNotEmpty($result);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
@@ -24,7 +24,7 @@ class PMFNewCaseImpersonateTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_this_pmfunction_default_parameters()
|
public function it_should_test_this_pmfunction_default_parameters()
|
||||||
{
|
{
|
||||||
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
$table = Delegation::factory()->foreign_keys()->create();
|
||||||
// Force commit for propel
|
// Force commit for propel
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFNewCaseImpersonate($table->PRO_UID, $table->USR_UID, [], '');
|
$result = PMFNewCaseImpersonate($table->PRO_UID, $table->USR_UID, [], '');
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
@@ -24,7 +24,7 @@ class PMFNewCaseTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function it_should_test_this_pmfunction_default_parameters()
|
public function it_should_test_this_pmfunction_default_parameters()
|
||||||
{
|
{
|
||||||
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
$table = Delegation::factory()->foreign_keys()->create();
|
||||||
// Force commit for propel
|
// Force commit for propel
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$result = PMFNewCase($table->PRO_UID, $table->USR_UID, $table->TAS_UID, [], null);
|
$result = PMFNewCase($table->PRO_UID, $table->USR_UID, $table->TAS_UID, [], null);
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||||
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use ProcessMaker\Model\GroupUser;
|
use ProcessMaker\Model\GroupUser;
|
||||||
use ProcessMaker\Model\Groupwf;
|
use ProcessMaker\Model\Groupwf;
|
||||||
use ProcessMaker\Model\RbacUsers;
|
use ProcessMaker\Model\RbacUsers;
|
||||||
@@ -56,7 +54,7 @@ class PMFNewUserTest extends TestCase
|
|||||||
$RBAC->initRBAC();
|
$RBAC->initRBAC();
|
||||||
$RBAC->loadUserRolePermission('PROCESSMAKER', $_SESSION['USER_LOGGED']);
|
$RBAC->loadUserRolePermission('PROCESSMAKER', $_SESSION['USER_LOGGED']);
|
||||||
|
|
||||||
$group = factory(Groupwf::class)->create();
|
$group = Groupwf::factory()->create();
|
||||||
|
|
||||||
// Active
|
// Active
|
||||||
$result = PMFNewUser("test", "Test123*", "test", "test", "test@test.com", "PROCESSMAKER_ADMIN", null, null, $group['GRP_UID']);
|
$result = PMFNewUser("test", "Test123*", "test", "test", "test@test.com", "PROCESSMAKER_ADMIN", null, null, $group['GRP_UID']);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user