Merged in feature/PMCORE-3834 (pull request #8566)
Merging feature/PMCORE-3834 to develop
This commit is contained in:
@@ -3,10 +3,10 @@ jobs:
|
||||
build:
|
||||
working_directory: ~/processmaker
|
||||
docker:
|
||||
- image: devopsstacks/pm:n275-phpunit
|
||||
- image: devopsstacks/pm:n285-phpunit
|
||||
- image: circleci/mysql:8.0.13-ram
|
||||
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:
|
||||
MYSQL_HOST: 127.0.0.1
|
||||
MYSQL_ROOT_PASSWORD: 'password'
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
- run:
|
||||
name: Run Test Units
|
||||
command: |
|
||||
mkdir coverage
|
||||
mkdir -p coverage
|
||||
vendor/phpunit/phpunit/phpunit --stop-on-error --testdox-html coverage/result.html --coverage-html coverage --verbose tests/unit/
|
||||
- store_artifacts:
|
||||
path: coverage
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,5 @@
|
||||
nbproject/*
|
||||
workflow/engine/config/paths_installed.php
|
||||
gulliver/thirdparty/html2ps_pdf/cache
|
||||
workflow/engine/content/languages/translations.environments
|
||||
*~
|
||||
workflow/engine/js/labels/
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Contracts\Cache\Repository as Cache;
|
||||
use Illuminate\Queue\Console\RestartCommand as BaseRestartCommand;
|
||||
|
||||
class RestartCommand extends BaseRestartCommand
|
||||
@@ -17,4 +18,15 @@ class RestartCommand extends BaseRestartCommand
|
||||
* This contains the necessary code to add parameters.
|
||||
*/
|
||||
use AddParametersTrait;
|
||||
|
||||
/**
|
||||
* Create a new queue restart command.
|
||||
*
|
||||
* @param Cache $cache
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Cache $cache)
|
||||
{
|
||||
parent::__construct($cache);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,20 +4,23 @@ namespace App\Console\Commands;
|
||||
|
||||
use Bootstrap;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Console\Scheduling\ScheduleRunCommand as BaseCommand;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Contracts\Debug\ExceptionHandler;
|
||||
use Maveriks\WebApplication;
|
||||
use ProcessMaker\Model\TaskScheduler;
|
||||
|
||||
class ScheduleRunCommand extends BaseCommand
|
||||
{
|
||||
use AddParametersTrait;
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(\Illuminate\Console\Scheduling\Schedule $schedule)
|
||||
public function __construct()
|
||||
{
|
||||
$this->startedAt = Carbon::now();
|
||||
$this->signature = "schedule:run";
|
||||
@@ -27,16 +30,19 @@ class ScheduleRunCommand extends BaseCommand
|
||||
{--processmakerPath=./ : ProcessMaker path.}
|
||||
";
|
||||
$this->description .= ' (ProcessMaker has extended this command)';
|
||||
parent::__construct($schedule);
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @param Schedule $schedule
|
||||
* @param Dispatcher $dispatcher
|
||||
* @param ExceptionHandler $handler
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(Schedule $schedule, Dispatcher $dispatcher, ExceptionHandler $handler)
|
||||
{
|
||||
$that = $this;
|
||||
$workspace = $this->option('workspace');
|
||||
$user = $this->option('user');
|
||||
if (!empty($workspace)) {
|
||||
@@ -44,7 +50,7 @@ class ScheduleRunCommand extends BaseCommand
|
||||
$webApplication->setRootDir($this->option('processmakerPath'));
|
||||
$webApplication->loadEnvironment($workspace, false);
|
||||
}
|
||||
TaskScheduler::all()->each(function ($p) use ($that, $user) {
|
||||
TaskScheduler::all()->each(function ($p) use ($schedule, $user) {
|
||||
$win = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
|
||||
if ($p->enable == 1) {
|
||||
$starting = isset($p->startingTime) ? $p->startingTime : "0:00";
|
||||
@@ -52,7 +58,7 @@ class ScheduleRunCommand extends BaseCommand
|
||||
$timezone = isset($p->timezone) && $p->timezone != "" ? $p->timezone : date_default_timezone_get();
|
||||
$body = $p->body;
|
||||
if (!$win) {
|
||||
$body = str_replace(" -c"," " . $user . " -c", $p->body);
|
||||
$body = str_replace(" -c", " " . $user . " -c", $p->body);
|
||||
}
|
||||
|
||||
//for init date and finish date parameters
|
||||
@@ -71,7 +77,7 @@ class ScheduleRunCommand extends BaseCommand
|
||||
$body = str_replace("report_by_process", "report_by_process +init-date'{$oneMonthAgo}' +finish-date'{$currentDate}'", $body);
|
||||
}
|
||||
|
||||
$schedule = $that->schedule->exec($body)->cron($p->expression)->between($starting, $ending)->timezone($timezone)->when(function () use ($p) {
|
||||
$schedule->exec($body)->cron($p->expression)->between($starting, $ending)->timezone($timezone)->when(function () use ($p) {
|
||||
$now = Carbon::now();
|
||||
$result = false;
|
||||
$datework = Carbon::createFromFormat('Y-m-d H:i:s', $p->last_update);
|
||||
@@ -116,6 +122,6 @@ class ScheduleRunCommand extends BaseCommand
|
||||
}
|
||||
}
|
||||
});
|
||||
parent::handle();
|
||||
parent::handle($schedule, $dispatcher, $handler);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Contracts\Cache\Repository as Cache;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Queue\Console\WorkCommand as BaseWorkCommand;
|
||||
use Illuminate\Queue\Events\JobProcessing;
|
||||
@@ -9,7 +10,6 @@ use Illuminate\Queue\Worker;
|
||||
|
||||
class WorkCommand extends BaseWorkCommand
|
||||
{
|
||||
|
||||
use AddParametersTrait;
|
||||
|
||||
/**
|
||||
@@ -19,7 +19,7 @@ class WorkCommand extends BaseWorkCommand
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Worker $worker)
|
||||
public function __construct(Worker $worker, Cache $cache)
|
||||
{
|
||||
$this->signature .= '
|
||||
{--workspace=workflow : ProcessMaker Indicates the workspace to be processed.}
|
||||
@@ -28,7 +28,7 @@ class WorkCommand extends BaseWorkCommand
|
||||
|
||||
$this->description .= ' (ProcessMaker has extended this command)';
|
||||
|
||||
parent::__construct($worker);
|
||||
parent::__construct($worker, $cache);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,14 +62,14 @@ class WorkCommand extends BaseWorkCommand
|
||||
require_once $file;
|
||||
}
|
||||
//load the classes of the plugins when is required dynamically.
|
||||
$closure = function($className) {
|
||||
$closure = function ($className) {
|
||||
if (class_exists($className)) {
|
||||
return;
|
||||
}
|
||||
if (!defined('PATH_PLUGINS')) {
|
||||
return;
|
||||
}
|
||||
$searchFiles = function($path) use(&$searchFiles, $className) {
|
||||
$searchFiles = function ($path) use (&$searchFiles, $className) {
|
||||
$directories = File::directories($path);
|
||||
foreach ($directories as $directory) {
|
||||
$omittedDirectories = [
|
||||
|
||||
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] ?? []));
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Helpers\Workspace;
|
||||
use App\Console\Commands\WorkCommand;
|
||||
use App\Log\LogManager;
|
||||
use Illuminate\Queue\Worker;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -17,8 +18,11 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
App::bind('workspace', function() {
|
||||
return new Workspace();
|
||||
$this->app->bind(WorkCommand::class, function ($app) {
|
||||
$isDownForMaintenance = function () {
|
||||
return $this->app->isDownForMaintenance();
|
||||
};
|
||||
return new WorkCommand(App::make(Worker::class, ['isDownForMaintenance' => $isDownForMaintenance]), $app['cache.store']);
|
||||
});
|
||||
|
||||
$this->app->singleton('log', function ($app) {
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"laravel/framework": "5.7.*",
|
||||
"php": ">=7.4",
|
||||
"laravel/framework": "8.83.*",
|
||||
"luracast/restler": "3.0",
|
||||
"bshaffer/oauth2-server-php": "v1.0",
|
||||
"colosa/pmui": "release/3.7.5-dev",
|
||||
@@ -41,8 +41,8 @@
|
||||
"colosa/taskscheduler": "release/1.0.3-dev",
|
||||
"google/apiclient": "1.1.6",
|
||||
"dapphp/securimage": "^3.6",
|
||||
"psr/log": "1.0.0",
|
||||
"monolog/monolog": "1.19.0",
|
||||
"psr/log": "1.0.1",
|
||||
"monolog/monolog": "^2.1",
|
||||
"geshi/geshi": "dev-master",
|
||||
"libchart/libchart": "1.4.0",
|
||||
"phpmailer/phpmailer": "^6.4",
|
||||
@@ -52,25 +52,23 @@
|
||||
"ralouphie/getallheaders": "^2.0",
|
||||
"smarty/smarty": "2.6.31",
|
||||
"pdepend/pdepend": "@stable",
|
||||
"chumper/zipper": "^1.0",
|
||||
"php-imap/php-imap": "^3.0",
|
||||
"nikic/php-parser": "3.1.5",
|
||||
"laravel/tinker": "^1.0",
|
||||
"nikic/php-parser": "4.14",
|
||||
"laravel/tinker": "^2.0",
|
||||
"league/oauth2-client": "^2.4",
|
||||
"league/oauth2-google": "^3.0",
|
||||
"tecnickcom/tcpdf": "6.3.*",
|
||||
"fzaninotto/faker": "^1.7",
|
||||
"tecnickcom/tcpdf": "6.4.*",
|
||||
"fzaninotto/faker": "dev-master",
|
||||
"predis/predis": "1.1.1",
|
||||
"phpmyadmin/sql-parser": "^5.3",
|
||||
"aws/aws-sdk-php": "~3.0",
|
||||
"cretueusebiu/laravel-javascript": "^0.2.1",
|
||||
"stevenmaguire/oauth2-microsoft": "^2.2",
|
||||
"phpseclib/mcrypt_compat": "^2.0",
|
||||
"microsoft/microsoft-graph": "^1.7"
|
||||
},
|
||||
"require-dev": {
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"phpunit/phpunit": "~5.7",
|
||||
"phpunit/phpunit": "9.5",
|
||||
"filp/whoops": "~2.0",
|
||||
"behat/behat": "^3.3",
|
||||
"behat/mink-selenium2-driver": "^1.3",
|
||||
@@ -83,6 +81,7 @@
|
||||
},
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Maveriks\\": "framework/src/Maveriks/",
|
||||
"Tests\\": "tests/"
|
||||
},
|
||||
@@ -95,7 +94,6 @@
|
||||
"workflow/engine/includes/",
|
||||
"thirdparty/jsmin/jsmin.php",
|
||||
"thirdparty/pear",
|
||||
"thirdparty/html2ps_pdf",
|
||||
"thirdparty/phing",
|
||||
"thirdparty/pake",
|
||||
"rbac/engine/classes/"
|
||||
|
||||
@@ -27,12 +27,10 @@ return [
|
||||
Illuminate\Bus\BusServiceProvider::class,
|
||||
Illuminate\Redis\RedisServiceProvider::class,
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\ViewServiceProvider::class,
|
||||
Eusebiu\JavaScript\JavaScriptServiceProvider::class
|
||||
App\Providers\ViewServiceProvider::class
|
||||
],
|
||||
'aliases' => [
|
||||
'Crypt' => Illuminate\Support\Facades\Crypt::class,
|
||||
'ScriptVariables' => Eusebiu\JavaScript\Facades\ScriptVariables::class,
|
||||
'View' => Illuminate\Support\Facades\View::class
|
||||
],
|
||||
];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
checksum.txt
|
||||
features/backend/projects/database_connections/main_tests_database_connections_sqlserver.feature
|
||||
features/backend/projects/project_export_import/main_tests_project_export_import.feature
|
||||
gulliver/bin/tasks/pakeTest.php
|
||||
gulliver/core/Session/PmSessionHandler.php
|
||||
gulliver/js/codemirror/addon/hint/pig-hint.js
|
||||
gulliver/js/codemirror/addon/hint/python-hint.js
|
||||
@@ -37,6 +38,7 @@ rbac/engine/xmlform
|
||||
rbac/public_html/skins/JSForms.js
|
||||
virtualhost.conf.example
|
||||
workflow/engine/classes/class.jrml.php
|
||||
workflow/engine/classes/class.webdav.php
|
||||
workflow/engine/classes/entities/AppSolrQueue.php
|
||||
workflow/engine/classes/entities/Base.php
|
||||
workflow/engine/classes/entities/FacetGroup.php
|
||||
@@ -130,4 +132,53 @@ workflow/engine/xmlform/users/users_List.xml
|
||||
workflow/engine/xmlform/users/users_Options.xml
|
||||
workflow/public_html/skins/JSForms.js
|
||||
workflow/public_html/skins/ajax.js
|
||||
thirdparty/geshi
|
||||
thirdparty/html2ps_pdf
|
||||
thirdparty/libchart
|
||||
thirdparty/lime
|
||||
thirdparty/pear/Benchmark
|
||||
thirdparty/pear/Console
|
||||
thirdparty/pear/HTTP
|
||||
thirdparty/pear/Net
|
||||
thirdparty/pear/Numbers
|
||||
thirdparty/pear/OLE
|
||||
thirdparty/pear/SOAP
|
||||
thirdparty/pear/Spreadsheet
|
||||
thirdparty/pear/XML
|
||||
thirdparty/pear/DB/dbase.php
|
||||
thirdparty/pear/DB/fbsql.php
|
||||
thirdparty/pear/DB/ibase.php
|
||||
thirdparty/pear/DB/ifx.php
|
||||
thirdparty/pear/DB/msql.php
|
||||
thirdparty/pear/DB/mssql.php
|
||||
thirdparty/pear/DB/mysql.php
|
||||
thirdparty/pear/DB/sqlite.php
|
||||
thirdparty/pear/DB/storage.php
|
||||
thirdparty/pear/DB/sybase.php
|
||||
thirdparty/pear/Log/sqlite.php
|
||||
thirdparty/pear/catalog
|
||||
thirdparty/pear/CODING_STANDARDS
|
||||
thirdparty/pear/class.soap_fault.php
|
||||
thirdparty/pear/class.soap_parser.php
|
||||
thirdparty/pear/class.soap_server.php
|
||||
thirdparty/pear/class.soap_transport_http.php
|
||||
thirdparty/pear/class.soap_val.php
|
||||
thirdparty/pear/class.wsdl.php
|
||||
thirdparty/pear/class.wsdlcache.php
|
||||
thirdparty/pear/class.xmlschema.php
|
||||
thirdparty/pear/CMD.php
|
||||
thirdparty/pear/install-pear.php
|
||||
thirdparty/pear/install-pear.txt
|
||||
thirdparty/pear/nusoap.colosa.php
|
||||
thirdparty/pear/nusoap.php
|
||||
thirdparty/pear/nusoapmime.php
|
||||
thirdparty/pear/package-Archive_Tar.xml
|
||||
thirdparty/pear/package-Console_Getopt.xml
|
||||
thirdparty/pear/package.dtd
|
||||
thirdparty/pear/package-PEAR.xml
|
||||
thirdparty/pear/README
|
||||
thirdparty/pear/template.spec
|
||||
thirdparty/pear/UDDI.php
|
||||
thirdparty/propel-generator/classes/propel/engine/builder/sql/sqlite/SqliteDataSQLBuilder.php
|
||||
thirdparty/propel-generator/classes/propel/engine/platform/SqlitePlatform.php
|
||||
thirdparty/tcpdf
|
||||
@@ -1,30 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AbeConfiguration::class, function (Faker $faker) {
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
||||
$dynaform = factory(\ProcessMaker\Model\Dynaform::class)->create([
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class AbeConfigurationFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||
$dynaform = \ProcessMaker\Model\Dynaform::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create([
|
||||
$task = \ProcessMaker\Model\Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$emailServer = factory(\ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$emailServer = \ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||
return [
|
||||
'ABE_UID' => G::generateUniqueID(),
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'ABE_TYPE' => $faker->randomElement(['', 'LINK']),
|
||||
'ABE_TYPE' => $this->faker->randomElement(['', 'LINK']),
|
||||
'ABE_TEMPLATE' => 'actionByEmail.html',
|
||||
'ABE_DYN_TYPE' => 'NORMAL',
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
'ABE_EMAIL_FIELD' => 'admin@processmaker.com',
|
||||
'ABE_ACTION_FIELD' => '',
|
||||
'ABE_CASE_NOTE_IN_RESPONSE' => $faker->randomElement(['0', '1']),
|
||||
'ABE_FORCE_LOGIN' => $faker->randomElement(['0', '1']),
|
||||
'ABE_CREATE_DATE' => $faker->dateTime(),
|
||||
'ABE_UPDATE_DATE' => $faker->dateTime(),
|
||||
'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([]),
|
||||
@@ -32,4 +45,6 @@ $factory->define(\ProcessMaker\Model\AbeConfiguration::class, function (Faker $f
|
||||
'ABE_ACTION_BODY_FIELD' => '',
|
||||
'ABE_EMAIL_SERVER_RECEIVER_UID' => ''
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AbeRequest::class, function (Faker $faker) {
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
||||
$abeConfiguration = factory(\ProcessMaker\Model\AbeConfiguration::class)->create([
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class AbeRequestFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||
$abeConfiguration = \ProcessMaker\Model\AbeConfiguration::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$application = factory(\ProcessMaker\Model\Application::class)->create([
|
||||
$application = \ProcessMaker\Model\Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
return [
|
||||
@@ -15,11 +28,13 @@ $factory->define(\ProcessMaker\Model\AbeRequest::class, function (Faker $faker)
|
||||
'ABE_UID' => $abeConfiguration->ABE_UID,
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 0,
|
||||
'ABE_REQ_SENT_TO' => $faker->email,
|
||||
'ABE_REQ_SENT_TO' => $this->faker->email,
|
||||
'ABE_REQ_SUBJECT' => '',
|
||||
'ABE_REQ_BODY' => '',
|
||||
'ABE_REQ_DATE' => $faker->date(),
|
||||
'ABE_REQ_DATE' => $this->faker->date(),
|
||||
'ABE_REQ_STATUS' => '',
|
||||
'ABE_REQ_ANSWERED' => $faker->numberBetween(1, 9)
|
||||
'ABE_REQ_ANSWERED' => $this->faker->numberBetween(1, 9)
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AdditionalTables::class, function(Faker $faker) {
|
||||
$name = $faker->regexify("/[a-zA-Z]{6}/");
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class AdditionalTablesFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$name = $this->faker->regexify("/[a-zA-Z]{6}/");
|
||||
return [
|
||||
'ADD_TAB_UID' => G::generateUniqueID(),
|
||||
'ADD_TAB_NAME' => 'PMT_' . strtoupper($name),
|
||||
'ADD_TAB_CLASS_NAME' => 'Pmt' . $name,
|
||||
'ADD_TAB_DESCRIPTION' => $faker->text,
|
||||
'ADD_TAB_DESCRIPTION' => $this->faker->text,
|
||||
'ADD_TAB_SDW_LOG_INSERT' => 0,
|
||||
'ADD_TAB_SDW_LOG_UPDATE' => 0,
|
||||
'ADD_TAB_SDW_LOG_DELETE' => 0,
|
||||
@@ -17,13 +30,15 @@ $factory->define(\ProcessMaker\Model\AdditionalTables::class, function(Faker $fa
|
||||
'ADD_TAB_SDW_AUTO_DELETE' => 0,
|
||||
'ADD_TAB_PLG_UID' => '',
|
||||
'DBS_UID' => 'workflow',
|
||||
'PRO_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\Process::class)->create()->PRO_UID;
|
||||
'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' => $faker->dateTime()
|
||||
'ADD_TAB_UPDATE_DATE' => $this->faker->dateTime()
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,30 @@
|
||||
<?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;
|
||||
|
||||
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' => $faker->unique()->numberBetween(5000),
|
||||
'ID' => $this->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),
|
||||
'TAS_ID' => $this->faker->unique()->numberBetween(1, 2000),
|
||||
'GRP_UID' => G::generateUniqueID(),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a APP_ASSIGN_SELF_SERVICE_VALUE_GROUP
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class AppAssignSelfServiceValueGroupFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AppAssignSelfServiceValueGroup::class, function(Faker $faker) {
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'ID' => $faker->unique()->numberBetween(5000),
|
||||
'ID' => $this->faker->unique()->numberBetween(5000),
|
||||
'GRP_UID' => G::generateUniqueID(),
|
||||
'ASSIGNEE_ID' => $faker->unique()->numberBetween(1, 2000),
|
||||
'ASSIGNEE_TYPE' => $faker->unique()->numberBetween(1, 2000),
|
||||
'ASSIGNEE_ID' => $this->faker->unique()->numberBetween(1, 2000),
|
||||
'ASSIGNEE_TYPE' => $this->faker->unique()->numberBetween(1, 2000),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,35 +1,53 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AppDelay::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class AppDelayFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$actions = ['CANCEL', 'PAUSE', 'REASSIGN'];
|
||||
return [
|
||||
'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_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||
'APP_THREAD_INDEX' => $this->faker->unique()->numberBetween(100),
|
||||
'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' => $faker->dateTime(),
|
||||
'APP_ENABLE_ACTION_DATE' => $this->faker->dateTime(),
|
||||
'APP_DISABLE_ACTION_USER' => G::generateUniqueID(),
|
||||
'APP_DISABLE_ACTION_DATE' => $faker->dateTime(),
|
||||
'APP_DISABLE_ACTION_DATE' => $this->faker->dateTime(),
|
||||
'APP_AUTOMATIC_DISABLED_DATE' => '',
|
||||
'APP_DELEGATION_USER_ID' => $faker->unique()->numberBetween(1000),
|
||||
'PRO_ID' => $faker->unique()->numberBetween(1000),
|
||||
'APP_DELEGATION_USER_ID' => $this->faker->unique()->numberBetween(1000),
|
||||
'PRO_ID' => $this->faker->unique()->numberBetween(1000),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
// Create a delegation with the foreign keys
|
||||
$factory->state(\ProcessMaker\Model\AppDelay::class, 'paused_foreign_keys', function (Faker $faker) {
|
||||
/**
|
||||
* 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 = factory(\ProcessMaker\Model\Delegation::class)->states('closed')->create();
|
||||
$delegation2 = factory(\ProcessMaker\Model\Delegation::class)->states('foreign_keys')->create([
|
||||
$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,
|
||||
@@ -40,7 +58,7 @@ $factory->state(\ProcessMaker\Model\AppDelay::class, 'paused_foreign_keys', func
|
||||
'USR_UID' => $delegation1->USR_UID,
|
||||
'USR_ID' => $delegation1->USR_ID,
|
||||
'DEL_PREVIOUS' => $delegation1->DEL_INDEX,
|
||||
'DEL_INDEX' => $faker->unique()->numberBetween(2000),
|
||||
'DEL_INDEX' => $this->faker->unique()->numberBetween(2000),
|
||||
]);
|
||||
|
||||
// Return with default values
|
||||
@@ -56,7 +74,11 @@ $factory->state(\ProcessMaker\Model\AppDelay::class, 'paused_foreign_keys', func
|
||||
'APP_DELEGATION_USER' => $delegation2->USR_UID,
|
||||
'APP_DELEGATION_USER_ID' => $delegation2->USR_ID,
|
||||
'APP_ENABLE_ACTION_USER' => G::generateUniqueID(),
|
||||
'APP_ENABLE_ACTION_DATE' => $faker->dateTime(),
|
||||
'APP_ENABLE_ACTION_DATE' => $this->faker->dateTime(),
|
||||
'APP_DISABLE_ACTION_USER' => 0,
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,37 +1,52 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AppMessage::class, function(Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class AppMessageFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'APP_MSG_UID' => G::generateUniqueID(),
|
||||
'MSG_UID' => '',
|
||||
'APP_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\Application::class)->create()->APP_UID;
|
||||
'APP_UID' => function () {
|
||||
return \ProcessMaker\Model\Application::factory()->create()->APP_UID;
|
||||
},
|
||||
'DEL_INDEX' => 1,
|
||||
'APP_MSG_TYPE' => 'ROUTING',
|
||||
'APP_MSG_TYPE_ID' => 0,
|
||||
'APP_MSG_SUBJECT' => $faker->title,
|
||||
'APP_MSG_FROM' => $faker->email,
|
||||
'APP_MSG_TO' => $faker->email,
|
||||
'APP_MSG_BODY' => $faker->text,
|
||||
'APP_MSG_DATE' => $faker->dateTime(),
|
||||
'APP_MSG_SUBJECT' => $this->faker->title,
|
||||
'APP_MSG_FROM' => $this->faker->email,
|
||||
'APP_MSG_TO' => $this->faker->email,
|
||||
'APP_MSG_BODY' => $this->faker->text,
|
||||
'APP_MSG_DATE' => $this->faker->dateTime(),
|
||||
'APP_MSG_CC' => '',
|
||||
'APP_MSG_BCC' => '',
|
||||
'APP_MSG_TEMPLATE' => '',
|
||||
'APP_MSG_STATUS' => 'pending',
|
||||
'APP_MSG_STATUS_ID' => 1,
|
||||
'APP_MSG_ATTACH' => '',
|
||||
'APP_MSG_SEND_DATE' => $faker->dateTime(),
|
||||
'APP_MSG_SEND_DATE' => $this->faker->dateTime(),
|
||||
'APP_MSG_SHOW_MESSAGE' => 1,
|
||||
'APP_MSG_ERROR' => '',
|
||||
'PRO_ID' => function() {
|
||||
return factory(\ProcessMaker\Model\Process::class)->create()->PRO_ID;
|
||||
'PRO_ID' => function () {
|
||||
return \ProcessMaker\Model\Process::factory()->create()->PRO_ID;
|
||||
},
|
||||
'TAS_ID' => function() {
|
||||
return factory(\ProcessMaker\Model\Task::class)->create()->TAS_ID;
|
||||
'TAS_ID' => function () {
|
||||
return \ProcessMaker\Model\Task::factory()->create()->TAS_ID;
|
||||
},
|
||||
'APP_NUMBER' => 1
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AppNotes::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class AppNotesFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'APP_UID' => G::generateUniqueID(),
|
||||
'APP_NUMBER' => $faker->unique()->numberBetween(5000),
|
||||
'APP_NUMBER' => $this->faker->unique()->numberBetween(5000),
|
||||
'USR_UID' => G::generateUniqueID(),
|
||||
'NOTE_DATE' => $faker->dateTime(),
|
||||
'NOTE_CONTENT' => $faker->sentence(3),
|
||||
'NOTE_DATE' => $this->faker->dateTime(),
|
||||
'NOTE_CONTENT' => $this->faker->sentence(3),
|
||||
'NOTE_TYPE' => 'USER',
|
||||
'NOTE_AVAILABILITY' => 'PUBLIC',
|
||||
'NOTE_ORIGIN_OBJ' => '',
|
||||
@@ -16,21 +29,26 @@ $factory->define(\ProcessMaker\Model\AppNotes::class, function (Faker $faker) {
|
||||
'NOTE_AFFECTED_OBJ2' => '',
|
||||
'NOTE_RECIPIENTS' => '',
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
// Create a case notes with the foreign keys
|
||||
$factory->state(\ProcessMaker\Model\AppNotes::class, 'foreign_keys', function (Faker $faker) {
|
||||
/**
|
||||
* 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 = factory(\ProcessMaker\Model\Application::class)->create();
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$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' => $faker->dateTime(),
|
||||
'NOTE_CONTENT' => $faker->sentence(3),
|
||||
'NOTE_DATE' => $this->faker->dateTime(),
|
||||
'NOTE_CONTENT' => $this->faker->sentence(3),
|
||||
'NOTE_TYPE' => 'USER',
|
||||
'NOTE_AVAILABILITY' => 'PUBLIC',
|
||||
'NOTE_ORIGIN_OBJ' => '',
|
||||
@@ -38,5 +56,8 @@ $factory->state(\ProcessMaker\Model\AppNotes::class, 'foreign_keys', function (F
|
||||
'NOTE_AFFECTED_OBJ2' => '',
|
||||
'NOTE_RECIPIENTS' => '',
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a APP_THREAD
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class AppThreadFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AppThread::class, function (Faker $faker) {
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'APP_UID' => G::generateUniqueID(),
|
||||
'APP_THREAD_INDEX' => $faker->unique()->numberBetween(1, 2000),
|
||||
'APP_THREAD_PARENT' => $faker->unique()->numberBetween(1, 2000),
|
||||
'APP_THREAD_STATUS' => $faker->randomElement(['OPEN', 'CLOSED']),
|
||||
'DEL_INDEX' => $faker->unique()->numberBetween(1, 2000)
|
||||
'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
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AppTimeoutAction::class, function (Faker $faker) {
|
||||
$index = $faker->unique()->numberBetween(20);
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class AppTimeoutActionFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* 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' => $faker->dateTime()
|
||||
'EXECUTION_DATE' => $this->faker->dateTime()
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Application::class, function(Faker $faker) {
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$appNumber = $faker->unique()->numberBetween(1000);
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ApplicationFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* 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 = $faker->lexify(str_repeat('?', rand(3, 5)) . ' ' . str_repeat('?', rand(3, 5)));
|
||||
$appTitle = $this->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_DESCRIPTION' => $this->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;
|
||||
'PRO_UID' => function () {
|
||||
return \ProcessMaker\Model\Process::factory()->create()->PRO_UID;
|
||||
},
|
||||
'APP_PROC_STATUS' => '',
|
||||
'APP_PROC_CODE' => '',
|
||||
@@ -23,26 +36,31 @@ $factory->define(\ProcessMaker\Model\Application::class, function(Faker $faker)
|
||||
'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_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])
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
// Create a delegation with the foreign keys
|
||||
$factory->state(\ProcessMaker\Model\Application::class, 'foreign_keys', function (Faker $faker) {
|
||||
/**
|
||||
* Create a delegation with the foreign keys
|
||||
* @return type
|
||||
*/
|
||||
public function foreign_keys()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// 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);
|
||||
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||
$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 = $faker->lexify(str_repeat('?', rand(3, 5)) . ' ' . str_repeat('?', rand(3, 5)));
|
||||
$appTitle = $this->faker->lexify(str_repeat('?', rand(3, 5)) . ' ' . str_repeat('?', rand(3, 5)));
|
||||
|
||||
$statuses = ['DRAFT', 'TO_DO', 'COMPLETED', 'CANCELLED'];
|
||||
$status = $faker->randomElement($statuses);
|
||||
$status = $this->faker->randomElement($statuses);
|
||||
$statusId = array_search($status, $statuses) + 1;
|
||||
|
||||
return [
|
||||
@@ -59,89 +77,157 @@ $factory->state(\ProcessMaker\Model\Application::class, 'foreign_keys', function
|
||||
'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_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, 'web_entry', function (Faker $faker) {
|
||||
$appNumber = $faker->unique()->numberBetween(5000);
|
||||
/**
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
||||
$factory->state(\ProcessMaker\Model\Application::class, 'todo', function (Faker $faker) {
|
||||
/**
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function todo()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
return [
|
||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
||||
'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, 'draft', 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 [
|
||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
||||
'APP_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||
'APP_STATUS_ID' => 1,
|
||||
'APP_STATUS' => 'DRAFT',
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_INIT_USER_ID' => $user->USR_ID,
|
||||
];
|
||||
});
|
||||
};
|
||||
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 paused()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
$user = \ProcessMaker\Model\User::factory()->create();
|
||||
|
||||
return [
|
||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
||||
'APP_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||
'APP_STATUS_ID' => 1,
|
||||
'APP_STATUS' => 'PAUSED',
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_INIT_USER_ID' => $user->USR_ID,
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
$factory->state(\ProcessMaker\Model\Application::class, 'completed', function (Faker $faker) {
|
||||
/**
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function completed()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
return [
|
||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
||||
'APP_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||
'APP_STATUS_ID' => 3,
|
||||
'APP_STATUS' => 'COMPLETED'
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
$factory->state(\ProcessMaker\Model\Application::class, 'canceled', function (Faker $faker) {
|
||||
/**
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function canceled()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
return [
|
||||
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
|
||||
'APP_NUMBER' => $this->faker->unique()->numberBetween(1000),
|
||||
'APP_STATUS_ID' => 4,
|
||||
'APP_STATUS' => 'CANCELLED'
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
$factory->state(\ProcessMaker\Model\Application::class, 'draft_minor_case', function (Faker $faker) {
|
||||
$caseNumber = $faker->unique()->numberBetween(1, 1000);
|
||||
/**
|
||||
*
|
||||
* @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' => $faker->dateTimeBetween('-2 year', '-1 year')
|
||||
'APP_UPDATE_DATE' => $this->faker->dateTimeBetween('-2 year', '-1 year')
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
$factory->state(\ProcessMaker\Model\Application::class, 'draft_major_case', function (Faker $faker) {
|
||||
$caseNumber = $faker->unique()->numberBetween(2000, 3000);
|
||||
/**
|
||||
*
|
||||
* @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' => $faker->dateTimeBetween('now', '+1 year')
|
||||
'APP_UPDATE_DATE' => $this->faker->dateTimeBetween('now', '+1 year')
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\BpmnDiagram::class, function(Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class BpmnDiagramFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'DIA_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
||||
'PRJ_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\BpmnProject::class)->create()->PRJ_UID;
|
||||
'DIA_UID' => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||
'PRJ_UID' => function () {
|
||||
return \ProcessMaker\Model\BpmnProject::factory()->create()->PRJ_UID;
|
||||
},
|
||||
'DIA_NAME' => $faker->name,
|
||||
'DIA_NAME' => $this->faker->name,
|
||||
'DIA_IS_CLOSABLE' => 0,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\BpmnEvent::class, function(Faker $faker) {
|
||||
$bpmnProcess = factory(\ProcessMaker\Model\BpmnProcess::class)->create();
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class BpmnEventFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$bpmnProcess = \ProcessMaker\Model\BpmnProcess::factory()->create();
|
||||
return [
|
||||
'EVN_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
||||
'EVN_UID' => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||
'PRJ_UID' => $bpmnProcess->PRJ_UID,
|
||||
'PRO_UID' => $bpmnProcess->PRO_UID,
|
||||
'EVN_NAME' => $faker->name,
|
||||
'EVN_NAME' => $this->faker->name,
|
||||
'EVN_TYPE' => 'START',
|
||||
'EVN_MARKER' => 'EMPTY',
|
||||
'EVN_IS_INTERRUPTING' => 1,
|
||||
@@ -29,4 +41,6 @@ $factory->define(\ProcessMaker\Model\BpmnEvent::class, function(Faker $faker) {
|
||||
'EVN_TIME_DURATION' => null,
|
||||
'EVN_BEHAVIOR' => 'THROW',
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\BpmnProcess::class, function(Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class BpmnProcessFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'PRO_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
||||
'PRJ_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\BpmnProject::class)->create()->PRJ_UID;
|
||||
'PRO_UID' => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||
'PRJ_UID' => function () {
|
||||
return \ProcessMaker\Model\BpmnProject::factory()->create()->PRJ_UID;
|
||||
},
|
||||
'DIA_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\BpmnDiagram::class)->create()->DIA_UID;
|
||||
'DIA_UID' => function () {
|
||||
return \ProcessMaker\Model\BpmnDiagram::factory()->create()->DIA_UID;
|
||||
},
|
||||
'PRO_NAME' => $faker->title,
|
||||
'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
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\BpmnProject::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class BpmnProjectFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
// Create user
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$user = \ProcessMaker\Model\User::factory()->create();
|
||||
// Create process
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
||||
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||
|
||||
return [
|
||||
'PRJ_UID' => G::generateUniqueID(),
|
||||
'PRJ_NAME' => $faker->sentence(5),
|
||||
'PRJ_DESCRIPTION' => $faker->text,
|
||||
'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' => $faker->dateTime(),
|
||||
'PRJ_UPDATE_DATE' => $faker->dateTime(),
|
||||
'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
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\CaseList::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class CaseListFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'CAL_ID' => $faker->unique()->numberBetween(1, 5000),
|
||||
'CAL_ID' => $this->faker->unique()->numberBetween(1, 5000),
|
||||
'CAL_TYPE' => 'inbox',
|
||||
'CAL_NAME' => $faker->title,
|
||||
'CAL_DESCRIPTION' => $faker->text,
|
||||
'CAL_NAME' => $this->faker->title,
|
||||
'CAL_DESCRIPTION' => $this->faker->text,
|
||||
'ADD_TAB_UID' => function () {
|
||||
$table = factory(\ProcessMaker\Model\AdditionalTables::class)->create();
|
||||
$table = \ProcessMaker\Model\AdditionalTables::factory()->create();
|
||||
return $table->ADD_TAB_UID;
|
||||
},
|
||||
'CAL_COLUMNS' => '[]',
|
||||
'USR_ID' => function () {
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$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' => $faker->dateTime(),
|
||||
'CAL_UPDATE_DATE' => $faker->dateTime()
|
||||
'CAL_CREATE_DATE' => $this->faker->dateTime(),
|
||||
'CAL_UPDATE_DATE' => $this->faker->dateTime()
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,27 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a configuration
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
use ProcessMaker\Model\Configuration;
|
||||
use ProcessMaker\Model\User;
|
||||
|
||||
$factory->define(Configuration::class, function(Faker $faker) {
|
||||
class ConfigurationFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'CFG_UID' => $faker->randomElement(['AUDIT_LOG', 'EE']),
|
||||
'CFG_UID' => $this->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) {
|
||||
/**
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function userPreferencesEmpty()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// Grab a user if random
|
||||
$users = User::all();
|
||||
if (!empty($users)) {
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
} else {
|
||||
$user = $users->random();
|
||||
}
|
||||
@@ -33,5 +50,8 @@ $factory->state(Configuration::class, 'userPreferencesEmpty', function (Faker $f
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'APP_UID' => '',
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,24 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Consolidated::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ConsolidatedFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
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
|
||||
$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();
|
||||
/**
|
||||
* 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
|
||||
/**
|
||||
* Model factory for a process
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class DbSourceFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\DbSource::class, function(Faker $faker) {
|
||||
|
||||
public function definition()
|
||||
{
|
||||
/**
|
||||
* @todo Determine if we need more base columns populated
|
||||
*/
|
||||
$dbName = $faker->word;
|
||||
$dbName = $this->faker->word;
|
||||
return [
|
||||
'DBS_UID' => G::generateUniqueID(),
|
||||
'PRO_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\Process::class)->create()->PRO_UID;
|
||||
'PRO_UID' => function () {
|
||||
return \ProcessMaker\Model\Process::factory()->create()->PRO_UID;
|
||||
},
|
||||
'DBS_TYPE' => 'mysql',
|
||||
'DBS_SERVER' => $faker->localIpv4,
|
||||
'DBS_DATABASE_NAME' => $faker->word,
|
||||
'DBS_USERNAME' => $faker->userName,
|
||||
'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( $faker->password, $dbName, false, false) . "_2NnV3ujj3w",
|
||||
'DBS_PORT' => $faker->numberBetween(1000, 9000),
|
||||
'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,11 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Department::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class DepartmentFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'DEP_UID' => G::generateUniqueID(),
|
||||
'DEP_TITLE' => $faker->sentence(2),
|
||||
'DEP_TITLE' => $this->faker->sentence(2),
|
||||
'DEP_PARENT' => '',
|
||||
'DEP_MANAGER' => '',
|
||||
'DEP_LOCATION' => 0,
|
||||
@@ -13,4 +26,6 @@ $factory->define(\ProcessMaker\Model\Department::class, function (Faker $faker)
|
||||
'DEP_REF_CODE' => '',
|
||||
'DEP_LDAP_DN' => '',
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Documents::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class DocumentsFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$types = ['INPUT', 'OUTPUT', 'ATTACHED'];
|
||||
$type = $faker->randomElement($types);
|
||||
$type = $this->faker->randomElement($types);
|
||||
return [
|
||||
'APP_DOC_UID' => G::generateUniqueID(),
|
||||
'APP_DOC_FILENAME' => 'image.png',
|
||||
@@ -16,20 +29,25 @@ $factory->define(\ProcessMaker\Model\Documents::class, function (Faker $faker) {
|
||||
'DOC_UID' => G::generateUniqueID(),
|
||||
'USR_UID' => G::generateUniqueID(),
|
||||
'APP_DOC_TYPE' => $type,
|
||||
'APP_DOC_CREATE_DATE' => $faker->date(),
|
||||
'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' => $faker->date(),
|
||||
'APP_DOC_STATUS_DATE' => $this->faker->date(),
|
||||
'APP_DOC_FIELDNAME' => '',
|
||||
'APP_DOC_DRIVE_DOWNLOAD' => '',
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
// Create a document related to the case notes
|
||||
$factory->state(\ProcessMaker\Model\Documents::class, 'case_notes', function (Faker $faker) {
|
||||
/**
|
||||
* 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',
|
||||
@@ -41,14 +59,18 @@ $factory->state(\ProcessMaker\Model\Documents::class, 'case_notes', function (Fa
|
||||
'DOC_UID' => G::generateUniqueID(),
|
||||
'USR_UID' => G::generateUniqueID(),
|
||||
'APP_DOC_TYPE' => 'CASE_NOTE',
|
||||
'APP_DOC_CREATE_DATE' => $faker->date(),
|
||||
'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' => $faker->date(),
|
||||
'APP_DOC_STATUS_DATE' => $this->faker->date(),
|
||||
'APP_DOC_FIELDNAME' => '',
|
||||
'APP_DOC_DRIVE_DOWNLOAD' => '',
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Model factory for a dynaform.
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
use ProcessMaker\Model\Process;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Dynaform::class, function(Faker $faker) {
|
||||
$date = $faker->dateTime();
|
||||
class DynaformFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$date = $this->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();
|
||||
'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',
|
||||
@@ -23,16 +33,22 @@ $factory->define(\ProcessMaker\Model\Dynaform::class, function(Faker $faker) {
|
||||
'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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a dynaform with the foreign keys
|
||||
* @return type
|
||||
*/
|
||||
public function foreign_keys()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
$date = $this->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();
|
||||
'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',
|
||||
@@ -42,18 +58,24 @@ $factory->state(\ProcessMaker\Model\Dynaform::class, 'foreign_keys', function (F
|
||||
'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"]
|
||||
$factory->state(\ProcessMaker\Model\Dynaform::class, 'translations', function (Faker $faker) {
|
||||
$date = $faker->dateTime();
|
||||
/**
|
||||
* 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' => $faker->sentence(2),
|
||||
'DYN_DESCRIPTION' => $faker->sentence(5),
|
||||
'PRO_UID' => function() {
|
||||
$process = factory(Process::class)->create();
|
||||
'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',
|
||||
@@ -63,4 +85,8 @@ $factory->state(\ProcessMaker\Model\Dynaform::class, 'translations', function (F
|
||||
'DYN_VERSION' => 2,
|
||||
'DYN_UPDATE_DATE' => $date->format('Y-m-d H:i:s'),
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\ElementTaskRelation::class, function(Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ElementTaskRelationFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'ETR_UID' => G::generateUniqueID(),
|
||||
'PRJ_UID' => G::generateUniqueID(),
|
||||
@@ -10,4 +23,6 @@ $factory->define(\ProcessMaker\Model\ElementTaskRelation::class, function(Faker
|
||||
'ELEMENT_TYPE' => 'bpmnEvent',
|
||||
'TAS_UID' => G::generateUniqueID(),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\EmailEvent::class, function(Faker $faker) {
|
||||
$bpmnEvent = factory(\ProcessMaker\Model\BpmnEvent::class)->create();
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class EmailEventFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$bpmnEvent = \ProcessMaker\Model\BpmnEvent::factory()->create();
|
||||
return [
|
||||
'EMAIL_EVENT_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
||||
'EMAIL_EVENT_UID' => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||
'PRJ_UID' => $bpmnEvent->PRJ_UID,
|
||||
'EVN_UID' => $bpmnEvent->EVN_UID,
|
||||
'EMAIL_EVENT_FROM' => $faker->email,
|
||||
'EMAIL_EVENT_TO' => $faker->email,
|
||||
'EMAIL_EVENT_SUBJECT' => $faker->title,
|
||||
'PRF_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\ProcessFiles::class)->create()->PRF_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 factory(\ProcessMaker\Model\EmailServerModel::class)->create()->MESS_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,15 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
use ProcessMaker\Model\AdditionalTables;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Fields::class, function (Faker $faker) {
|
||||
class FieldsFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
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_NAME' => 'VAR_' . $this->faker->sentence(1),
|
||||
'FLD_DESCRIPTION' => $this->faker->sentence(2),
|
||||
'FLD_TYPE' => 'VARCHAR',
|
||||
'FLD_SIZE' => 255,
|
||||
'FLD_NULL' => 1,
|
||||
@@ -22,19 +35,24 @@ $factory->define(\ProcessMaker\Model\Fields::class, function (Faker $faker) {
|
||||
'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) {
|
||||
/**
|
||||
* 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 = factory(AdditionalTables::class)->create(['ADD_TAB_OFFLINE' => 1]);
|
||||
'ADD_TAB_UID' => function () {
|
||||
$table = AdditionalTables::factory()->create(['ADD_TAB_OFFLINE' => 1]);
|
||||
return $table->ADD_TAB_UID;
|
||||
},
|
||||
'FLD_INDEX' => 0,
|
||||
'FLD_NAME' => 'VAR_' . $faker->sentence(1),
|
||||
'FLD_DESCRIPTION' => $faker->sentence(2),
|
||||
'FLD_NAME' => 'VAR_' . $this->faker->sentence(1),
|
||||
'FLD_DESCRIPTION' => $this->faker->sentence(2),
|
||||
'FLD_TYPE' => 'VARCHAR',
|
||||
'FLD_SIZE' => 255,
|
||||
'FLD_NULL' => 1,
|
||||
@@ -47,4 +65,8 @@ $factory->state(\ProcessMaker\Model\Fields::class, 'foreign_keys', function (Fak
|
||||
'FLD_DYN_UID' => '',
|
||||
'FLD_FILTER' => 0,
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,25 +1,45 @@
|
||||
<?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;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class GroupUserFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'GRP_UID' => G::generateUniqueID(),
|
||||
'GRP_ID' => $faker->unique()->numberBetween(1, 2000),
|
||||
'GRP_ID' => $this->faker->unique()->numberBetween(1, 2000),
|
||||
'USR_UID' => G::generateUniqueID()
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
// Create columns from a table with the foreign keys
|
||||
$factory->state(\ProcessMaker\Model\GroupUser::class, 'foreign_keys', function (Faker $faker) {
|
||||
/**
|
||||
* 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 = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$group = factory(\ProcessMaker\Model\Groupwf::class)->create();
|
||||
$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
|
||||
/**
|
||||
* Model factory for a groups
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Groupwf::class, function(Faker $faker) {
|
||||
namespace Database\Factories;
|
||||
|
||||
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' => $faker->unique()->numberBetween(2000),
|
||||
'GRP_TITLE' => $faker->sentence(2),
|
||||
'GRP_ID' => $this->faker->unique()->numberBetween(2000),
|
||||
'GRP_TITLE' => $this->faker->sentence(2),
|
||||
'GRP_STATUS' => 'ACTIVE',
|
||||
'GRP_LDAP_DN' => '',
|
||||
'GRP_UX' => 'NORMAL',
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +1,31 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Model factory for a input document.
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
use ProcessMaker\Model\InputDocument;
|
||||
use ProcessMaker\Model\Process;
|
||||
|
||||
$factory->define(InputDocument::class, function(Faker $faker) {
|
||||
class InputDocumentFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'INP_DOC_UID' => G::generateUniqueID(),
|
||||
'PRO_UID' => function() {
|
||||
$process = factory(Process::class)->create();
|
||||
'PRO_UID' => function () {
|
||||
$process = Process::factory()->create();
|
||||
return $process->PRO_UID;
|
||||
},
|
||||
'INP_DOC_TITLE' => $faker->sentence(2),
|
||||
'INP_DOC_DESCRIPTION' => $faker->sentence(10),
|
||||
'INP_DOC_TITLE' => $this->faker->sentence(2),
|
||||
'INP_DOC_DESCRIPTION' => $this->faker->sentence(10),
|
||||
'INP_DOC_FORM_NEEDED' => 'VIRTUAL',
|
||||
'INP_DOC_ORIGINAL' => 'ORIGINAL',
|
||||
'INP_DOC_PUBLISHED' => 'PRIVATE',
|
||||
@@ -26,4 +36,6 @@ $factory->define(InputDocument::class, function(Faker $faker) {
|
||||
'INP_DOC_MAX_FILESIZE' => 0,
|
||||
'INP_DOC_MAX_FILESIZE_UNIT' => 'KB'
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\LicenseManager::class, function(Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class LicenseManagerFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
"LICENSE_UID" => $faker->regexify("/[a-zA-Z]{32}/"),
|
||||
"LICENSE_USER" => $faker->name,
|
||||
"LICENSE_UID" => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||
"LICENSE_USER" => $this->faker->name,
|
||||
"LICENSE_START" => 0,
|
||||
"LICENSE_END" => 0,
|
||||
"LICENSE_SPAN" => 0,
|
||||
@@ -15,4 +27,6 @@ $factory->define(\ProcessMaker\Model\LicenseManager::class, function(Faker $fake
|
||||
"LICENSE_WORKSPACE" => '',
|
||||
"LICENSE_TYPE" => 'ONPREMISE'
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,41 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a list unassigned
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
use ProcessMaker\Model\Application;
|
||||
use ProcessMaker\Model\Process;
|
||||
use ProcessMaker\Model\Task;
|
||||
use ProcessMaker\Model\User;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\ListUnassigned::class, function(Faker $faker) {
|
||||
class ListUnassignedFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
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(),
|
||||
'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' => $faker->dateTime(),
|
||||
'DEL_DUE_DATE' => $faker->dateTime(),
|
||||
'DEL_DELEGATE_DATE' => $this->faker->dateTime(),
|
||||
'DEL_DUE_DATE' => $this->faker->dateTime(),
|
||||
'DEL_PRIORITY' => 3,
|
||||
'PRO_ID' => $faker->unique()->numberBetween(1000),
|
||||
'TAS_ID' => $faker->unique()->numberBetween(1000),
|
||||
'PRO_ID' => $this->faker->unique()->numberBetween(1000),
|
||||
'TAS_ID' => $this->faker->unique()->numberBetween(1000),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
$factory->state(\ProcessMaker\Model\ListUnassigned::class, 'foreign_keys', function (Faker $faker) {
|
||||
$process = factory(Process::class)->create();
|
||||
$app = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$user = factory(User::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
/**
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function foreign_keys()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
$process = Process::factory()->create();
|
||||
$app = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$user = User::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE', // Define a self-service type
|
||||
'TAS_GROUP_VARIABLE' => '',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
@@ -53,13 +70,16 @@ $factory->state(\ProcessMaker\Model\ListUnassigned::class, 'foreign_keys', funct
|
||||
'DEL_PREVIOUS_USR_USERNAME' => $user->USR_USERNAME,
|
||||
'DEL_PREVIOUS_USR_FIRSTNAME' => $user->USR_FIRSTNAME,
|
||||
'DEL_PREVIOUS_USR_LASTNAME' => $user->USR_LASTNAME,
|
||||
'APP_UPDATE_DATE' => $faker->dateTime(),
|
||||
'APP_UPDATE_DATE' => $this->faker->dateTime(),
|
||||
'DEL_PREVIOUS_USR_UID' => G::generateUniqueID(),
|
||||
'DEL_DELEGATE_DATE' => $faker->dateTime(),
|
||||
'DEL_DUE_DATE' => $faker->dateTime(),
|
||||
'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
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\OauthClients::class, function(Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class OauthClientsFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
"CLIENT_ID" => $faker->unique()->word(),
|
||||
"CLIENT_SECRET" => $faker->regexify("/[a-zA-Z]{6}/"),
|
||||
"CLIENT_NAME" => $faker->regexify("/[a-zA-Z]{6}/"),
|
||||
"CLIENT_DESCRIPTION" => $faker->text,
|
||||
"CLIENT_WEBSITE" => $faker->url,
|
||||
"REDIRECT_URI" => $faker->url,
|
||||
"USR_UID" => function() {
|
||||
return factory(\ProcessMaker\Model\User::class)->create()->USR_UID;
|
||||
"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,11 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Model factory for a process
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\ObjectPermission::class, function(Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ObjectPermissionFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'OP_UID' => G::generateUniqueID(),
|
||||
'PRO_UID' => '',
|
||||
@@ -19,4 +29,6 @@ $factory->define(\ProcessMaker\Model\ObjectPermission::class, function(Faker $fa
|
||||
'OP_ACTION' => 'VIEW',
|
||||
'OP_CASE_STATUS' => 'ALL'
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,23 +1,33 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Model factory for a output document.
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
use ProcessMaker\Model\OutputDocument;
|
||||
use ProcessMaker\Model\Process;
|
||||
|
||||
$factory->define(OutputDocument::class, function(Faker $faker) {
|
||||
$date = $faker->dateTime();
|
||||
class OutputDocumentFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$date = $this->faker->dateTime();
|
||||
return [
|
||||
'OUT_DOC_UID' => G::generateUniqueID(),
|
||||
'OUT_DOC_ID' => $faker->unique()->numberBetween(1, 10000),
|
||||
'OUT_DOC_TITLE' => $faker->sentence(2),
|
||||
'OUT_DOC_DESCRIPTION' => $faker->sentence(10),
|
||||
'OUT_DOC_FILENAME' => $faker->sentence(2),
|
||||
'OUT_DOC_ID' => $this->faker->unique()->numberBetween(1, 10000),
|
||||
'OUT_DOC_TITLE' => $this->faker->sentence(2),
|
||||
'OUT_DOC_DESCRIPTION' => $this->faker->sentence(10),
|
||||
'OUT_DOC_FILENAME' => $this->faker->sentence(2),
|
||||
'OUT_DOC_TEMPLATE' => '',
|
||||
'PRO_UID' => function() {
|
||||
$process = factory(Process::class)->create();
|
||||
'PRO_UID' => function () {
|
||||
$process = Process::factory()->create();
|
||||
return $process->PRO_UID;
|
||||
},
|
||||
'OUT_DOC_REPORT_GENERATOR' => 'TCPDF',
|
||||
@@ -42,4 +52,6 @@ $factory->define(OutputDocument::class, function(Faker $faker) {
|
||||
'OUT_DOC_HEADER' => null,
|
||||
'OUT_DOC_FOOTER' => null
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Model factory for a process category
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ProcessCategoryFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\ProcessCategory::class, function (Faker $faker) {
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'CATEGORY_UID' => G::generateUniqueID(),
|
||||
'CATEGORY_ID' => $faker->unique()->numberBetween(1000),
|
||||
'CATEGORY_ID' => $this->faker->unique()->numberBetween(1000),
|
||||
'CATEGORY_PARENT' => '',
|
||||
'CATEGORY_NAME' => $faker->sentence(5),
|
||||
'CATEGORY_NAME' => $this->faker->sentence(5),
|
||||
'CATEGORY_ICON' => '',
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,26 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Model factory for a process
|
||||
*/
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Faker\Generator as Faker;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Process::class, function (Faker $faker) {
|
||||
class ProcessFactory extends Factory
|
||||
{
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'PRO_UID' => G::generateUniqueID(),
|
||||
'PRO_ID' => $faker->unique()->numberBetween(2000),
|
||||
'PRO_TITLE' => $faker->sentence(3),
|
||||
'PRO_DESCRIPTION' => $faker->paragraph(3),
|
||||
'PRO_ID' => $this->faker->unique()->numberBetween(2000),
|
||||
'PRO_TITLE' => $this->faker->sentence(3),
|
||||
'PRO_DESCRIPTION' => $this->faker->paragraph(3),
|
||||
'PRO_PARENT' => G::generateUniqueID(),
|
||||
'PRO_STATUS' => 'ACTIVE',
|
||||
'PRO_STATUS_ID' => 1,
|
||||
'PRO_TYPE' => 'NORMAL',
|
||||
'PRO_ASSIGNMENT' => 'FALSE',
|
||||
'PRO_TYPE_PROCESS' => 'PUBLIC',
|
||||
'PRO_UPDATE_DATE' => $faker->dateTime(),
|
||||
'PRO_CREATE_DATE' => $faker->dateTime(),
|
||||
'PRO_UPDATE_DATE' => $this->faker->dateTime(),
|
||||
'PRO_CREATE_DATE' => $this->faker->dateTime(),
|
||||
'PRO_CREATE_USER' => '00000000000000000000000000000001',
|
||||
'PRO_DEBUG' => 0,
|
||||
'PRO_DYNAFORMS' => serialize([]),
|
||||
@@ -28,30 +32,35 @@ $factory->define(\ProcessMaker\Model\Process::class, function (Faker $faker) {
|
||||
'PRO_ACTION_DONE' => serialize([]),
|
||||
'PRO_SUBPROCESS' => 0,
|
||||
'PRO_CATEGORY' => function () {
|
||||
return factory(\ProcessMaker\Model\ProcessCategory::class)->create()->CATEGORY_UID;
|
||||
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
|
||||
* @return type
|
||||
*/
|
||||
public function foreign_keys()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// Create user
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$user = \ProcessMaker\Model\User::factory()->create();
|
||||
|
||||
return [
|
||||
'PRO_UID' => G::generateUniqueID(),
|
||||
'PRO_ID' => $faker->unique()->numberBetween(1000),
|
||||
'PRO_TITLE' => $faker->sentence(3),
|
||||
'PRO_DESCRIPTION' => $faker->paragraph(3),
|
||||
'PRO_ID' => $this->faker->unique()->numberBetween(1000),
|
||||
'PRO_TITLE' => $this->faker->sentence(3),
|
||||
'PRO_DESCRIPTION' => $this->faker->paragraph(3),
|
||||
'PRO_PARENT' => G::generateUniqueID(),
|
||||
'PRO_STATUS' => 'ACTIVE',
|
||||
'PRO_STATUS_ID' => 1,
|
||||
'PRO_TYPE' => 'NORMAL',
|
||||
'PRO_ASSIGNMENT' => 'FALSE',
|
||||
'PRO_TYPE_PROCESS' => 'PUBLIC',
|
||||
'PRO_UPDATE_DATE' => $faker->dateTime(),
|
||||
'PRO_CREATE_DATE' => $faker->dateTime(),
|
||||
'PRO_UPDATE_DATE' => $this->faker->dateTime(),
|
||||
'PRO_CREATE_DATE' => $this->faker->dateTime(),
|
||||
'PRO_CREATE_USER' => $user->USR_UID,
|
||||
'PRO_DEBUG' => 0,
|
||||
'PRO_DYNAFORMS' => serialize([]),
|
||||
@@ -59,7 +68,10 @@ $factory->state(\ProcessMaker\Model\Process::class, 'foreign_keys', function (Fa
|
||||
'PRO_ACTION_DONE' => serialize([]),
|
||||
'PRO_SUBPROCESS' => 0,
|
||||
'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,8 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\ProcessFiles::class, function(Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ProcessFilesFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'PRF_UID' => G::generateUniqueID(),
|
||||
'PRO_UID' => '',
|
||||
@@ -11,7 +24,9 @@ $factory->define(\ProcessMaker\Model\ProcessFiles::class, function(Faker $faker)
|
||||
'PRF_PATH' => 'dummy_path',
|
||||
'PRF_TYPE' => '',
|
||||
'PRF_EDITABLE' => 1,
|
||||
'PRF_CREATE_DATE' => $faker->dateTime(),
|
||||
'PRF_UPDATE_DATE' => $faker->dateTime(),
|
||||
'PRF_CREATE_DATE' => $this->faker->dateTime(),
|
||||
'PRF_UPDATE_DATE' => $this->faker->dateTime(),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\ProcessUser::class, function(Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ProcessUserFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
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
|
||||
$factory->state(\ProcessMaker\Model\ProcessUser::class, 'foreign_keys', function (Faker $faker) {
|
||||
/**
|
||||
* Create a process with the foreign keys
|
||||
* @return type
|
||||
*/
|
||||
public function foreign_keys()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// Create user
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
||||
$user = \ProcessMaker\Model\User::factory()->create();
|
||||
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||
|
||||
return [
|
||||
'PU_UID' => G::generateUniqueID(),
|
||||
@@ -23,4 +41,8 @@ $factory->state(\ProcessMaker\Model\ProcessUser::class, 'foreign_keys', function
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'PU_TYPE' => 'SUPERVISOR'
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
use ProcessMaker\Model\ProcessVariables;
|
||||
|
||||
$factory->define(ProcessVariables::class, function (Faker $faker) {
|
||||
class ProcessVariablesFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'VAR_UID' => G::generateUniqueID(),
|
||||
'PRO_ID' => G::generateUniqueID(),
|
||||
'PRJ_UID' => G::generateUniqueID(),
|
||||
'VAR_NAME' => $faker->word,
|
||||
'VAR_NAME' => $this->faker->word,
|
||||
'VAR_FIELD_TYPE' => G::generateUniqueID(),
|
||||
'VAR_FIELD_TYPE_ID' => G::generateUniqueID(),
|
||||
'VAR_FIELD_SIZE' => 10,
|
||||
@@ -20,21 +33,26 @@ $factory->define(ProcessVariables::class, function (Faker $faker) {
|
||||
'VAR_ACCEPTED_VALUES' => '[]',
|
||||
'INP_DOC_UID' => ''
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
// Create a processVariables with the foreign keys
|
||||
$factory->state(ProcessVariables::class, 'foreign_keys', function (Faker $faker) {
|
||||
/**
|
||||
* Create a processVariables with the foreign keys
|
||||
* @return type
|
||||
*/
|
||||
public function foreign_keys()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
$types = ['string', 'integer', 'float', 'boolean', 'datetime', 'grid', 'array', 'file', 'multiplefile', 'object'];
|
||||
$varType = $faker->randomElement($types);
|
||||
$varType = $this->faker->randomElement($types);
|
||||
$varTypeId = array_search($varType, $types) + 1;
|
||||
// Create values in the foreign key relations
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
||||
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||
|
||||
return [
|
||||
'VAR_UID' => G::generateUniqueID(),
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'PRJ_UID' => $process->PRO_UID,
|
||||
'VAR_NAME' => $faker->word,
|
||||
'VAR_NAME' => $this->faker->word,
|
||||
'VAR_FIELD_TYPE' => $varType,
|
||||
'VAR_FIELD_TYPE_ID' => $varTypeId,
|
||||
'VAR_FIELD_SIZE' => 10,
|
||||
@@ -46,4 +64,8 @@ $factory->state(ProcessVariables::class, 'foreign_keys', function (Faker $faker)
|
||||
'VAR_ACCEPTED_VALUES' => '[]',
|
||||
'INP_DOC_UID' => ''
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,22 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\RbacAuthenticationSource::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RbacAuthenticationSourceFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'AUTH_SOURCE_UID' => G::generateUniqueID(),
|
||||
'AUTH_SOURCE_NAME' => $faker->title,
|
||||
'AUTH_SOURCE_NAME' => $this->faker->title,
|
||||
'AUTH_SOURCE_PROVIDER' => 'ldapAdvanced',
|
||||
'AUTH_SOURCE_SERVER_NAME' => $faker->domainName,
|
||||
'AUTH_SOURCE_PORT' => $faker->numberBetween(100, 1000),
|
||||
'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' => $faker->userName,
|
||||
'AUTH_SOURCE_PASSWORD' => $faker->password,
|
||||
'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
|
||||
/**
|
||||
* Model factory for a role
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\RbacRoles::class, function(Faker $faker) {
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RbacRolesFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* 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($faker->word),
|
||||
'ROL_CREATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
||||
'ROL_UPDATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
||||
'ROL_STATUS' => $faker->randomElement([0, 1])
|
||||
'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
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\RbacUsers::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RbacUsersFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'USR_UID' => G::generateUniqueID(),
|
||||
'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_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 a deleted user
|
||||
$factory->state(\ProcessMaker\Model\RbacUsers::class, 'deleted', function () {
|
||||
/**
|
||||
* Create a deleted user
|
||||
* @return type
|
||||
*/
|
||||
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
|
||||
$factory->state(\ProcessMaker\Model\RbacUsers::class, 'active', function () {
|
||||
/**
|
||||
* 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
|
||||
$factory->state(\ProcessMaker\Model\RbacUsers::class, 'inactive', function () {
|
||||
/**
|
||||
* 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
|
||||
/**
|
||||
* Model factory for a role assigned to an user
|
||||
*/
|
||||
|
||||
$factory->define(\ProcessMaker\Model\RbacUsersRoles::class, function() {
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RbacUsersRolesFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'USR_UID' => function() {
|
||||
$rbacUser = factory(\ProcessMaker\Model\RbacUsers::class)->create();
|
||||
'USR_UID' => function () {
|
||||
$rbacUser = \ProcessMaker\Model\RbacUsers::factory()->create();
|
||||
return $rbacUser->USR_UID;
|
||||
},
|
||||
'ROL_UID' => function() {
|
||||
$rbacRole = factory(\ProcessMaker\Model\RbacRoles::class)->create();
|
||||
'ROL_UID' => function () {
|
||||
$rbacRole = \ProcessMaker\Model\RbacRoles::factory()->create();
|
||||
return $rbacRole->ROL_UID;
|
||||
}
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a process
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Route::class, function(Faker $faker) {
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RouteFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'PRO_UID' => function() {
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
||||
'PRO_UID' => function () {
|
||||
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||
return $process->PRO_UID;
|
||||
},
|
||||
'TAS_UID' => function() {
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
||||
'TAS_UID' => function () {
|
||||
$task = \ProcessMaker\Model\Task::factory()->create();
|
||||
return $task->TAS_UID;
|
||||
},
|
||||
'ROU_UID' => G::generateUniqueID(),
|
||||
@@ -19,4 +30,6 @@ $factory->define(\ProcessMaker\Model\Route::class, function(Faker $faker) {
|
||||
'ROU_CASE' => 1,
|
||||
'ROU_TYPE' => 'SEQUENTIAL'
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Step::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class StepFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'STEP_UID' => G::generateUniqueID(),
|
||||
'PRO_UID' => G::generateUniqueID(),
|
||||
@@ -13,4 +26,6 @@ $factory->define(\ProcessMaker\Model\Step::class, function (Faker $faker) {
|
||||
'STEP_POSITION' => 0,
|
||||
'STEP_MODE' => 'EDIT'
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\StepTrigger::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class StepTriggerFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'STEP_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
||||
'TAS_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\Task::class)->create()->TAS_UID;
|
||||
'STEP_UID' => $this->faker->regexify("/[a-zA-Z]{32}/"),
|
||||
'TAS_UID' => function () {
|
||||
return \ProcessMaker\Model\Task::factory()->create()->TAS_UID;
|
||||
},
|
||||
'TRI_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\Triggers::class)->create()->TRI_UID;
|
||||
'TRI_UID' => function () {
|
||||
return \ProcessMaker\Model\Triggers::factory()->create()->TRI_UID;
|
||||
},
|
||||
'ST_TYPE' => 'BEFORE',
|
||||
'ST_CONDITION' => '',
|
||||
'ST_POSITION' => 1,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\SubApplication::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class SubApplicationFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'APP_UID' => G::generateUniqueID(),
|
||||
'APP_PARENT' => G::generateUniqueID(),
|
||||
@@ -11,7 +24,9 @@ $factory->define(\ProcessMaker\Model\SubApplication::class, function (Faker $fak
|
||||
'SA_STATUS' => 'ACTIVE',
|
||||
'SA_VALUES_OUT' => 'a:0:{}',
|
||||
'SA_VALUES_IN' => 'a:0:{}',
|
||||
'SA_INIT_DATE' => $faker->dateTime(),
|
||||
'SA_FINISH_DATE' => $faker->dateTime(),
|
||||
'SA_INIT_DATE' => $this->faker->dateTime(),
|
||||
'SA_FINISH_DATE' => $this->faker->dateTime(),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
<?php
|
||||
|
||||
$factory->define(\ProcessMaker\Model\SubProcess::class, function () {
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class SubProcessFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'SP_UID' => G::generateUniqueID(),
|
||||
'PRO_UID' => G::generateUniqueID(),
|
||||
@@ -15,4 +30,6 @@ $factory->define(\ProcessMaker\Model\SubProcess::class, function () {
|
||||
'SP_VARIABLES_IN' => '',
|
||||
'SP_GRID_IN' => ''
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,23 +1,33 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Model factory for a process
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class TaskFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Task::class, function(Faker $faker) {
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
||||
public function definition()
|
||||
{
|
||||
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||
return [
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_UID' => G::generateUniqueID(),
|
||||
'TAS_TITLE' => $faker->sentence(2),
|
||||
'TAS_TITLE' => $this->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_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',
|
||||
@@ -33,22 +43,27 @@ $factory->define(\ProcessMaker\Model\Task::class, function(Faker $faker) {
|
||||
'TAS_SEND_LAST_EMAIL' => 'FALSE',
|
||||
'TAS_SELFSERVICE_TIMEOUT' => 0,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
// Create a task with the foreign keys
|
||||
$factory->state(\ProcessMaker\Model\Task::class, 'foreign_keys', function (Faker $faker) {
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
||||
/**
|
||||
* 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' => $faker->sentence(2),
|
||||
'TAS_TITLE' => $this->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_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',
|
||||
@@ -64,27 +79,38 @@ $factory->state(\ProcessMaker\Model\Task::class, 'foreign_keys', function (Faker
|
||||
'TAS_SEND_LAST_EMAIL' => 'FALSE',
|
||||
'TAS_SELFSERVICE_TIMEOUT' => 0,
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
// Create a task related with the self-service timeout execution
|
||||
$factory->state(\ProcessMaker\Model\Task::class, 'sef_service_timeout', function (Faker $faker) {
|
||||
$timeUnit = $faker->randomElement(['MINUTES', 'HOURS', 'DAYS']);
|
||||
$execution = $faker->randomElement(['EVERY_TIME', 'ONCE']);
|
||||
/**
|
||||
* 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' => $faker->unique()->numberBetween(1, 200000),
|
||||
'TAS_TITLE' => $faker->sentence(2),
|
||||
'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' => $faker->unique()->numberBetween(1, 24),
|
||||
'TAS_SELFSERVICE_TIME' => $this->faker->unique()->numberBetween(1, 24),
|
||||
'TAS_SELFSERVICE_TIME_UNIT' => $timeUnit,
|
||||
'TAS_SELFSERVICE_TRIGGER_UID' => function() {
|
||||
return $trigger = factory(\ProcessMaker\Model\Triggers::class)->create()->TRI_UID;
|
||||
'TAS_SELFSERVICE_TRIGGER_UID' => function () {
|
||||
return $trigger = \ProcessMaker\Model\Triggers::factory()->create()->TRI_UID;
|
||||
},
|
||||
'TAS_SELFSERVICE_EXECUTION' => $execution,
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Model factory for a task scheduler
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\TaskScheduler::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class TaskSchedulerFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'id' => $faker->unique()->numberBetween(5000),
|
||||
'title' => $faker->title,
|
||||
'startingTime' => $faker->dateTime(),
|
||||
'endingTime' => $faker->dateTime(),
|
||||
'id' => $this->faker->unique()->numberBetween(5000),
|
||||
'title' => $this->faker->title,
|
||||
'startingTime' => $this->faker->dateTime(),
|
||||
'endingTime' => $this->faker->dateTime(),
|
||||
'everyOn' => "",
|
||||
'interval' => "",
|
||||
'description' => "",
|
||||
@@ -21,7 +30,9 @@ $factory->define(\ProcessMaker\Model\TaskScheduler::class, function (Faker $fake
|
||||
'system' => "",
|
||||
'timezone' => "",
|
||||
'enable' => "",
|
||||
'creation_date' => $faker->dateTime(),
|
||||
'last_update' => $faker->dateTime()
|
||||
'creation_date' => $this->faker->dateTime(),
|
||||
'last_update' => $this->faker->dateTime()
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,70 +1,106 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\TaskUser::class, function(Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class TaskUserFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'TAS_UID' => function() {
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
||||
'TAS_UID' => function () {
|
||||
$task = \ProcessMaker\Model\Task::factory()->create();
|
||||
return $task->TAS_UID;
|
||||
},
|
||||
'TU_TYPE' => 1,
|
||||
'TU_RELATION' => 1
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
// Create a delegation with the foreign keys
|
||||
$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();
|
||||
/**
|
||||
* Create a delegation with the foreign keys.
|
||||
*/
|
||||
public function foreign_keys()
|
||||
{
|
||||
$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_TYPE' => 1,
|
||||
'TU_RELATION' => 1
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
$factory->state(\ProcessMaker\Model\TaskUser::class, 'normal_assigment_user', function (Faker $faker) {
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
||||
public function normal_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' => 1,
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
$factory->state(\ProcessMaker\Model\TaskUser::class, 'normal_assigment_group', function (Faker $faker) {
|
||||
$group = factory(\ProcessMaker\Model\Groupwf::class)->create();
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
||||
public function normal_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' => 1,
|
||||
];
|
||||
});
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
$factory->state(\ProcessMaker\Model\TaskUser::class, 'adhoc_assigment_user', function (Faker $faker) {
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
||||
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);
|
||||
}
|
||||
|
||||
$factory->state(\ProcessMaker\Model\TaskUser::class, 'adhoc_assigment_group', function (Faker $faker) {
|
||||
$group = factory(\ProcessMaker\Model\Groupwf::class)->create();
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create();
|
||||
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
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
use ProcessMaker\Model\Triggers;
|
||||
|
||||
$factory->define(Triggers::class, function (Faker $faker) {
|
||||
class TriggersFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'TRI_UID' => $faker->regexify("/[a-zA-Z]{32}/"),
|
||||
'TRI_TITLE' => $faker->sentence(5),
|
||||
'TRI_DESCRIPTION' => $faker->text,
|
||||
'PRO_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\Process::class)->create()->PRO_UID;
|
||||
'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
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\User::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'USR_UID' => G::generateUniqueID(),
|
||||
'USR_USERNAME' => $faker->unique()->userName,
|
||||
'USR_PASSWORD' => $faker->password,
|
||||
'USR_FIRSTNAME' => $faker->firstName,
|
||||
'USR_LASTNAME' => $faker->lastName,
|
||||
'USR_EMAIL' => $faker->unique()->email,
|
||||
'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' => $faker->randomElement(['PROCESSMAKER_ADMIN', 'PROCESSMAKER_OPERATOR']),
|
||||
'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,8 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\UserReporting::class, function (Faker $faker) {
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class UserReportingFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'USR_UID' => G::generateUniqueID(),
|
||||
'TAS_UID' => G::generateUniqueID(),
|
||||
@@ -10,4 +23,6 @@ $factory->define(\ProcessMaker\Model\UserReporting::class, function (Faker $fake
|
||||
'MONTH' => 12,
|
||||
'YEAR' => 2020,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* pakeTest.php
|
||||
* @package gulliver.bin.tasks
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
pake_desc('launch unit tests');
|
||||
pake_task('test-unit', 'project_exists');
|
||||
|
||||
pake_desc('launch functional tests for an application');
|
||||
pake_task('test-functional', 'project_exists');
|
||||
|
||||
pake_desc('launch all tests');
|
||||
pake_task('test-all', 'project_exists');
|
||||
|
||||
/**
|
||||
* Function run_test_all
|
||||
* access public
|
||||
*/
|
||||
|
||||
function run_test_all($task, $args)
|
||||
{
|
||||
require_once(sfConfig::get('sf_symfony_lib_dir').'/lime/lime.php');
|
||||
|
||||
$h = new lime_harness(new lime_output_color());
|
||||
$h->base_dir = sfConfig::get('sf_test_dir');
|
||||
|
||||
// register all tests
|
||||
$finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php');
|
||||
$h->register($finder->in($h->base_dir));
|
||||
|
||||
$h->run();
|
||||
}
|
||||
|
||||
function run_test_functional($task, $args)
|
||||
{
|
||||
if (!count($args))
|
||||
{
|
||||
throw new Exception('You must provide the app to test.');
|
||||
}
|
||||
|
||||
$app = $args[0];
|
||||
|
||||
if (!is_dir(sfConfig::get('sf_app_dir').DIRECTORY_SEPARATOR.$app))
|
||||
{
|
||||
throw new Exception(sprintf('The app "%s" does not exist.', $app));
|
||||
}
|
||||
|
||||
if (isset($args[1]))
|
||||
{
|
||||
foreach (array_splice($args, 1) as $path)
|
||||
{
|
||||
$files = pakeFinder::type('file')->ignore_version_control()->follow_link()->name(basename($path).'Test.php')->in(sfConfig::get('sf_test_dir').DIRECTORY_SEPARATOR.'functional'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.dirname($path));
|
||||
foreach ($files as $file)
|
||||
{
|
||||
include($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(sfConfig::get('sf_symfony_lib_dir').'/lime/lime.php');
|
||||
|
||||
$h = new lime_harness(new lime_output_color());
|
||||
$h->base_dir = sfConfig::get('sf_test_dir').'/functional/'.$app;
|
||||
|
||||
// register functional tests
|
||||
$finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php');
|
||||
$h->register($finder->in($h->base_dir));
|
||||
|
||||
$h->run();
|
||||
}
|
||||
}
|
||||
|
||||
function run_test_unit($task, $args)
|
||||
{
|
||||
$environment = isset ( $arg[1] ) ? $arg[1] : G_TEST_ENV;
|
||||
printf("start test in %s environment\n", pakeColor::colorize( $environment, 'INFO'));
|
||||
define ( 'G_ENVIRONMENT', $environment );
|
||||
|
||||
if (isset($args[0]))
|
||||
{
|
||||
foreach ($args as $path)
|
||||
{
|
||||
$pathUnit = PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP . dirname($path);
|
||||
$files = pakeFinder::type('file')->ignore_version_control()->follow_link()->name(basename($path).'Test.php')->in( $pathUnit );
|
||||
foreach ($files as $file)
|
||||
{
|
||||
$fName = str_replace ( PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP , '', $file );
|
||||
printf("\ntesting %s \n", pakeColor::colorize( $fName, 'INFO'));
|
||||
include($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
$h = new lime_harness(new lime_output_color());
|
||||
$h->base_dir = $pathUnit = PATH_CORE . 'test' . PATH_SEP . 'unit';
|
||||
// $h->base_dir = $pathUnit = PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP . "processmaker";
|
||||
|
||||
// register unit tests
|
||||
$finder = pakeFinder::type('file')->ignore_version_control()->follow_link()->name('*Test.php');
|
||||
$h->register($finder->in($h->base_dir));
|
||||
|
||||
$h->run();
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,6 @@ $docuroot = explode ( PATH_SEP , $_SERVER['DOCUMENT_ROOT'] );
|
||||
$virtualURITable['/(sys*)'] = FALSE;
|
||||
$virtualURITable['/errors/(*)'] = PATH_GULLIVER_HOME . 'methods/errors/';
|
||||
$virtualURITable['/controls/(*)'] = PATH_GULLIVER_HOME . 'methods/controls/';
|
||||
$virtualURITable['/html2ps_pdf/(*)'] = PATH_THIRDPARTY . 'html2ps_pdf/';
|
||||
$virtualURITable['/Krumo/(*)'] = PATH_THIRDPARTY . 'krumo/';
|
||||
$virtualURITable['/codepress/(*)'] = PATH_THIRDPARTY . 'codepress/';
|
||||
|
||||
|
||||
@@ -510,7 +510,7 @@ class Bootstrap
|
||||
* @param array list plugins active
|
||||
* @return void
|
||||
*/
|
||||
public static function LoadTranslationPlugins($lang = SYS_LANG, $listPluginsActive)
|
||||
public static function LoadTranslationPlugins($lang = SYS_LANG, $listPluginsActive = [])
|
||||
{
|
||||
if (! (is_array($listPluginsActive))) {
|
||||
return null;
|
||||
|
||||
@@ -5616,23 +5616,28 @@ class G
|
||||
}
|
||||
}
|
||||
|
||||
$pathSep = getConstant('PATH_SEP');
|
||||
$pathSkinEngine = getConstant('PATH_SKIN_ENGINE');
|
||||
$pathSkins = getConstant('PATH_SKINS');
|
||||
$pathCustomSkins = getConstant('PATH_CUSTOM_SKINS');
|
||||
|
||||
$arrayAux = explode("?", $strAux);
|
||||
$fileTemplate = $arrayAux[0];
|
||||
|
||||
if (file_exists(PATH_SKIN_ENGINE . "base" . PATH_SEP . $fileTemplate)) {
|
||||
$path = PATH_SKIN_ENGINE . "base" . PATH_SEP;
|
||||
if (file_exists($pathSkinEngine . "base" . $pathSep . $fileTemplate)) {
|
||||
$path = $pathSkinEngine . "base" . $pathSep;
|
||||
}
|
||||
|
||||
if (file_exists(PATH_SKIN_ENGINE . $skin . PATH_SEP . $fileTemplate)) {
|
||||
$path = PATH_SKIN_ENGINE . $skin . PATH_SEP;
|
||||
if (file_exists($pathSkinEngine . $skin . $pathSep . $fileTemplate)) {
|
||||
$path = $pathSkinEngine . $skin . $pathSep;
|
||||
}
|
||||
|
||||
if (file_exists(PATH_SKINS . $skin . PATH_SEP . $fileTemplate)) {
|
||||
$path = PATH_SKINS . $skin . PATH_SEP;
|
||||
if (file_exists($pathSkins . $skin . $pathSep . $fileTemplate)) {
|
||||
$path = $pathSkins . $skin . $pathSep;
|
||||
}
|
||||
|
||||
if (file_exists(PATH_CUSTOM_SKINS . $skin . PATH_SEP . $fileTemplate)) {
|
||||
$path = PATH_CUSTOM_SKINS . $skin . PATH_SEP;
|
||||
if (file_exists($pathCustomSkins . $skin . $pathSep . $fileTemplate)) {
|
||||
$path = $pathCustomSkins . $skin . $pathSep;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5786,7 +5791,7 @@ class G
|
||||
return $from;
|
||||
}
|
||||
|
||||
public function getRealExtension($extensionInpDoc)
|
||||
public static function getRealExtension($extensionInpDoc)
|
||||
{
|
||||
$aux = explode('.', strtolower($extensionInpDoc));
|
||||
return isset($aux[1]) ? $aux[1] : '';
|
||||
@@ -5976,7 +5981,7 @@ class G
|
||||
if ($browser == null || $version == null) {
|
||||
$info = G::getBrowser();
|
||||
$browser = $info['name'];
|
||||
$version = $info['version'];
|
||||
$version = intval($info['version']);
|
||||
}
|
||||
|
||||
if (
|
||||
|
||||
@@ -1,29 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* class.headPublisher.php
|
||||
*
|
||||
* @package gulliver.system
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public LicensegetExtJsLibraries
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
use ProcessMaker\Core\System;
|
||||
@@ -31,8 +6,6 @@ use ProcessMaker\Core\System;
|
||||
/**
|
||||
* Class headPublisher
|
||||
*
|
||||
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
||||
* @package gulliver.system
|
||||
* @access public
|
||||
*/
|
||||
class headPublisher
|
||||
@@ -417,7 +390,13 @@ class headPublisher
|
||||
return $script;
|
||||
}
|
||||
|
||||
public function getExtJsVariablesScript()
|
||||
/**
|
||||
* Build javascript section with declaration of variables
|
||||
*
|
||||
* @param string $declarationKeyword
|
||||
* @return string
|
||||
*/
|
||||
public function getExtJsVariablesScript($declarationKeyword = 'var')
|
||||
{
|
||||
$script = '';
|
||||
if (count($this->extVariable) > 0) {
|
||||
@@ -427,15 +406,7 @@ class headPublisher
|
||||
$value = $val['value'];
|
||||
$variablesValues = G::json_encode($value);
|
||||
$variablesValues = $this->stripCodeQuotes($variablesValues);
|
||||
// var_dump($variablesValues);
|
||||
// echo "<br>";
|
||||
$script .= " var $name = " . $variablesValues . ";\n";
|
||||
/*
|
||||
if ($val ['type'] == 'number')
|
||||
$script .= " var $name = $value;\n";
|
||||
else
|
||||
$script .= " var $name = '$value';\n";
|
||||
*/
|
||||
$script .= " $declarationKeyword $name = " . $variablesValues . ";\n";
|
||||
}
|
||||
$script .= "</script>\n";
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ class pagedTable
|
||||
// Config attributes from XMLFORM file
|
||||
$myAttributes = get_class_vars(get_class($this));
|
||||
foreach ($this->xmlForm->xmlform->tree->attribute as $atrib => $value) {
|
||||
if (array_key_exists($atrib, $myAttributes)) {
|
||||
if (is_array($myAttributes) && array_key_exists($atrib, $myAttributes)) {
|
||||
eval('settype($value,gettype($this->' . $atrib . '));');
|
||||
if ($value !== '') {
|
||||
eval('$this->' . $atrib . '=$value;');
|
||||
|
||||
@@ -425,14 +425,7 @@ class XmlFormField
|
||||
$fields = [];
|
||||
if (isset($this->formula)) {
|
||||
preg_match_all("/\b[a-zA-Z][a-zA-Z_0-9]*\b/", $this->formula, $matches, PREG_PATTERN_ORDER);
|
||||
/* if ($this->formula!=''){
|
||||
var_dump($this->formula);
|
||||
var_dump($matches);
|
||||
var_dump(array_keys($this->owner->fields));
|
||||
die;
|
||||
}*/
|
||||
foreach ($matches[0] as $field) {
|
||||
//if (array_key_exists( $this->owner->fields, $field ))
|
||||
$fields[] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
convertWarningsToExceptions="false"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="true"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
stderr="true"
|
||||
>
|
||||
|
||||
@@ -796,7 +796,7 @@ class Roles extends BaseRoles
|
||||
$criteria->add(PermissionsPeer::PER_CODE, '%' . $filter . '%', Criteria::LIKE);
|
||||
}
|
||||
|
||||
if (!is_null($status) && ($status == 1 || $status == 0)) {
|
||||
if (!is_null($status) && ($status === 1 || $status === 0)) {
|
||||
$criteria->add(PermissionsPeer::PER_STATUS, $status);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{ ScriptVariables::render() }}
|
||||
{!! $oHeadPublisher->getExtJsVariablesScript('') !!}
|
||||
<div id="customCaseList">
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use ProcessMaker\Model\DbSource;
|
||||
use ProcessMaker\Model\Process;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Tests\TestCase;
|
||||
|
||||
class DBQueryTest extends TestCase
|
||||
@@ -16,7 +16,7 @@ class DBQueryTest extends TestCase
|
||||
/**
|
||||
* Sets up the unit tests.
|
||||
*/
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
}
|
||||
@@ -35,7 +35,9 @@ class DBQueryTest extends TestCase
|
||||
'USR_UID' => '00000000000000000000000000000001',
|
||||
'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
|
||||
// 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
|
||||
$externalDB = factory(DbSource::class)->create([
|
||||
$externalDB = DbSource::factory()->create([
|
||||
'DBS_SERVER' => config('database.connections.testexternal.host'),
|
||||
'DBS_PORT' => '3306',
|
||||
'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
|
||||
// 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
|
||||
$externalDB = factory(DbSource::class)->create([
|
||||
$externalDB = DbSource::factory()->create([
|
||||
'DBS_SERVER' => env('MSSQL_HOST'),
|
||||
'DBS_PORT' => env('MSSQL_PORT'),
|
||||
'DBS_TYPE' => 'mssql',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Perfomance\workflow\src\ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
@@ -26,7 +27,7 @@ class DelegationTest extends TestCase
|
||||
/**
|
||||
* Define values of some parameters of the test
|
||||
*/
|
||||
protected function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
if (!env('RUN_MYSQL_PERFORMANCE_TESTS')) {
|
||||
$this->markTestSkipped('Test related to the performance are disabled for this server configuration');
|
||||
@@ -48,24 +49,24 @@ class DelegationTest extends TestCase
|
||||
//Define the maximum time of execution
|
||||
$maximumTime = $this->maximumExecutionTime;
|
||||
//Create process
|
||||
$process = factory(Process::class)->create();
|
||||
$process = Process::factory()->create();
|
||||
//Create user
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
//Create a task self service
|
||||
$task = factory(Task::class)->create([
|
||||
$task = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//Assign a user in the task
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'TU_RELATION' => 1, //Related to the user
|
||||
'TU_TYPE' => 1
|
||||
]);
|
||||
//Create the register in delegation relate to self-service
|
||||
factory(Delegation::class, $total)->create([
|
||||
Delegation::factory($total)->create([
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'USR_ID' => 0,
|
||||
@@ -93,31 +94,31 @@ class DelegationTest extends TestCase
|
||||
//Define the maximum time of execution
|
||||
$maximumTime = $this->maximumExecutionTime;
|
||||
//Create process
|
||||
$process = factory(Process::class)->create();
|
||||
$process = Process::factory()->create();
|
||||
//Create a case
|
||||
$application = factory(Application::class)->create();
|
||||
$application = Application::factory()->create();
|
||||
//Create user
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
//Create a task self service value based
|
||||
$task = factory(Task::class)->create([
|
||||
$task = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//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,
|
||||
'DEL_INDEX' => 2,
|
||||
'TAS_ID' => $task->TAS_ID
|
||||
]);
|
||||
factory(AppAssignSelfServiceValueGroup::class)->create([
|
||||
AppAssignSelfServiceValueGroup::factory()->create([
|
||||
'ID' => $appSelfValue->ID,
|
||||
'GRP_UID' => $user->USR_UID,
|
||||
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
||||
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
||||
]);
|
||||
//Create the register in self-service
|
||||
factory(Delegation::class, $total)->create([
|
||||
Delegation::factory($total)->create([
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
@@ -146,50 +147,50 @@ class DelegationTest extends TestCase
|
||||
//Define the maximum time of execution
|
||||
$maximumTime = $this->maximumExecutionTime;
|
||||
//Create process
|
||||
$process = factory(Process::class)->create();
|
||||
$process = Process::factory()->create();
|
||||
//Create a case
|
||||
$application = factory(Application::class)->create();
|
||||
$application = Application::factory()->create();
|
||||
//Create user
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
//Create a task self service
|
||||
$task = factory(Task::class)->create([
|
||||
$task = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//Assign a user in the task
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'TU_RELATION' => 1, //Related to the user
|
||||
'TU_TYPE' => 1
|
||||
]);
|
||||
//Create the register in self service
|
||||
factory(Delegation::class, $total / 2)->create([
|
||||
Delegation::factory($total / 2)->create([
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'USR_ID' => 0,
|
||||
]);
|
||||
//Create a task self service value based
|
||||
$task1 = factory(Task::class)->create([
|
||||
$task1 = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//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,
|
||||
'DEL_INDEX' => 2,
|
||||
'TAS_ID' => $task1->TAS_ID
|
||||
]);
|
||||
factory(AppAssignSelfServiceValueGroup::class)->create([
|
||||
AppAssignSelfServiceValueGroup::factory()->create([
|
||||
'ID' => $appSelfValue->ID,
|
||||
'GRP_UID' => $user->USR_UID,
|
||||
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
||||
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
||||
]);
|
||||
//Create the register in self service value based
|
||||
factory(Delegation::class, $total / 2)->create([
|
||||
Delegation::factory($total / 2)->create([
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
@@ -218,32 +219,32 @@ class DelegationTest extends TestCase
|
||||
//Define the maximum time of execution
|
||||
$maximumTime = $this->maximumExecutionTime;
|
||||
//Create process
|
||||
$process = factory(Process::class)->create();
|
||||
$process = Process::factory()->create();
|
||||
//Create group
|
||||
$group = factory(Groupwf::class)->create();
|
||||
$group = Groupwf::factory()->create();
|
||||
//Create user
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
//Assign a user in the group
|
||||
factory(GroupUser::class)->create([
|
||||
GroupUser::factory()->create([
|
||||
'GRP_UID' => $group->GRP_UID,
|
||||
'GRP_ID' => $group->GRP_ID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
//Create a task self service
|
||||
$task = factory(Task::class)->create([
|
||||
$task = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//Assign a user in the task
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'TU_RELATION' => 2, //Related to the group
|
||||
'TU_TYPE' => 1
|
||||
]);
|
||||
//Create the register in self-service
|
||||
factory(Delegation::class, $total)->create([
|
||||
Delegation::factory($total)->create([
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'USR_ID' => 0,
|
||||
@@ -271,44 +272,44 @@ class DelegationTest extends TestCase
|
||||
//Define the maximum time of execution
|
||||
$maximumTime = $this->maximumExecutionTime;
|
||||
//Create process
|
||||
$process = factory(Process::class)->create();
|
||||
$process = Process::factory()->create();
|
||||
//Create a task self service value based
|
||||
$task = factory(Task::class)->create([
|
||||
$task = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//Create a case
|
||||
$application = factory(Application::class)->create();
|
||||
$application = Application::factory()->create();
|
||||
//Create group
|
||||
$group = factory(Groupwf::class)->create();
|
||||
$group = Groupwf::factory()->create();
|
||||
//Create user
|
||||
$user = factory(User::class)->create([
|
||||
$user = User::factory()->create([
|
||||
'USR_USERNAME' => 'gary',
|
||||
'USR_LASTNAME' => 'Gary',
|
||||
'USR_FIRSTNAME' => 'Bailey',
|
||||
]);
|
||||
//Assign a user in the group
|
||||
factory(GroupUser::class)->create([
|
||||
GroupUser::factory()->create([
|
||||
'GRP_UID' => $group->GRP_UID,
|
||||
'GRP_ID' => $group->GRP_ID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
]);
|
||||
//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_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'TAS_ID' => $task->TAS_ID
|
||||
]);
|
||||
factory(AppAssignSelfServiceValueGroup::class)->create([
|
||||
AppAssignSelfServiceValueGroup::factory()->create([
|
||||
'ID' => $appSelfValue->ID,
|
||||
'GRP_UID' => $group->GRP_UID,
|
||||
'ASSIGNEE_ID' => $group->GRP_ID, //The usrId or grpId
|
||||
'ASSIGNEE_TYPE' => 2 //Related to the user=1 related to the group=2
|
||||
]);
|
||||
//Create the register in self-service
|
||||
factory(Delegation::class, $total)->create([
|
||||
Delegation::factory($total)->create([
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'DEL_INDEX' => 2,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
@@ -337,89 +338,89 @@ class DelegationTest extends TestCase
|
||||
//Define the maximum time of execution
|
||||
$maximumTime = $this->maximumExecutionTime;
|
||||
//Create process
|
||||
$process = factory(Process::class)->create();
|
||||
$process = Process::factory()->create();
|
||||
//Create group
|
||||
$group = factory(Groupwf::class)->create();
|
||||
$group = Groupwf::factory()->create();
|
||||
//Create user
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
//Assign a user in the group
|
||||
factory(GroupUser::class)->create([
|
||||
GroupUser::factory()->create([
|
||||
'GRP_UID' => $group->GRP_UID,
|
||||
'GRP_ID' => $group->GRP_ID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
//Create a task self service
|
||||
$task1 = factory(Task::class)->create([
|
||||
$task1 = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//Assign a user in the task1
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task1->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'TU_RELATION' => 1, //Related to the user
|
||||
'TU_TYPE' => 1
|
||||
]);
|
||||
//Create a task self service
|
||||
$task2 = factory(Task::class)->create([
|
||||
$task2 = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//Assign a user in the task2
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task2->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'TU_RELATION' => 1, //Related to the user
|
||||
'TU_TYPE' => 1
|
||||
]);
|
||||
//Create a task self service
|
||||
$task3 = factory(Task::class)->create([
|
||||
$task3 = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//Assign a user in the task
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task3->TAS_UID,
|
||||
'USR_UID' => $group->GRP_UID,
|
||||
'TU_RELATION' => 2, //Related to the group
|
||||
'TU_TYPE' => 1
|
||||
]);
|
||||
//Create a task self service
|
||||
$task4 = factory(Task::class)->create([
|
||||
$task4 = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//Assign a user in the task
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task4->TAS_UID,
|
||||
'USR_UID' => $group->GRP_UID,
|
||||
'TU_RELATION' => 2, //Related to the group
|
||||
'TU_TYPE' => 1
|
||||
]);
|
||||
//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,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'USR_ID' => 0,
|
||||
]);
|
||||
//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,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'USR_ID' => 0,
|
||||
]);
|
||||
//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,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'USR_ID' => 0,
|
||||
]);
|
||||
//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,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'USR_ID' => 0,
|
||||
@@ -447,30 +448,30 @@ class DelegationTest extends TestCase
|
||||
//Define the maximum time of execution
|
||||
$maximumTime = $this->maximumExecutionTime;
|
||||
//Create process
|
||||
$process = factory(Process::class)->create();
|
||||
$process = Process::factory()->create();
|
||||
//Create a case
|
||||
$application = factory(Application::class)->create();
|
||||
$application = Application::factory()->create();
|
||||
//Create user
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
//Create a task1 self service value based
|
||||
$task1 = factory(Task::class)->create([
|
||||
$task1 = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//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,
|
||||
'TAS_ID' => $task1->TAS_ID
|
||||
]);
|
||||
factory(AppAssignSelfServiceValueGroup::class)->create([
|
||||
AppAssignSelfServiceValueGroup::factory()->create([
|
||||
'ID' => $appSelfValue->ID,
|
||||
'GRP_UID' => $user->USR_UID,
|
||||
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
||||
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
||||
]);
|
||||
//Create the register in self-service
|
||||
factory(Delegation::class, $total / 2)->create([
|
||||
Delegation::factory($total / 2)->create([
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
||||
'TAS_ID' => $task1->TAS_ID,
|
||||
@@ -478,24 +479,24 @@ class DelegationTest extends TestCase
|
||||
'USR_ID' => 0,
|
||||
]);
|
||||
//Create a task2 self service value based
|
||||
$task2 = factory(Task::class)->create([
|
||||
$task2 = Task::factory()->create([
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
|
||||
'TAS_GROUP_VARIABLE' => '@@ARRAY_OF_USERS',
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
//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,
|
||||
'TAS_ID' => $task2->TAS_ID
|
||||
]);
|
||||
factory(AppAssignSelfServiceValueGroup::class)->create([
|
||||
AppAssignSelfServiceValueGroup::factory()->create([
|
||||
'ID' => $appSelfValue->ID,
|
||||
'GRP_UID' => $user->USR_UID,
|
||||
'ASSIGNEE_ID' => $user->USR_ID, //The usrId or grpId
|
||||
'ASSIGNEE_TYPE' => 1 //Related to the user=1 related to the group=2
|
||||
]);
|
||||
//Create the register in self-service
|
||||
factory(Delegation::class, $total / 2)->create([
|
||||
Delegation::factory($total / 2)->create([
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'DEL_INDEX' => $appSelfValue->DEL_INDEX,
|
||||
'TAS_ID' => $task2->TAS_ID,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Propel;
|
||||
@@ -20,6 +21,12 @@ abstract class TestCase extends BaseTestCase
|
||||
*/
|
||||
protected $currentArgv;
|
||||
|
||||
/**
|
||||
* The array of the initial tables to be dropped.
|
||||
* @var array
|
||||
*/
|
||||
public static $truncateInitialTables = '';
|
||||
|
||||
/**
|
||||
* Create application
|
||||
*/
|
||||
@@ -48,7 +55,7 @@ abstract class TestCase extends BaseTestCase
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
/**
|
||||
* Lost argv are restored.
|
||||
@@ -61,14 +68,79 @@ abstract class TestCase extends BaseTestCase
|
||||
* Lost config are restored.
|
||||
*/
|
||||
app()->instance('config', $this->currentConfig);
|
||||
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
protected function tearDown(): void
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* truncate non-initial Models.
|
||||
* @return void
|
||||
*/
|
||||
public function truncateNonInitialModels(): void
|
||||
{
|
||||
DB::statement("set global max_connections = 500;");
|
||||
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
|
||||
*/
|
||||
if (!env('POPULATE_DATABASE')) {
|
||||
refreshDatabases();
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh databases.
|
||||
* @return void
|
||||
*/
|
||||
function refreshDatabases(): void
|
||||
{
|
||||
// Create a table for define the connection
|
||||
Schema::connection('testexternal')->dropIfExists('test');
|
||||
Schema::connection('testexternal')->create('test', function ($table) {
|
||||
|
||||
@@ -14,7 +14,7 @@ class CustomizeFormatterTest extends TestCase
|
||||
/**
|
||||
* This is executed for each test.
|
||||
*/
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
self::$directory = PATH_DATA . 'logs/';
|
||||
@@ -23,7 +23,7 @@ class CustomizeFormatterTest extends TestCase
|
||||
/**
|
||||
* This is done before the first test.
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
$file = new Filesystem();
|
||||
$file->cleanDirectory(self::$directory);
|
||||
@@ -32,7 +32,7 @@ class CustomizeFormatterTest extends TestCase
|
||||
/**
|
||||
* This is done after the last test.
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
$file = new Filesystem();
|
||||
$file->cleanDirectory(self::$directory);
|
||||
@@ -68,6 +68,6 @@ class CustomizeFormatterTest extends TestCase
|
||||
$this->assertCount(1, $files);
|
||||
|
||||
$string = File::get($files[0]);
|
||||
$this->assertRegExp("/{$message}/", $string);
|
||||
$this->assertMatchesRegularExpression("/{$message}/", $string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,15 @@ use Tests\TestCase;
|
||||
|
||||
class DefaultAjaxTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Set up method.
|
||||
* @return void
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->markTestSkipped('Issues with php 8');
|
||||
}
|
||||
|
||||
/**
|
||||
* This gets data from a json file.
|
||||
|
||||
@@ -15,7 +15,7 @@ class BootstrapTest extends TestCase
|
||||
/**
|
||||
* Set up method.
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->faker = Factory::create();
|
||||
@@ -34,35 +34,35 @@ class BootstrapTest extends TestCase
|
||||
$result = Bootstrap::streamCSSBigFile($filename);
|
||||
|
||||
//add more assertions
|
||||
$this->assertRegexp("/{$filename}/", $result);
|
||||
$this->assertRegexp("/font-face/", $result);
|
||||
$this->assertRegexp("/font-family/", $result);
|
||||
$this->assertMatchesRegularExpression("/{$filename}/", $result);
|
||||
$this->assertMatchesRegularExpression("/font-face/", $result);
|
||||
$this->assertMatchesRegularExpression("/font-family/", $result);
|
||||
|
||||
$filename = "jscolors";
|
||||
$result = Bootstrap::streamCSSBigFile($filename);
|
||||
|
||||
//add more assertions
|
||||
$this->assertRegexp("/{$filename}/", $result);
|
||||
$this->assertMatchesRegularExpression("/{$filename}/", $result);
|
||||
|
||||
$filename = "xmlcolors";
|
||||
$result = Bootstrap::streamCSSBigFile($filename);
|
||||
|
||||
//add more assertions
|
||||
$this->assertRegexp("/{$filename}/", $result);
|
||||
$this->assertMatchesRegularExpression("/{$filename}/", $result);
|
||||
|
||||
$filename = "classic";
|
||||
$result = Bootstrap::streamCSSBigFile($filename);
|
||||
|
||||
//add more assertions
|
||||
$this->assertRegexp("/{$filename}/", $result);
|
||||
$this->assertRegexp("/font-family/", $result);
|
||||
$this->assertRegexp("/ss_group_suit/", $result);
|
||||
$this->assertMatchesRegularExpression("/{$filename}/", $result);
|
||||
$this->assertMatchesRegularExpression("/font-family/", $result);
|
||||
$this->assertMatchesRegularExpression("/ss_group_suit/", $result);
|
||||
|
||||
$filename = "classic-extjs";
|
||||
$result = Bootstrap::streamCSSBigFile($filename);
|
||||
|
||||
//add more assertions
|
||||
$this->assertRegexp("/{$filename}/", $result);
|
||||
$this->assertMatchesRegularExpression("/{$filename}/", $result);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ class BootstrapTest extends TestCase
|
||||
foreach ($files as $value) {
|
||||
$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) {
|
||||
$result = $result . File::get($value->getPathname());
|
||||
}
|
||||
$this->assertRegExp("/{$channel}/", $result);
|
||||
$this->assertMatchesRegularExpression("/{$channel}/", $result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class CodeScannerTest extends TestCase
|
||||
/**
|
||||
* Call the setUp parent method and create some *.ini files
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
@@ -105,7 +105,7 @@ class CodeScannerTest extends TestCase
|
||||
/**
|
||||
* Call the tearDown parent method and remove some files created
|
||||
*/
|
||||
public function tearDown()
|
||||
public function tearDown(): void
|
||||
{
|
||||
parent::tearDown();
|
||||
|
||||
@@ -203,7 +203,7 @@ class CodeScannerTest extends TestCase
|
||||
$result = $codeScanner->checkDisabledCode('PATH', $this->pathPlugin);
|
||||
$this->assertNotEmpty($result);
|
||||
} else {
|
||||
$this->markTestIncomplete(
|
||||
$this->markTestSkipped(
|
||||
'Please check the configurations to the Code Security Scanner'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class ReplaceDataFieldTest extends TestCase
|
||||
$stringToCheck = G::replaceDataField($string, $result, $dbEngine, $recursive);
|
||||
|
||||
// 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
|
||||
$result = [
|
||||
@@ -48,7 +48,7 @@ class ReplaceDataFieldTest extends TestCase
|
||||
$stringToCheck = G::replaceDataField($string, $result, $dbEngine, $recursive);
|
||||
|
||||
// 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);
|
||||
|
||||
// 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
|
||||
$result = [
|
||||
@@ -95,7 +95,7 @@ class ReplaceDataFieldTest extends TestCase
|
||||
$stringToCheck = G::replaceDataField($string, $result, $dbEngine, $recursive);
|
||||
|
||||
// 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);
|
||||
|
||||
// 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
|
||||
$dbEngine = 'mysql';
|
||||
@@ -129,7 +129,7 @@ class ReplaceDataFieldTest extends TestCase
|
||||
$stringToCheck = G::replaceDataField($string, $variables, $dbEngine, $recursive);
|
||||
|
||||
// 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);
|
||||
|
||||
// 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
|
||||
$dbEngine = 'mysql';
|
||||
@@ -163,6 +163,6 @@ class ReplaceDataFieldTest extends TestCase
|
||||
$stringToCheck = G::replaceDataField($string, $variables, $dbEngine, $recursive);
|
||||
|
||||
// The variable @=DOC_UID inside in the variable "@=upload_New" should be replaced correctly
|
||||
$this->assertRegExp("/1988828025cc89aba0cd2b8079038028/", $stringToCheck);
|
||||
$this->assertMatchesRegularExpression("/1988828025cc89aba0cd2b8079038028/", $stringToCheck);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class gTest extends TestCase
|
||||
/**
|
||||
* Set up method.
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->faker = Factory::create();
|
||||
|
||||
@@ -23,13 +23,13 @@ class RolesTest extends TestCase
|
||||
$rolesInstance = new Roles();
|
||||
|
||||
// Create elements
|
||||
$role = factory(RbacRoles::class)->create();
|
||||
$deletedUser = factory(RbacUsers::class)->states('deleted')->create();
|
||||
$activeUser = factory(RbacUsers::class)->states('active')->create();
|
||||
$inactiveUser = factory(RbacUsers::class)->states('inactive')->create();
|
||||
$role = RbacRoles::factory()->create();
|
||||
$deletedUser = RbacUsers::factory()->deleted()->create();
|
||||
$activeUser = RbacUsers::factory()->active()->create();
|
||||
$inactiveUser = RbacUsers::factory()->inactive()->create();
|
||||
|
||||
// Assign the role to a deleted user
|
||||
factory(RbacUsersRoles::class)->create([
|
||||
RbacUsersRoles::factory()->create([
|
||||
'ROL_UID' => $role->ROL_UID,
|
||||
'USR_UID' => $deletedUser->USR_UID
|
||||
]);
|
||||
@@ -37,7 +37,7 @@ class RolesTest extends TestCase
|
||||
$this->assertEquals(0, $rolesInstance->numUsersWithRole($role->ROL_UID));
|
||||
|
||||
// Assign the role to an active user
|
||||
factory(RbacUsersRoles::class)->create([
|
||||
RbacUsersRoles::factory()->create([
|
||||
'ROL_UID' => $role->ROL_UID,
|
||||
'USR_UID' => $activeUser->USR_UID
|
||||
]);
|
||||
@@ -45,7 +45,7 @@ class RolesTest extends TestCase
|
||||
$this->assertEquals(1, $rolesInstance->numUsersWithRole($role->ROL_UID));
|
||||
|
||||
// Assign the role to an inactive user
|
||||
factory(RbacUsersRoles::class)->create([
|
||||
RbacUsersRoles::factory()->create([
|
||||
'ROL_UID' => $role->ROL_UID,
|
||||
'USR_UID' => $inactiveUser->USR_UID
|
||||
]);
|
||||
|
||||
@@ -12,7 +12,7 @@ class PhpNameGeneratorTest extends TestCase
|
||||
/**
|
||||
* Set up the test class
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
// Call the setUp parent method
|
||||
parent::setUp();
|
||||
|
||||
@@ -7,15 +7,13 @@ use ProcessMaker\Model\Dynaform;
|
||||
use ProcessMaker\Model\Process;
|
||||
use ProcessMaker\Model\ProcessVariables;
|
||||
use ProcessMaker\Model\Triggers;
|
||||
use Tests\CreateTestSite;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CliWorkspacesTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
}
|
||||
use CreateTestSite;
|
||||
|
||||
/**
|
||||
* Test that the deprecated files are removed successfully
|
||||
@@ -25,6 +23,7 @@ class CliWorkspacesTest extends TestCase
|
||||
*/
|
||||
public function it_should_delete_the_deprecated_files()
|
||||
{
|
||||
ob_start();
|
||||
include(PATH_TRUNK . 'workflow/engine/bin/tasks/cliWorkspaces.php');
|
||||
if (!file_exists(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php')) {
|
||||
$filename = PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php';
|
||||
@@ -83,6 +82,7 @@ class CliWorkspacesTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
ob_get_clean();
|
||||
// This assert the data_usersList.php does not exist anymore
|
||||
$this->assertFalse(file_exists(PATH_TRUNK . 'workflow/engine/methods/users/data_usersList.php'));
|
||||
}
|
||||
@@ -154,33 +154,34 @@ class CliWorkspacesTest extends TestCase
|
||||
*/
|
||||
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']);
|
||||
$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'],
|
||||
'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'],
|
||||
'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'],
|
||||
'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'],
|
||||
'TRI_WEBBOT' => '$text=222;
|
||||
@@ -207,26 +208,28 @@ class CliWorkspacesTest extends TestCase
|
||||
]
|
||||
);
|
||||
|
||||
ob_start();
|
||||
check_queries_incompatibilities('workflow');
|
||||
|
||||
$result = ob_get_contents();
|
||||
ob_get_clean();
|
||||
|
||||
// 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->assertRegExp('/'.$dynaform['DYN_TITLE'].'/',$result);
|
||||
$this->assertMatchesRegularExpression('/'.$dynaform['DYN_TITLE'].'/',$result);
|
||||
|
||||
// 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->assertRegExp('/'.$variables['VAR_TITLE'].'/',$result);
|
||||
$this->assertMatchesRegularExpression('/'.$variables['VAR_TITLE'].'/',$result);
|
||||
|
||||
// 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->assertRegExp('/'.$trigger['TRI_TITLE'].'/',$result);
|
||||
$this->assertMatchesRegularExpression('/'.$trigger['TRI_TITLE'].'/',$result);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
/**
|
||||
* Method set up.
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
if (!defined('PATH_IMAGES_ENVIRONMENT_USERS')) {
|
||||
@@ -52,14 +52,14 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
@@ -91,17 +91,17 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$abeConfiguration = [
|
||||
'ABE_EMAIL_SERVER_UID' => ''
|
||||
];
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
@@ -133,15 +133,15 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => '',
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
@@ -151,10 +151,10 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_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()
|
||||
{
|
||||
$user = factory(User::class)->create([
|
||||
$user = User::factory()->create([
|
||||
'USR_EMAIL' => ''
|
||||
]);
|
||||
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
@@ -209,10 +209,10 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_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()
|
||||
{
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
@@ -266,10 +266,10 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
@@ -304,15 +304,15 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
@@ -322,11 +322,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
@@ -363,15 +363,15 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
@@ -382,11 +382,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
@@ -423,15 +423,15 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
@@ -442,11 +442,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
@@ -483,16 +483,16 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform2.json")
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
@@ -503,11 +503,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
@@ -544,16 +544,16 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
@@ -565,11 +565,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
@@ -598,11 +598,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
|
||||
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
||||
|
||||
$this->assertContains('jsondata', $result);
|
||||
$this->assertContains('httpServerHostname', $result);
|
||||
$this->assertContains('pm_run_outside_main_app', $result);
|
||||
$this->assertContains('pathRTLCss', $result);
|
||||
$this->assertContains('fieldsRequired', $result);
|
||||
$this->assertStringContainsString('jsondata', $result);
|
||||
$this->assertStringContainsString('httpServerHostname', $result);
|
||||
$this->assertStringContainsString('pm_run_outside_main_app', $result);
|
||||
$this->assertStringContainsString('pathRTLCss', $result);
|
||||
$this->assertStringContainsString('fieldsRequired', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -615,16 +615,16 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
@@ -636,11 +636,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
@@ -669,11 +669,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
|
||||
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
||||
|
||||
$this->assertContains('jsondata', $result);
|
||||
$this->assertContains('httpServerHostname', $result);
|
||||
$this->assertContains('pm_run_outside_main_app', $result);
|
||||
$this->assertContains('pathRTLCss', $result);
|
||||
$this->assertContains('fieldsRequired', $result);
|
||||
$this->assertStringContainsString('jsondata', $result);
|
||||
$this->assertStringContainsString('httpServerHostname', $result);
|
||||
$this->assertStringContainsString('pm_run_outside_main_app', $result);
|
||||
$this->assertStringContainsString('pathRTLCss', $result);
|
||||
$this->assertStringContainsString('fieldsRequired', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -687,16 +687,16 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
$emailServer = ProcessMaker\Model\EmailServerModel::factory()->create();
|
||||
$abeConfiguration = AbeConfiguration::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
@@ -708,11 +708,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
@@ -741,10 +741,10 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
|
||||
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
||||
|
||||
$this->assertContains('jsondata', $result);
|
||||
$this->assertContains('httpServerHostname', $result);
|
||||
$this->assertContains('pm_run_outside_main_app', $result);
|
||||
$this->assertContains('pathRTLCss', $result);
|
||||
$this->assertContains('fieldsRequired', $result);
|
||||
$this->assertStringContainsString('jsondata', $result);
|
||||
$this->assertStringContainsString('httpServerHostname', $result);
|
||||
$this->assertStringContainsString('pm_run_outside_main_app', $result);
|
||||
$this->assertStringContainsString('pathRTLCss', $result);
|
||||
$this->assertStringContainsString('fieldsRequired', $result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,11 +21,19 @@ class CasesTest extends TestCase
|
||||
/**
|
||||
* Call setUp method
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the tearDown method
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
// The parent method needs to be override due to errors appearing
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getNextStep method with no steps
|
||||
*
|
||||
@@ -34,13 +42,13 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_get_next_step_method()
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = factory(Delegation::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
@@ -60,19 +68,19 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_get_next_step_method_position()
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = factory(Delegation::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||
]);
|
||||
factory(Step::class)->create([
|
||||
Step::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $appDelegation->TAS_UID,
|
||||
'STEP_POSITION' => 2,
|
||||
@@ -91,19 +99,19 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_get_next_step_method_output_document()
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = factory(Delegation::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||
]);
|
||||
factory(Step::class)->create([
|
||||
Step::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $appDelegation->TAS_UID,
|
||||
'STEP_POSITION' => 2,
|
||||
@@ -123,19 +131,19 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_get_next_step_method_input_document()
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = factory(Delegation::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||
]);
|
||||
factory(Step::class)->create([
|
||||
Step::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $appDelegation->TAS_UID,
|
||||
'STEP_POSITION' => 2,
|
||||
@@ -155,19 +163,19 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_get_next_step_method_external()
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = factory(Delegation::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||
]);
|
||||
factory(Step::class)->create([
|
||||
Step::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $appDelegation->TAS_UID,
|
||||
'STEP_POSITION' => 2,
|
||||
@@ -187,19 +195,19 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_get_next_step_method_message()
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = factory(Delegation::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||
]);
|
||||
factory(Step::class)->create([
|
||||
Step::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $appDelegation->TAS_UID,
|
||||
'STEP_POSITION' => 2,
|
||||
@@ -219,13 +227,13 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_get_next_step_method_step_does_not_exists()
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = factory(Delegation::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
@@ -257,9 +265,9 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_get_next_step_method_step_false()
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
$application = factory(Application::class)->create();
|
||||
$appDelegation = factory(Delegation::class)->create();
|
||||
$process = Process::factory()->create();
|
||||
$application = Application::factory()->create();
|
||||
$appDelegation = Delegation::factory()->create();
|
||||
$cases = new Cases();
|
||||
$res = $cases->getNextStep($process->PRO_UID, $application->APP_UID, $appDelegation->DEL_INDEX);
|
||||
$this->assertFalse($res);
|
||||
@@ -274,19 +282,19 @@ class CasesTest extends TestCase
|
||||
public function it_should_test_get_next_step_method_gmail()
|
||||
{
|
||||
$_SESSION['gmail'] = '';
|
||||
$process = factory(Process::class)->create();
|
||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = factory(Delegation::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||
]);
|
||||
factory(Step::class)->create([
|
||||
Step::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $appDelegation->TAS_UID,
|
||||
'STEP_POSITION' => 2,
|
||||
@@ -307,19 +315,19 @@ class CasesTest extends TestCase
|
||||
public function it_should_test_get_next_step_method_gmail_nextstep()
|
||||
{
|
||||
$_SESSION['gmail'] = '';
|
||||
$process = factory(Process::class)->create();
|
||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = factory(Delegation::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||
]);
|
||||
factory(Step::class)->create([
|
||||
Step::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $appDelegation->TAS_UID,
|
||||
'STEP_POSITION' => 1,
|
||||
@@ -340,19 +348,19 @@ class CasesTest extends TestCase
|
||||
public function it_should_test_get_next_step_method_condition_empty()
|
||||
{
|
||||
$_SESSION['gmail'] = '';
|
||||
$process = factory(Process::class)->create();
|
||||
$application = factory(Application::class)->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = factory(Delegation::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$application = Application::factory()->create(['PRO_UID' => $process->PRO_UID]);
|
||||
$appDelegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'DEL_PREVIOUS' => $appDelegation->DEL_INDEX
|
||||
]);
|
||||
factory(Step::class)->create([
|
||||
Step::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $appDelegation->TAS_UID,
|
||||
'STEP_POSITION' => 2,
|
||||
@@ -373,24 +381,24 @@ class CasesTest extends TestCase
|
||||
public function it_should_test_get_start_cases()
|
||||
{
|
||||
// Creating a process with initial tasks
|
||||
$process = factory(Process::class)->create();
|
||||
$user = factory(User::class)->create();
|
||||
$normalTask = factory(Task::class)->create([
|
||||
$process = Process::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$normalTask = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_START' => 'TRUE'
|
||||
]);
|
||||
$webEntryTask = factory(Task::class)->create([
|
||||
$webEntryTask = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_START' => 'TRUE',
|
||||
'TAS_TYPE' => 'WEBENTRYEVENT'
|
||||
]);
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $normalTask->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $webEntryTask->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
@@ -415,8 +423,8 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
public function it_shoult_test_the_get_to_method_with_default_tas_assign_type()
|
||||
{
|
||||
$task = factory(Task::class)->create();
|
||||
$user = factory(User::class)->create([
|
||||
$task = Task::factory()->create();
|
||||
$user = User::factory()->create([
|
||||
'USR_EMAIL' => 'test@test.com'
|
||||
]);
|
||||
|
||||
@@ -424,7 +432,7 @@ class CasesTest extends TestCase
|
||||
$cases = new Cases();
|
||||
$result = $cases->getTo($task->TAS_UID, $user->USR_UID, '');
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertRegExp("/{$user->USR_EMAIL}/", $result["to"]);
|
||||
$this->assertMatchesRegularExpression("/{$user->USR_EMAIL}/", $result["to"]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -435,41 +443,41 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
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,
|
||||
'TAS_ASSIGN_TYPE' => 'BALANCED'
|
||||
]);
|
||||
$task2 = factory(Task::class)->create([
|
||||
$task2 = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE'
|
||||
]);
|
||||
|
||||
$user = factory(User::class)->create([
|
||||
$user = User::factory()->create([
|
||||
'USR_EMAIL' => 'test@test.com'
|
||||
]);
|
||||
$user2 = factory(User::class)->create([
|
||||
$user2 = User::factory()->create([
|
||||
'USR_EMAIL' => 'test2@test2.com'
|
||||
]);
|
||||
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task2->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task2->TAS_UID,
|
||||
'USR_UID' => $user2->USR_UID
|
||||
]);
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'APP_STATUS_ID' => 2,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => "00000000000000000000000000000001",
|
||||
'APP_CUR_USER' => $user2->USR_UID
|
||||
]);
|
||||
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 1,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -480,7 +488,7 @@ class CasesTest extends TestCase
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'CLOSED'
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -491,7 +499,7 @@ class CasesTest extends TestCase
|
||||
'DEL_THREAD' => 2,
|
||||
'DEL_THREAD_STATUS' => 'OPEN'
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 3,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -526,8 +534,8 @@ class CasesTest extends TestCase
|
||||
$this->assertNotEmpty($result);
|
||||
|
||||
// Asserts the emails of both users are contained in the result
|
||||
$this->assertRegExp("/{$user->USR_EMAIL}/", $result["to"]);
|
||||
$this->assertRegExp("/{$user2->USR_EMAIL}/", $result["to"]);
|
||||
$this->assertMatchesRegularExpression("/{$user->USR_EMAIL}/", $result["to"]);
|
||||
$this->assertMatchesRegularExpression("/{$user2->USR_EMAIL}/", $result["to"]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -538,41 +546,41 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
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,
|
||||
'TAS_ASSIGN_TYPE' => 'BALANCED'
|
||||
]);
|
||||
$task2 = factory(Task::class)->create([
|
||||
$task2 = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_ASSIGN_TYPE' => 'MULTIPLE_INSTANCE'
|
||||
]);
|
||||
|
||||
$user = factory(User::class)->create([
|
||||
$user = User::factory()->create([
|
||||
'USR_EMAIL' => 'test@test.com'
|
||||
]);
|
||||
$user2 = factory(User::class)->create([
|
||||
$user2 = User::factory()->create([
|
||||
'USR_EMAIL' => 'test2@test2.com'
|
||||
]);
|
||||
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task2->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task2->TAS_UID,
|
||||
'USR_UID' => $user2->USR_UID
|
||||
]);
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'APP_STATUS_ID' => 2,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => "00000000000000000000000000000001",
|
||||
'APP_CUR_USER' => $user2->USR_UID
|
||||
]);
|
||||
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 1,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -583,7 +591,7 @@ class CasesTest extends TestCase
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'CLOSED'
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -594,7 +602,7 @@ class CasesTest extends TestCase
|
||||
'DEL_THREAD' => 2,
|
||||
'DEL_THREAD_STATUS' => 'OPEN'
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 3,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -629,7 +637,7 @@ class CasesTest extends TestCase
|
||||
$this->assertNotEmpty($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"]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -640,42 +648,42 @@ class CasesTest extends TestCase
|
||||
*/
|
||||
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,
|
||||
'TAS_ASSIGN_TYPE' => 'BALANCED'
|
||||
]);
|
||||
$task2 = factory(Task::class)->create([
|
||||
$task2 = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_ASSIGN_TYPE' => 'MULTIPLE_INSTANCE_VALUE_BASED',
|
||||
'TAS_ASSIGN_VARIABLE' => '@@users'
|
||||
]);
|
||||
|
||||
$user = factory(User::class)->create([
|
||||
$user = User::factory()->create([
|
||||
'USR_EMAIL' => 'test@test.com'
|
||||
]);
|
||||
$user2 = factory(User::class)->create([
|
||||
$user2 = User::factory()->create([
|
||||
'USR_EMAIL' => 'test2@test2.com'
|
||||
]);
|
||||
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task2->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task2->TAS_UID,
|
||||
'USR_UID' => $user2->USR_UID
|
||||
]);
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'APP_STATUS_ID' => 2,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => "00000000000000000000000000000001",
|
||||
'APP_CUR_USER' => $user2->USR_UID
|
||||
]);
|
||||
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 1,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -686,7 +694,7 @@ class CasesTest extends TestCase
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'CLOSED'
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 2,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -697,7 +705,7 @@ class CasesTest extends TestCase
|
||||
'DEL_THREAD' => 2,
|
||||
'DEL_THREAD_STATUS' => 'OPEN'
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 3,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
@@ -733,14 +741,6 @@ class CasesTest extends TestCase
|
||||
$this->assertNotEmpty($result);
|
||||
|
||||
// Asserts the emails of both users are contained in the result
|
||||
$this->assertRegExp("/{$user->USR_EMAIL}/", $result["to"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the tearDown method
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
// The parent method needs to be override due to errors appearing
|
||||
$this->assertMatchesRegularExpression("/{$user->USR_EMAIL}/", $result["to"]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class ConfigurationsTest extends TestCase
|
||||
public function it_should_return_empty_preferences()
|
||||
{
|
||||
//Define a user preferences empty
|
||||
$configuration = factory(Configuration::class)->states('userPreferencesEmpty')->create();
|
||||
$configuration = Configuration::factory()->userPreferencesEmpty()->create();
|
||||
|
||||
//Get the user preferences
|
||||
$conf = new Configurations();
|
||||
|
||||
@@ -16,7 +16,7 @@ class DbConnectionsTest extends TestCase
|
||||
/**
|
||||
* Setup method.
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dbConnections = new DbConnections();
|
||||
@@ -29,10 +29,10 @@ class DbConnectionsTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_loadAdditionalConnections_method()
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
$process = Process::factory()->create();
|
||||
|
||||
$dbName = env('DB_DATABASE');
|
||||
$dbSource = factory(DbSource::class)->create([
|
||||
$dbSource = DbSource::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DBS_TYPE' => 'mysql',
|
||||
'DBS_SERVER' => env('DB_HOST'),
|
||||
@@ -60,10 +60,10 @@ class DbConnectionsTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_loadAdditionalConnections_method_with_force_option_true()
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
$process = Process::factory()->create();
|
||||
|
||||
$dbName = env('DB_DATABASE');
|
||||
$dbSource = factory(DbSource::class)->create([
|
||||
$dbSource = DbSource::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DBS_TYPE' => 'mysql',
|
||||
'DBS_SERVER' => env('DB_HOST'),
|
||||
@@ -88,10 +88,10 @@ class DbConnectionsTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_loadAdditionalConnections_method_with_force_option_false()
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
$process = Process::factory()->create();
|
||||
|
||||
$dbName = env('DB_DATABASE');
|
||||
$dbSource = factory(DbSource::class)->create([
|
||||
$dbSource = DbSource::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DBS_TYPE' => 'mysql',
|
||||
'DBS_SERVER' => env('DB_HOST'),
|
||||
|
||||
@@ -24,7 +24,7 @@ class DerivationTest extends TestCase
|
||||
/**
|
||||
* Call the setUp parent method
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
@@ -39,7 +39,7 @@ class DerivationTest extends TestCase
|
||||
/**
|
||||
* Call the tearDown method
|
||||
*/
|
||||
public function tearDown()
|
||||
public function tearDown(): void
|
||||
{
|
||||
parent::tearDown(); // TODO: Change the autogenerated stub
|
||||
}
|
||||
@@ -119,23 +119,23 @@ class DerivationTest extends TestCase
|
||||
public function it_should_test_the_do_derivation_method_sending_variables_synchronously()
|
||||
{
|
||||
// Create the models
|
||||
$user = factory(User::class)->create();
|
||||
$process = factory(Process::class)->create([
|
||||
$user = User::factory()->create();
|
||||
$process = Process::factory()->create([
|
||||
'PRO_CREATE_USER' => $user->USR_UID
|
||||
]);
|
||||
$task = factory(Task::class)->create([
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
]);
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_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_NUMBER' => $application->APP_NUMBER
|
||||
]);
|
||||
factory(SubApplication::class)->create([
|
||||
SubApplication::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'APP_PARENT' => $application->APP_UID,
|
||||
'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()
|
||||
{
|
||||
// Create the models
|
||||
$user = factory(User::class)->create();
|
||||
$process = factory(Process::class)->create([
|
||||
$user = User::factory()->create();
|
||||
$process = Process::factory()->create([
|
||||
'PRO_CREATE_USER' => $user->USR_UID
|
||||
]);
|
||||
$task = factory(Task::class)->create([
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_USER' => $user->USR_UID
|
||||
]);
|
||||
factory(TaskUser::class)->create([
|
||||
TaskUser::factory()->create([
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_CUR_USER' => $user->USR_UID
|
||||
]);
|
||||
$appDelegation = factory(Delegation::class)->create([
|
||||
$appDelegation = Delegation::factory()->create([
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'APP_NUMBER' => $application->APP_NUMBER
|
||||
]);
|
||||
factory(SubApplication::class)->create([
|
||||
SubApplication::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'APP_PARENT' => $application->APP_UID,
|
||||
'DEL_INDEX_PARENT' => $appDelegation->DEL_INDEX,
|
||||
'SA_STATUS' => 'FINISHED'
|
||||
]);
|
||||
factory(Route::class)->create([
|
||||
Route::factory()->create([
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'ROU_NEXT_TASK' => $task->TAS_UID,
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
|
||||
@@ -13,7 +13,7 @@ class LdapAdvancedTest extends TestCase
|
||||
/**
|
||||
* Method setUp.
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->ldapAdvanced = new LdapAdvanced();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Faker\Factory;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use ProcessMaker\Model\Dynaform;
|
||||
use ProcessMaker\Model\Process;
|
||||
use Tests\TestCase;
|
||||
@@ -17,7 +16,7 @@ class PmDynaformTest extends TestCase
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$_SERVER["REQUEST_URI"] = "";
|
||||
@@ -36,7 +35,7 @@ class PmDynaformTest extends TestCase
|
||||
if (!defined("DB_PASS")) {
|
||||
define("DB_PASS", env('DB_PASSWORD'));
|
||||
}
|
||||
Dynaform::truncate();
|
||||
$this->truncateNonInitialModels();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,10 +47,9 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 6,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -72,10 +70,9 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 5,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -96,10 +93,9 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 5,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -120,10 +116,9 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 5,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -144,10 +139,9 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 5,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -169,10 +163,9 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 5,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -194,10 +187,9 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 4,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -223,10 +215,9 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 6,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -247,10 +238,9 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 5,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -271,10 +261,9 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 3,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -294,11 +283,10 @@ class PmDynaformTest extends TestCase
|
||||
*/
|
||||
public function it_should_return_null_when_not_exist_dynaform()
|
||||
{
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 7,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -330,19 +318,17 @@ class PmDynaformTest extends TestCase
|
||||
*/
|
||||
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();
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 7,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
]);
|
||||
|
||||
$arrayForm2 = $this->createArrayDynaform();
|
||||
$dynaform2 = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 9,
|
||||
$dynaform2 = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm2['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm2)
|
||||
@@ -364,19 +350,17 @@ class PmDynaformTest extends TestCase
|
||||
*/
|
||||
public function it_should_return_array_dynaforms_except_current_dynaform()
|
||||
{
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 7,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
]);
|
||||
|
||||
$arrayForm2 = $this->createArrayDynaform();
|
||||
$dynaform2 = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 9,
|
||||
$dynaform2 = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm2['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm2)
|
||||
@@ -416,10 +400,9 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 1,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
@@ -443,10 +426,9 @@ class PmDynaformTest extends TestCase
|
||||
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
|
||||
$process = factory(Process::class, 1)->create();
|
||||
$process = Process::factory(1)->create();
|
||||
|
||||
$dynaform = factory(Dynaform::class, 1)->create([
|
||||
'DYN_ID' => 2,
|
||||
$dynaform = Dynaform::factory(1)->create([
|
||||
'PRO_UID' => $process[0]->PRO_UID,
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
]);
|
||||
@@ -831,7 +813,7 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
// Create a form without translations defined
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
$form = factory(Dynaform::class)->create([
|
||||
$form = Dynaform::factory()->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
]);
|
||||
@@ -841,7 +823,7 @@ class PmDynaformTest extends TestCase
|
||||
|
||||
// Create a form with translations defined
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
$form = factory(Dynaform::class)->states('translations')->create([
|
||||
$form = Dynaform::factory()->translations()->create([
|
||||
'DYN_UID' => $arrayForm['items'][0]['id'],
|
||||
'DYN_CONTENT' => G::json_encode($arrayForm)
|
||||
]);
|
||||
@@ -861,7 +843,7 @@ class PmDynaformTest extends TestCase
|
||||
{
|
||||
$arrayForm = $this->createArrayDynaform();
|
||||
// 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_CONTENT' => G::json_encode($arrayForm)
|
||||
]);
|
||||
@@ -963,7 +945,7 @@ class PmDynaformTest extends TestCase
|
||||
public function it_should_get_dynaform_title()
|
||||
{
|
||||
// Create a Dynaform
|
||||
$dynaform = factory(Dynaform::class)->create([]);
|
||||
$dynaform = Dynaform::factory()->create([]);
|
||||
|
||||
// Instance the class to test
|
||||
$pmDynaform = new PmDynaform();
|
||||
@@ -1082,10 +1064,10 @@ class PmDynaformTest extends TestCase
|
||||
$data2 = file_get_contents($pathData2);
|
||||
$json2 = json_decode($data2);
|
||||
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'DYN_CONTENT' => $data
|
||||
]);
|
||||
factory(Dynaform::class)->create([
|
||||
Dynaform::factory()->create([
|
||||
'DYN_CONTENT' => $data,
|
||||
'PRO_UID' => $dynaform->PRO_UID
|
||||
]);
|
||||
@@ -1160,10 +1142,10 @@ class PmDynaformTest extends TestCase
|
||||
$data2 = file_get_contents($pathData2);
|
||||
$json2 = json_decode($data2);
|
||||
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
$dynaform = Dynaform::factory()->create([
|
||||
'DYN_CONTENT' => $data
|
||||
]);
|
||||
factory(Dynaform::class)->create([
|
||||
Dynaform::factory()->create([
|
||||
'DYN_CONTENT' => $data,
|
||||
'PRO_UID' => $dynaform->PRO_UID
|
||||
]);
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||
|
||||
use Faker\Factory;
|
||||
use G;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use ProcessMaker\Model\DbSource;
|
||||
use ProcessMaker\Model\ProcessCategory;
|
||||
use ProcessMaker\Model\User;
|
||||
@@ -22,10 +21,10 @@ class ExecuteQueryTest extends TestCase
|
||||
protected $contentSystemTables = "tables = 'APPLICATION|APP_SEQUENCE|APP_DELEGATION|APP_DOCUMENT|APP_MESSAGE|APP_OWNER|CONFIGURATION|CONTENT|DEPARTMENT|DYNAFORM|GROUPWF|GROUP_USER|HOLIDAY|INPUT_DOCUMENT|ISO_COUNTRY|ISO_LOCATION|ISO_SUBDIVISION|LANGUAGE|LEXICO|OUTPUT_DOCUMENT|PROCESS|PROCESS_OWNER|REPORT_TABLE|REPORT_VAR|ROUTE|STEP|STEP_TRIGGER|SWIMLANES_ELEMENTS|TASK|TASK_USER|TRANSLATION|TRIGGERS|USERS|APP_THREAD|APP_DELAY|PROCESS_USER|SESSION|DB_SOURCE|STEP_SUPERVISOR|OBJECT_PERMISSION|CASE_TRACKER|CASE_TRACKER_OBJECT|CASE_CONSOLIDATED|STAGE|SUB_PROCESS|SUB_APPLICATION|LOGIN_LOG|USERS_PROPERTIES|ADDITIONAL_TABLES|FIELDS|SHADOW_TABLE|EVENT|GATEWAY|APP_EVENT|APP_CACHE_VIEW|DIM_TIME_DELEGATE|DIM_TIME_COMPLETE|APP_HISTORY|APP_FOLDER|FIELD_CONDITION|LOG_CASES_SCHEDULER|CASE_SCHEDULER|CALENDAR_DEFINITION|CALENDAR_BUSINESS_HOURS|CALENDAR_HOLIDAYS|CALENDAR_ASSIGNMENTS|PROCESS_CATEGORY|APP_NOTES|DASHLET|DASHLET_INSTANCE|APP_SOLR_QUEUE|SEQUENCES|SESSION_STORAGE|PROCESS_FILES|WEB_ENTRY|OAUTH_ACCESS_TOKENS|OAUTH_AUTHORIZATION_CODES|OAUTH_CLIENTS|OAUTH_REFRESH_TOKENS|OAUTH_SCOPES|PMOAUTH_USER_ACCESS_TOKENS|BPMN_PROJECT|BPMN_PROCESS|BPMN_ACTIVITY|BPMN_ARTIFACT|BPMN_DIAGRAM|BPMN_BOUND|BPMN_DATA|BPMN_EVENT|BPMN_FLOW|BPMN_GATEWAY|BPMN_LANESET|BPMN_LANE|BPMN_PARTICIPANT|BPMN_EXTENSION|BPMN_DOCUMENTATION|PROCESS_VARIABLES|APP_TIMEOUT_ACTION_EXECUTED|ADDONS_STORE|ADDONS_MANAGER|LICENSE_MANAGER|APP_ASSIGN_SELF_SERVICE_VALUE|APP_ASSIGN_SELF_SERVICE_VALUE_GROUP|LIST_INBOX|LIST_PARTICIPATED_HISTORY|LIST_PARTICIPATED_LAST|LIST_COMPLETED|LIST_PAUSED|LIST_CANCELED|LIST_MY_INBOX|LIST_UNASSIGNED|LIST_UNASSIGNED_GROUP|MESSAGE_TYPE|MESSAGE_TYPE_VARIABLE|EMAIL_SERVER|WEB_ENTRY_EVENT|MESSAGE_EVENT_DEFINITION|MESSAGE_EVENT_RELATION|MESSAGE_APPLICATION|ELEMENT_TASK_RELATION|ABE_CONFIGURATION|ABE_REQUESTS|ABE_RESPONSES|USR_REPORTING|PRO_REPORTING|DASHBOARD|DASHBOARD_INDICATOR|DASHBOARD_DAS_IND|CATALOG|SCRIPT_TASK|TIMER_EVENT|EMAIL_EVENT|NOTIFICATION_DEVICE|GMAIL_RELABELING|NOTIFICATION_QUEUE|PLUGINS_REGISTRY|APP_DATA_CHANGE_LOG|JOBS_PENDING|JOBS_FAILED|RBAC_PERMISSIONS|RBAC_ROLES|RBAC_ROLES_PERMISSIONS|RBAC_SYSTEMS|RBAC_USERS|RBAC_USERS_ROLES|RBAC_AUTHENTICATION_SOURCE|'";
|
||||
protected $oldContentSystemTables = "";
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
ProcessCategory::truncate();
|
||||
$this->truncateNonInitialModels();
|
||||
$this->oldContentSystemTables = "";
|
||||
$path = PATH_CONFIG . $this->nameSystemTables;
|
||||
if (file_exists($path)) {
|
||||
@@ -34,7 +33,7 @@ class ExecuteQueryTest extends TestCase
|
||||
file_put_contents($path, $this->contentSystemTables);
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
public function tearDown(): void
|
||||
{
|
||||
parent::tearDown();
|
||||
$path = PATH_CONFIG . $this->nameSystemTables;
|
||||
@@ -47,7 +46,7 @@ class ExecuteQueryTest extends TestCase
|
||||
*/
|
||||
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) {
|
||||
$result = [
|
||||
@@ -139,7 +138,7 @@ class ExecuteQueryTest extends TestCase
|
||||
$id = $faker->unique()->numberBetween(1, 10000000);
|
||||
$newName = str_replace("'", " ", $faker->name);
|
||||
|
||||
$category = factory(ProcessCategory::class)->create([
|
||||
$category = ProcessCategory::factory()->create([
|
||||
'CATEGORY_ID' => $id
|
||||
]);
|
||||
$expected = $category->toArray();
|
||||
@@ -176,7 +175,7 @@ class ExecuteQueryTest extends TestCase
|
||||
$id = $faker->unique()->numberBetween(1, 10000000);
|
||||
$newName = str_replace("'", " ", $faker->name);
|
||||
|
||||
$category = factory(ProcessCategory::class)->create([
|
||||
$category = ProcessCategory::factory()->create([
|
||||
'CATEGORY_ID' => $id
|
||||
]);
|
||||
$expected = $category->toArray();
|
||||
@@ -205,7 +204,7 @@ class ExecuteQueryTest extends TestCase
|
||||
{
|
||||
$this->expectException(SQLException::class);
|
||||
$database = env('DB_DATABASE');
|
||||
$category = factory(ProcessCategory::class)->create();
|
||||
$category = ProcessCategory::factory()->create();
|
||||
|
||||
$sql = ""
|
||||
. "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()
|
||||
{
|
||||
$dbName = env('DB_DATABASE');
|
||||
$dbSource = factory(DbSource::class)->create([
|
||||
$dbSource = DbSource::factory()->create([
|
||||
'DBS_TYPE' => 'mysql',
|
||||
'DBS_SERVER' => env('DB_HOST'),
|
||||
'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()
|
||||
{
|
||||
$this->markTestIncomplete('This test has not been implemented yet.');
|
||||
$this->markTestSkipped('This test has not been implemented yet.');
|
||||
|
||||
$dbName = "XE";
|
||||
$dbSource = factory(DbSource::class)->create([
|
||||
$dbSource = DbSource::factory()->create([
|
||||
'DBS_TYPE' => 'oracle',
|
||||
'DBS_CONNECTION_TYPE' => 'NORMAL',
|
||||
'DBS_SERVER' => 'localhost',
|
||||
@@ -322,7 +321,7 @@ class ExecuteQueryTest extends TestCase
|
||||
$id = $faker->unique()->numberBetween(1, 10000000);
|
||||
$newName = str_replace("'", " ", $faker->name);
|
||||
|
||||
$category = factory(ProcessCategory::class)->create([
|
||||
$category = ProcessCategory::factory()->create([
|
||||
'CATEGORY_ID' => $id
|
||||
]);
|
||||
$expected = $category->toArray();
|
||||
|
||||
@@ -23,7 +23,7 @@ class PMFAddCaseNoteTest extends TestCase
|
||||
public function it_add_case_notes()
|
||||
{
|
||||
// Create notes
|
||||
$table = factory(Delegation::class)->states('foreign_keys')->create();
|
||||
$table = Delegation::factory()->foreign_keys()->create();
|
||||
// Force commit for propel
|
||||
DB::commit();
|
||||
$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
|
||||
global $RBAC;
|
||||
$user = factory(User::class)->create();
|
||||
factory(RbacUsers::class)->create([
|
||||
$user = User::factory()->create();
|
||||
RbacUsers::factory()->create([
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'USR_USERNAME' => $user->USR_USERNAME,
|
||||
'USR_FIRSTNAME' => $user->USR_FIRSTNAME,
|
||||
'USR_LASTNAME' => $user->USR_LASTNAME
|
||||
]);
|
||||
// Create group
|
||||
$group = factory(Groupwf::class)->create();
|
||||
$group = Groupwf::factory()->create();
|
||||
DB::commit();
|
||||
$result = PMFAssignUserToGroup($user->USR_UID, $group->GRP_UID);
|
||||
$this->assertNotEmpty($result);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||
|
||||
namespace Tests\unit\workflow\engine\classes\PmFunctions;
|
||||
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -13,14 +13,14 @@ use Tests\TestCase;
|
||||
*
|
||||
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFCaseInformation.28.29
|
||||
*/
|
||||
class PMFCaseInformation extends TestCase
|
||||
class PMFCaseInformationTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
/**
|
||||
* Method set up.
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class PMFCaseInformation extends TestCase
|
||||
*/
|
||||
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
|
||||
DB::commit();
|
||||
// Call the funtion
|
||||
@@ -74,8 +74,8 @@ class PMFCaseInformation extends TestCase
|
||||
*/
|
||||
public function it_should_test_this_pmfunction_index_parameter()
|
||||
{
|
||||
$application = factory(Application::class)->states('todo')->create();
|
||||
$table = factory(Delegation::class)->states('foreign_keys')->create([
|
||||
$application = Application::factory()->todo()->create();
|
||||
$table = Delegation::factory()->foreign_keys()->create([
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'APP_UID' => $application->APP_UID,
|
||||
]);
|
||||
@@ -104,8 +104,8 @@ class PMFCaseInformation extends TestCase
|
||||
*/
|
||||
public function it_should_test_this_pmfunction_app_data_parameter()
|
||||
{
|
||||
$application = factory(Application::class)->states('todo')->create();
|
||||
$table = factory(Delegation::class)->states('foreign_keys')->create([
|
||||
$application = Application::factory()->todo()->create();
|
||||
$table = Delegation::factory()->foreign_keys()->create([
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'APP_UID' => $application->APP_UID,
|
||||
]);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user