PMCORE-3880 PhpUnit: Error: Call to undefined function factory
This commit is contained in:
@@ -26,9 +26,6 @@ class AdditionalTablesTest extends TestCase
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
if (version_compare(phpversion(), 7.3, '>') ) {
|
||||
$this->markTestSkipped('The changes in third party are not available');
|
||||
}
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
@@ -62,7 +59,9 @@ class AdditionalTablesTest extends TestCase
|
||||
$actual = $additionalTablesModel->toArray();
|
||||
unset($data["ADD_TAB_UID"]);
|
||||
|
||||
$this->assertArraySubset($data, $actual);
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($value, $actual[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +85,7 @@ class AdditionalTablesTest extends TestCase
|
||||
*/
|
||||
public function it_should_update()
|
||||
{
|
||||
$additionalTables = factory(AdditionalTablesModel::class)->create();
|
||||
$additionalTables = AdditionalTablesModel::factory()->create();
|
||||
|
||||
$expected = [
|
||||
"ADD_TAB_UID" => $additionalTables->ADD_TAB_UID,
|
||||
@@ -135,11 +134,11 @@ class AdditionalTablesTest extends TestCase
|
||||
*/
|
||||
public function it_should_get_all_registries()
|
||||
{
|
||||
$proUid = factory(\ProcessMaker\Model\Process::class)->create()->PRO_UID;
|
||||
$proUid = \ProcessMaker\Model\Process::factory()->create()->PRO_UID;
|
||||
|
||||
//local connections
|
||||
$additionalTables = factory(AdditionalTablesModel::class, 3);
|
||||
$dbSource = factory(\ProcessMaker\Model\DbSource::class)->create([
|
||||
$additionalTables = AdditionalTablesModel::factory(3);
|
||||
$dbSource = \ProcessMaker\Model\DbSource::factory()->create([
|
||||
'PRO_UID' => $proUid,
|
||||
'DBS_SERVER' => env('DB_HOST'),
|
||||
'DBS_DATABASE_NAME' => env('DB_DATABASE'),
|
||||
@@ -148,7 +147,7 @@ class AdditionalTablesTest extends TestCase
|
||||
'DBS_PORT' => '3306',
|
||||
'DBS_CONNECTION_TYPE' => 'NORMAL'
|
||||
]);
|
||||
$additionalTable = factory(AdditionalTablesModel::class)->create([
|
||||
$additionalTable = AdditionalTablesModel::factory()->create([
|
||||
'PRO_UID' => $proUid,
|
||||
'DBS_UID' => $dbSource->DBS_UID,
|
||||
]);
|
||||
@@ -157,7 +156,7 @@ class AdditionalTablesTest extends TestCase
|
||||
$this->createSchema($dbSource->DBS_DATABASE_NAME, $tableName, $name, $dbSource->DBS_UID);
|
||||
|
||||
//external connection
|
||||
$dbSource = factory(\ProcessMaker\Model\DbSource::class)->create([
|
||||
$dbSource = \ProcessMaker\Model\DbSource::factory()->create([
|
||||
'PRO_UID' => $proUid,
|
||||
'DBS_SERVER' => config('database.connections.testexternal.host'),
|
||||
'DBS_DATABASE_NAME' => config('database.connections.testexternal.database'),
|
||||
@@ -166,7 +165,7 @@ class AdditionalTablesTest extends TestCase
|
||||
'DBS_PORT' => '3306',
|
||||
'DBS_CONNECTION_TYPE' => 'NORMAL'
|
||||
]);
|
||||
$additionalTable = factory(AdditionalTablesModel::class)->create([
|
||||
$additionalTable = AdditionalTablesModel::factory()->create([
|
||||
'PRO_UID' => $proUid,
|
||||
'DBS_UID' => $dbSource->DBS_UID,
|
||||
]);
|
||||
@@ -223,14 +222,14 @@ class AdditionalTablesTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_populate_report_table()
|
||||
{
|
||||
$proUid = factory(Process::class)->create()->PRO_UID;
|
||||
$proUid = Process::factory()->create()->PRO_UID;
|
||||
|
||||
$task = factory(Task::class)->create([
|
||||
$task = Task::factory()->create([
|
||||
'PRO_UID' => $proUid
|
||||
]);
|
||||
|
||||
//local connections
|
||||
$dbSource = factory(DbSource::class)->create([
|
||||
$dbSource = DbSource::factory()->create([
|
||||
'PRO_UID' => $proUid,
|
||||
'DBS_SERVER' => env('DB_HOST'),
|
||||
'DBS_DATABASE_NAME' => env('DB_DATABASE'),
|
||||
@@ -239,7 +238,7 @@ class AdditionalTablesTest extends TestCase
|
||||
'DBS_PORT' => '3306',
|
||||
'DBS_CONNECTION_TYPE' => 'NORMAL'
|
||||
]);
|
||||
$additionalTable = factory(AdditionalTablesModel::class)->create([
|
||||
$additionalTable = AdditionalTablesModel::factory()->create([
|
||||
'PRO_UID' => $proUid,
|
||||
'DBS_UID' => $dbSource->DBS_UID,
|
||||
]);
|
||||
@@ -248,7 +247,7 @@ class AdditionalTablesTest extends TestCase
|
||||
$this->createSchema($dbSource->DBS_DATABASE_NAME, $tableName, $name, $dbSource->DBS_UID);
|
||||
|
||||
//external connection
|
||||
$dbSource = factory(DbSource::class)->create([
|
||||
$dbSource = DbSource::factory()->create([
|
||||
'PRO_UID' => $proUid,
|
||||
'DBS_SERVER' => config('database.connections.testexternal.host'),
|
||||
'DBS_DATABASE_NAME' => config('database.connections.testexternal.database'),
|
||||
@@ -257,7 +256,7 @@ class AdditionalTablesTest extends TestCase
|
||||
'DBS_PORT' => '3306',
|
||||
'DBS_CONNECTION_TYPE' => 'NORMAL'
|
||||
]);
|
||||
$additionalTable = factory(AdditionalTablesModel::class)->create([
|
||||
$additionalTable = AdditionalTablesModel::factory()->create([
|
||||
'PRO_UID' => $proUid,
|
||||
'DBS_UID' => $dbSource->DBS_UID,
|
||||
]);
|
||||
@@ -265,10 +264,10 @@ class AdditionalTablesTest extends TestCase
|
||||
$nameExternal = $additionalTable->ADD_TAB_CLASS_NAME;
|
||||
$this->createSchema($dbSource->DBS_DATABASE_NAME, $tableNameExternal, $nameExternal, $dbSource->DBS_UID);
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
$application = Application::factory()->create([
|
||||
'PRO_UID' => $proUid
|
||||
]);
|
||||
factory(Delegation::class)->create([
|
||||
Delegation::factory()->create([
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
@@ -356,7 +355,6 @@ class AdditionalTablesTest extends TestCase
|
||||
*/
|
||||
private function createSchema(string $connection, string $tableName, string $className, string $dbsUid = 'workflow')
|
||||
{
|
||||
$this->markTestIncomplete('Illegal mix of collations');
|
||||
$query = ""
|
||||
. "CREATE TABLE IF NOT EXISTS `{$tableName}` ("
|
||||
. "`APP_UID` varchar(32) NOT NULL,"
|
||||
@@ -366,7 +364,8 @@ class AdditionalTablesTest extends TestCase
|
||||
. "`VAR2` varchar(255) DEFAULT NULL,"
|
||||
. "`VAR3` varchar(255) DEFAULT NULL,"
|
||||
. "PRIMARY KEY (`APP_UID`),"
|
||||
. "KEY `indexTable` (`APP_UID`))";
|
||||
. "KEY `indexTable` (`APP_UID`)"
|
||||
. ")ENGINE=InnoDB DEFAULT CHARSET='utf8'";
|
||||
if (!empty(config("database.connections.{$connection}"))) {
|
||||
DB::connection($connection)->statement($query);
|
||||
} else {
|
||||
|
||||
@@ -39,8 +39,8 @@ class AppNotesTest extends TestCase
|
||||
*/
|
||||
public function it_test_case_notes_creation()
|
||||
{
|
||||
$application = factory(Application::class)->create();
|
||||
$user = factory(User::class)->create();
|
||||
$application = Application::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$reason = "The case was canceled due to:";
|
||||
$appNotes = new ModelAppNotes();
|
||||
$noteContent = addslashes($reason);
|
||||
@@ -62,8 +62,8 @@ class AppNotesTest extends TestCase
|
||||
*/
|
||||
public function it_test_case_notes_creation_and_send_email_to_user()
|
||||
{
|
||||
$application = factory(Application::class)->create();
|
||||
$user = factory(User::class)->create();
|
||||
$application = Application::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$reason = "The case was canceled due to:";
|
||||
$appNotes = new ModelAppNotes();
|
||||
$noteContent = addslashes($reason);
|
||||
@@ -91,9 +91,9 @@ class AppNotesTest extends TestCase
|
||||
*/
|
||||
public function it_test_case_notes_creation_and_send_email()
|
||||
{
|
||||
$application = factory(Application::class)->create();
|
||||
$user = factory(User::class)->create();
|
||||
factory(Delegation::class)->create([
|
||||
$application = Application::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
@@ -141,8 +141,8 @@ class AppNotesTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$application = factory(Application::class)->create();
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$application = Application::factory()->create();
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
@@ -174,17 +174,17 @@ class AppNotesTest extends TestCase
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$application = factory(Application::class)->create();
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$application = Application::factory()->create();
|
||||
$delegation = Delegation::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
$appNote = factory(AppNotes::class)->create();
|
||||
$appDocument = factory(Documents::class)->create([
|
||||
$appNote = AppNotes::factory()->create();
|
||||
$appDocument = Documents::factory()->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DOC_ID' => $appNote->NOTE_ID
|
||||
]);
|
||||
factory(EmailServerModel::class)->create([
|
||||
EmailServerModel::factory()->create([
|
||||
'MESS_DEFAULT' => 1
|
||||
]);
|
||||
|
||||
@@ -212,8 +212,8 @@ class AppNotesTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_get_attached_files_from_the_casenote()
|
||||
{
|
||||
$appNote = factory(AppNotes::class)->create();
|
||||
$appDocument = factory(Documents::class)->create([
|
||||
$appNote = AppNotes::factory()->create();
|
||||
$appDocument = Documents::factory()->create([
|
||||
'DOC_ID' => $appNote->NOTE_ID
|
||||
]);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class ListCanceledTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_loadFilters_method()
|
||||
{
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
]);
|
||||
|
||||
@@ -45,7 +45,7 @@ class ListCanceledTest extends TestCase
|
||||
'filter' => '',
|
||||
'search' => $delegation->application->APP_UID,
|
||||
'process' => $delegation->process->PRO_UID,
|
||||
'category' => $delegation->process->PRO_CATEGORY,
|
||||
'category' => $this->faker->word,
|
||||
'dateFrom' => '',
|
||||
'dateTo' => ''
|
||||
];
|
||||
|
||||
@@ -36,7 +36,7 @@ class ListCompletedTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_loadFilters_method()
|
||||
{
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
]);
|
||||
|
||||
@@ -48,7 +48,7 @@ class ListCompletedTest extends TestCase
|
||||
'filter' => '', //read,unread
|
||||
'search' => $delegation->application->APP_UID,
|
||||
'process' => $delegation->process->PRO_UID,
|
||||
'category' => $delegation->process->PRO_CATEGORY,
|
||||
'category' => $this->faker->word,
|
||||
'dateFrom' => '',
|
||||
'dateTo' => ''
|
||||
];
|
||||
|
||||
@@ -36,7 +36,7 @@ class ListInboxTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_loadFilters_method()
|
||||
{
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
]);
|
||||
|
||||
@@ -48,7 +48,7 @@ class ListInboxTest extends TestCase
|
||||
'search' => $delegation->application->APP_UID,
|
||||
'caseLink' => $delegation->application->APP_UID,
|
||||
'process' => $delegation->process->PRO_UID,
|
||||
'category' => $delegation->process->PRO_CATEGORY,
|
||||
'category' => $this->faker->word,
|
||||
'dateFrom' => '',
|
||||
'dateTo' => '',
|
||||
'filterStatus' => 'ON_TIME', //ON_TIME,AT_RISK,OVERDUE
|
||||
|
||||
@@ -36,7 +36,7 @@ class ListMyInboxTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_loadFilters_method()
|
||||
{
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
]);
|
||||
|
||||
@@ -45,7 +45,7 @@ class ListMyInboxTest extends TestCase
|
||||
'filter' => '',
|
||||
'search' => $delegation->application->APP_UID,
|
||||
'process' => $delegation->process->PRO_UID,
|
||||
'category' => $delegation->process->PRO_CATEGORY,
|
||||
'category' => $this->faker->word,
|
||||
'dateFrom' => '',
|
||||
'dateTo' => ''
|
||||
];
|
||||
|
||||
@@ -36,7 +36,7 @@ class ListParticipatedHistoryTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_loadFilters_method()
|
||||
{
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
]);
|
||||
|
||||
@@ -45,7 +45,7 @@ class ListParticipatedHistoryTest extends TestCase
|
||||
'filter' => '',
|
||||
'search' => $delegation->application->APP_UID,
|
||||
'process' => $delegation->process->PRO_UID,
|
||||
'category' => $delegation->process->PRO_CATEGORY,
|
||||
'category' => $this->faker->word,
|
||||
'dateFrom' => '',
|
||||
'dateTo' => ''
|
||||
];
|
||||
|
||||
@@ -36,7 +36,7 @@ class ListParticipatedLastTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_loadFilters_method()
|
||||
{
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
]);
|
||||
|
||||
@@ -46,7 +46,7 @@ class ListParticipatedLastTest extends TestCase
|
||||
'search' => $delegation->application->APP_UID,
|
||||
'caseLink' => $delegation->application->APP_UID,
|
||||
'process' => $delegation->process->PRO_UID,
|
||||
'category' => $delegation->process->PRO_CATEGORY,
|
||||
'category' => $this->faker->word,
|
||||
'dateFrom' => '',
|
||||
'dateTo' => '',
|
||||
'filterStatus' => 'ON_TIME', //ON_TIME,AT_RISK,OVERDUE
|
||||
|
||||
@@ -36,7 +36,7 @@ class ListPausedTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_loadFilters_method()
|
||||
{
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
]);
|
||||
|
||||
@@ -46,7 +46,7 @@ class ListPausedTest extends TestCase
|
||||
'search' => $delegation->application->APP_UID,
|
||||
'caseLink' => $delegation->application->APP_UID,
|
||||
'process' => $delegation->process->PRO_UID,
|
||||
'category' => $delegation->process->PRO_CATEGORY,
|
||||
'category' => $this->faker->word,
|
||||
'filterStatus' => 'ON_TIME' //ON_TIME,AT_RISK,OVERDUE
|
||||
];
|
||||
$this->listPaused->loadFilters($criteria, $filters);
|
||||
|
||||
@@ -36,7 +36,7 @@ class ListUnassignedTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_loadFilters_method()
|
||||
{
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
$delegation = Delegation::factory()->create([
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
]);
|
||||
|
||||
@@ -46,7 +46,7 @@ class ListUnassignedTest extends TestCase
|
||||
'search' => $delegation->application->APP_UID,
|
||||
'caseLink' => $delegation->application->APP_UID,
|
||||
'process' => $delegation->process->PRO_UID,
|
||||
'category' => $delegation->process->PRO_CATEGORY,
|
||||
'category' => $this->faker->word,
|
||||
'newestthan' => $delegation->DEL_DELEGATE_DATE->format('Y-m-d H:i:s'),
|
||||
'oldestthan' => $delegation->DEL_DELEGATE_DATE->format('Y-m-d H:i:s'),
|
||||
'appUidCheck' => $delegation->application->APP_UID
|
||||
|
||||
@@ -48,7 +48,7 @@ class OutputDocumentTest extends TestCase
|
||||
public function it_should_generate_tcpdf()
|
||||
{
|
||||
// Create a register in the output document
|
||||
$output = factory(OutputDocumentModel::class)->create([
|
||||
$output = OutputDocumentModel::factory()->create([
|
||||
'OUT_DOC_TEMPLATE' => '<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
|
||||
Reference in New Issue
Block a user