Merged in feature/PMC-1332 (pull request #7136)
PMC-1332 PMCORE-1018 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com> Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
37
database/factories/AppMessageFactory.php
Normal file
37
database/factories/AppMessageFactory.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\AppMessage::class, function(Faker $faker) {
|
||||
return [
|
||||
'APP_MSG_UID' => G::generateUniqueID(),
|
||||
'MSG_UID' => '',
|
||||
'APP_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\Application::class)->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_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_SHOW_MESSAGE' => 1,
|
||||
'APP_MSG_ERROR' => '',
|
||||
'PRO_ID' => function() {
|
||||
return factory(\ProcessMaker\Model\Process::class)->create()->PRO_ID;
|
||||
},
|
||||
'TAS_ID' => function() {
|
||||
return factory(\ProcessMaker\Model\Task::class)->create()->TAS_ID;
|
||||
},
|
||||
'APP_NUMBER' => 1
|
||||
];
|
||||
});
|
||||
@@ -5,7 +5,7 @@ use Faker\Generator as Faker;
|
||||
$factory->define(\ProcessMaker\Model\EmailServerModel::class, function(Faker $faker) {
|
||||
return [
|
||||
'MESS_UID' => G::generateUniqueID(),
|
||||
'MESS_ENGINE' => '',
|
||||
'MESS_ENGINE' => 'MAIL',
|
||||
'MESS_SERVER' => '',
|
||||
'MESS_PORT' => 0,
|
||||
'MESS_INCOMING_SERVER' => '',
|
||||
@@ -19,5 +19,96 @@ $factory->define(\ProcessMaker\Model\EmailServerModel::class, function(Faker $fa
|
||||
'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}==/")
|
||||
];
|
||||
});
|
||||
|
||||
$factory->state(\ProcessMaker\Model\EmailServerModel::class, 'OPENMAIL', function ($faker) {
|
||||
return [
|
||||
'MESS_UID' => G::generateUniqueID(),
|
||||
'MESS_ENGINE' => 'OPENMAIL',
|
||||
'MESS_PORT' => 0,
|
||||
'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' => ''
|
||||
];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user