HOR-4527
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
parent
abe71a6ffe
commit
0d533e19d9
31
database/factories/DbSourceFactory.php
Normal file
31
database/factories/DbSourceFactory.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a process
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\DbSource::class, function(Faker $faker) {
|
||||
|
||||
/**
|
||||
* @todo Determine if we need more base columns populated
|
||||
*/
|
||||
$dbName = $faker->word;
|
||||
return [
|
||||
'DBS_UID' => G::generateUniqueID(),
|
||||
'PRO_UID' => function() {
|
||||
return factory(\ProcessMaker\Model\Process::class)->create()->PRO_UID;
|
||||
},
|
||||
'DBS_TYPE' => 'mysql',
|
||||
'DBS_SERVER' => $faker->localIpv4,
|
||||
'DBS_DATABASE_NAME' => $faker->word,
|
||||
'DBS_USERNAME' => $faker->userName,
|
||||
/**
|
||||
* @todo WHY figure out there's a magic value to the encryption here
|
||||
*/
|
||||
'DBS_PASSWORD' => \G::encrypt( $faker->password, $dbName) . "_2NnV3ujj3w",
|
||||
'DBS_PORT' => $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
|
||||
];
|
||||
});
|
||||
17
database/factories/ProcessFactory.php
Normal file
17
database/factories/ProcessFactory.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for a process
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Process::class, function(Faker $faker) {
|
||||
|
||||
/**
|
||||
* @todo Determine if we need more base columns populated
|
||||
*/
|
||||
return [
|
||||
'PRO_UID' => G::generateUniqueID(),
|
||||
'PRO_TITLE' => $faker->sentence(3),
|
||||
'PRO_DESCRIPTION' => $faker->paragraph(3)
|
||||
];
|
||||
});
|
||||
Reference in New Issue
Block a user