PMCORE-3880 PhpUnit: Error: Call to undefined function factory

This commit is contained in:
Roly Gutierrez
2022-07-21 00:04:21 -04:00
parent 99fa155266
commit 01833eb210
295 changed files with 6494 additions and 4762 deletions

View File

@@ -1,6 +1,5 @@
<?php
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use ProcessMaker\Model\Application;
@@ -12,9 +11,7 @@ use Tests\TestCase;
class ReportTablesTest extends TestCase
{
use CreateTestSite;
use DatabaseTransactions;
/**
* Sets up the unit tests.
@@ -645,19 +642,19 @@ class ReportTablesTest extends TestCase
$appData = array_merge($appData, $gridFields);
}
$user = factory(User::class)->create([
$user = User::factory()->create([
'USR_UID' => $userUid
]);
$process = factory(Process::class)->create([
$process = Process::factory()->create([
'PRO_UID' => $processUid
]);
$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_UID' => $applicationUid,
'APP_NUMBER' => $applicationNumber,
@@ -825,7 +822,7 @@ class ReportTablesTest extends TestCase
$grid = 'var_Grid1';
//assert exception
$this->expectException(Exception::class);
$this->expectException(TypeError::class);
$reportTables = new ReportTables();
$reportTables->populateTable($tableName, $connectionShortName, $type, null, $proUid, $grid);