PMCORE-3993 Circle CI: Research the Enable the coverage in PHPUnit 9.5.0 in develop

This commit is contained in:
Roly Gutierrez
2022-11-10 20:29:56 -04:00
parent 693602eaab
commit e8b0b3b273
41 changed files with 527 additions and 90 deletions

View File

@@ -149,7 +149,7 @@ class CliWorkspacesTest extends TestCase
/**
* Test the queries incompatibilities in dynaforms
*
* @covers WorkspaceTools::check_queries_incompatibilities
* @covers check_queries_incompatibilities
* @test
*/
public function it_should_test_the_incompatibilities_in_the_dynaforms_queries()

View File

@@ -15,25 +15,6 @@ use Tests\TestCase;
class CasesTest extends TestCase
{
protected $preserveGlobalState = false;
protected $runTestInSeparateProcess = true;
/**
* Call setUp method
*/
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
*

View File

@@ -12,6 +12,16 @@ use Tests\TestCase;
*/
class PmDynaformTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
@@ -35,7 +45,6 @@ class PmDynaformTest extends TestCase
if (!defined("DB_PASS")) {
define("DB_PASS", env('DB_PASSWORD'));
}
$this->truncateNonInitialModels();
}
/**

View File

@@ -21,10 +21,19 @@ 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 = "";
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
$this->oldContentSystemTables = "";
$path = PATH_CONFIG . $this->nameSystemTables;
if (file_exists($path)) {

View File

@@ -10,6 +10,16 @@ class WorkspaceToolsTest extends TestCase
use CreateTestSite;
public $workspace;
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Set up method.
* @return void
@@ -17,7 +27,6 @@ class WorkspaceToolsTest extends TestCase
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
config(["system.workspace" => "new_site"]);
$this->workspace = config("system.workspace");

View File

@@ -12,13 +12,22 @@ class GroupsAjaxTest extends TestCase
{
private $groups;
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Set up function
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
$this->settingUserLogged();
$this->createGroups();
}

View File

@@ -16,6 +16,16 @@ use Tests\TestCase;
class ActionsByEmailTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
*
* @return void
@@ -23,7 +33,6 @@ class ActionsByEmailTest extends TestCase
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
@@ -274,6 +283,7 @@ class ActionsByEmailTest extends TestCase
*/
public function it_should_test_the_load_action_by_email_method()
{
self::truncateNonInitialModels();
$user = User::factory()->create();
$application = Application::factory()->create([
'APP_UID' => '123456asse'

View File

@@ -23,13 +23,31 @@ use Tests\TestCase;
*/
class AbstractCasesTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**

View File

@@ -14,13 +14,31 @@ use Tests\TestCase;
*/
class BatchRoutingTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**

View File

@@ -14,13 +14,31 @@ use Tests\TestCase;
*/
class CanceledTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**

View File

@@ -14,13 +14,31 @@ use Tests\TestCase;
*/
class CasesListTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**

View File

@@ -14,13 +14,31 @@ use Tests\TestCase;
*/
class CompletedTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**

View File

@@ -21,13 +21,31 @@ use Tests\TestCase;
*/
class DraftTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
@@ -337,6 +355,7 @@ class DraftTest extends TestCase
*/
public function it_should_test_get_counters_by_processes_method_no_filter()
{
Delegation::truncate();
$process = Process::factory()->create();
$process2 = Process::factory()->create();
$user = User::factory()->create();
@@ -675,6 +694,7 @@ class DraftTest extends TestCase
*/
public function it_should_test_get_counters_by_range_method()
{
Delegation::truncate();
$process1 = Process::factory()->create();
$process2 = Process::factory()->create();
$user = User::factory()->create();

View File

@@ -25,13 +25,31 @@ use Tests\TestCase;
*/
class HomeTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* setUp method.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**

View File

@@ -20,13 +20,31 @@ use Tests\TestCase;
*/
class InboxTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
@@ -416,6 +434,7 @@ class InboxTest extends TestCase
*/
public function it_should_test_get_counters_by_processes_method_no_filter()
{
Delegation::truncate();
$user = User::factory()->create();
$process = Process::factory()->create();
$process2 = Process::factory()->create();
@@ -685,6 +704,7 @@ class InboxTest extends TestCase
*/
public function it_should_test_get_counters_by_range_method()
{
Delegation::truncate();
$user = User::factory()->create();
$process = Process::factory()->create();
$process2 = Process::factory()->create();

View File

@@ -15,13 +15,31 @@ use Tests\TestCase;
*/
class ParticipatedTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
@@ -424,6 +442,7 @@ class ParticipatedTest extends TestCase
*/
public function it_filter_by_thread_title()
{
Delegation::truncate();
// Create factories related to the participated cases
$cases = $this->createParticipated();
// We need to commit the records inserted because is needed for the "fulltext" index

View File

@@ -23,13 +23,31 @@ use Tests\TestCase;
*/
class PausedTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
@@ -357,6 +375,7 @@ class PausedTest extends TestCase
*/
public function it_filter_by_thread_title()
{
Delegation::truncate();
// Create factories related to the paused cases
$cases = $this->createPaused();
// We need to commit the records inserted because is needed for the "fulltext" index
@@ -469,6 +488,7 @@ class PausedTest extends TestCase
*/
public function it_should_test_get_counters_by_processes_method_no_filter()
{
Delegation::truncate();
$cases = $this->createMultiplePaused(2);
$paused = new Paused();
$paused->setUserId($cases->USR_ID);
@@ -581,6 +601,7 @@ class PausedTest extends TestCase
*/
public function it_should_test_get_counters_by_range_method()
{
Delegation::truncate();
$user = User::factory()->create();
$process1 = Process::factory()->create();
$task = Task::factory()->create([

View File

@@ -15,13 +15,31 @@ use Tests\TestCase;
*/
class SearchTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Set up function.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**

View File

@@ -20,13 +20,31 @@ use Tests\TestCase;
*/
class SupervisingTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
@@ -384,6 +402,7 @@ class SupervisingTest extends TestCase
*/
public function it_filter_by_thread_title()
{
Delegation::truncate();
// Create factories related to the to_do cases
$cases = $this->createSupervising();
$usrUid = $cases->USR_UID;

View File

@@ -27,13 +27,31 @@ use Tests\TestCase;
*/
class UnassignedTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This method is called after the last test of this test class is run.
*/
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
@@ -495,6 +513,8 @@ class UnassignedTest extends TestCase
*/
public function it_filter_by_thread_title()
{
Delegation::truncate();
Application::truncate();
// Create factories related to the unassigned cases
$cases = $this->createSelfServiceUserOrGroup();
$usrUid = $cases['taskUser']->USR_UID;
@@ -573,6 +593,7 @@ class UnassignedTest extends TestCase
*/
public function it_should_test_get_counters_by_processes_method_no_filter()
{
Delegation::truncate();
$cases = $this->createMultipleUnassigned(3);
$unassigned = new Unassigned();
$unassigned->setUserId($cases['taskUser']->USR_ID);
@@ -735,6 +756,7 @@ class UnassignedTest extends TestCase
*/
public function it_should_test_get_counters_by_range_method()
{
Delegation::truncate();
$user = User::factory()->create();
$process1 = Process::factory()->create([
'CATEGORY_ID' => 2

View File

@@ -25,13 +25,22 @@ use Tests\TestCase;
*/
class CasesTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Set up method.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
User::where('USR_ID', '=', 1)
->where('USR_ID', '=', 2)
->delete();
@@ -330,6 +339,7 @@ class CasesTest extends TestCase
*/
public function it_should_test_get_dynaforms_by_application()
{
Application::truncate();
// Create a process
$process = Process::factory()->create();

View File

@@ -23,12 +23,16 @@ class GranularImporterTest extends TestCase
* It should return data from addObjectData() method.
* @test
* @covers \ProcessMaker\BusinessModel\Migrator\GranularImporter::addObjectData()
* @dataProvider importDataObject
*/
public function it_should_return_data_from_add_object_data_method($name, $data)
public function it_should_return_data_from_add_object_data_method()
{
$granularImporter = new GranularImporter();
$result = $granularImporter->addObjectData($name, $data);
$this->assertArrayHasKey($name, $result);
$data = $this->importDataObject();
foreach ($data as $value) {
$name = $value[0];
$data = $value[1];
$granularImporter = new GranularImporter();
$result = $granularImporter->addObjectData($name, $data);
$this->assertArrayHasKey($name, $result);
}
}
}

View File

@@ -8,13 +8,22 @@ use Tests\TestCase;
class TableTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Method setUp.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**

View File

@@ -8,6 +8,16 @@ use Tests\TestCase;
class TaskSchedulerBMTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Set up method.
* @return void
@@ -15,7 +25,6 @@ class TaskSchedulerBMTest extends TestCase
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
@@ -94,6 +103,7 @@ class TaskSchedulerBMTest extends TestCase
*/
public function it_should_test_generate_initial_data_method()
{
TaskScheduler::truncate();
$r = TaskScheduler::all()->toArray();
$this->assertEmpty($r);

View File

@@ -10,6 +10,15 @@ use Tests\TestCase;
class SystemTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Define the required variables
@@ -17,7 +26,6 @@ class SystemTest extends TestCase
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**

View File

@@ -233,7 +233,7 @@ class XmlImporterTest extends TestCase
* Test the import new option and the import new group option with repeated title.
* @test
* @covers \ProcessMaker\Importer\XmlImporter::import()
* @covers \ProcessMaker\Importer\XmlImporter::updateProcessInformation()
* @covers \ProcessMaker\Importer\Importer::updateProcessInformation()
*/
public function it_should_matter_with_import_option_create_new_and_group_import_option_create_new_try_rename_title()
{

View File

@@ -12,13 +12,22 @@ use Tests\TestCase;
*/
class AppDelayTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Set up function.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
@@ -41,6 +50,7 @@ class AppDelayTest extends TestCase
*/
public function it_return_scope_not_action_disable()
{
AppDelay::truncate();
$table = AppDelay::factory()->paused_foreign_keys()->create();
$this->assertCount(1, $table->notDisabled()->get());
}

View File

@@ -16,13 +16,23 @@ use Tests\TestCase;
*/
class ApplicationTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Set up function.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
Application::truncate();
}
/**

View File

@@ -13,13 +13,22 @@ use Tests\TestCase;
*/
class CaseListTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* setUp method.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
@@ -263,6 +272,7 @@ class CaseListTest extends TestCase
*/
public function it_should_test_getSetting()
{
CaseList::truncate();
$data = [
'type' => 'inbox',
'name' => 'test1',
@@ -369,6 +379,7 @@ class CaseListTest extends TestCase
*/
public function it_should_test_export()
{
CaseList::truncate();
$data = [
'type' => 'inbox',
'name' => 'test export',
@@ -488,6 +499,7 @@ class CaseListTest extends TestCase
*/
public function it_should_test_getReportTables()
{
AdditionalTables::truncate();
$additionalTables = AdditionalTables::factory(10)->create();
$search = '';

View File

@@ -29,13 +29,23 @@ use Tests\TestCase;
*/
class DelegationTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Set up function.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
Delegation::truncate();
}
/**
@@ -1173,9 +1183,8 @@ class DelegationTest extends TestCase
public function it_should_search_and_filter_by_app_title()
{
$delegations = Delegation::factory(1)->foreign_keys()->create([
'APP_NUMBER' => function () {
return Application::factory()->create()->APP_NUMBER;
}
'DEL_INDEX' => 1,
'DEL_PREVIOUS' => 0
]);
$title = $delegations->last()->DEL_TITLE;
// We need to commit the records inserted because is needed for the "fulltext" index
@@ -3318,7 +3327,7 @@ class DelegationTest extends TestCase
/**
* This checks if return the open thread
*
* @covers \ProcessMaker\Model\Delegation::getOpenThreads()
* @covers \ProcessMaker\Model\Delegation::getOpenThread()
* @test
*/
public function it_should_return_thread_open()
@@ -3345,7 +3354,7 @@ class DelegationTest extends TestCase
/**
* This checks if return empty when the thread is CLOSED
*
* @covers \ProcessMaker\Model\Delegation::getOpenThreads()
* @covers \ProcessMaker\Model\Delegation::getOpenThread()
* @test
*/
public function it_should_return_empty_when_thread_is_closed()
@@ -3369,7 +3378,7 @@ class DelegationTest extends TestCase
/**
* This checks if return empty when the data is not null
*
* @covers \ProcessMaker\Model\Delegation::getOpenThreads()
* @covers \ProcessMaker\Model\Delegation::getOpenThread()
* @test
*/
public function it_should_return_empty_when_thread_finish_date_is_not_null()
@@ -3612,7 +3621,10 @@ class DelegationTest extends TestCase
*/
public function it_get_cases_thread_title()
{
$delegation = Delegation::factory()->foreign_keys()->create();
$delegation = Delegation::factory()->foreign_keys()->create([
'DEL_INDEX' => 1,
'DEL_PREVIOUS' => 0
]);
$result = Delegation::casesThreadTitle($delegation->DEL_TITLE);
$this->assertTrue(isset($result[0]));
}

View File

@@ -15,13 +15,22 @@ use Tests\TestCase;
*/
class GroupUserTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**

View File

@@ -13,13 +13,22 @@ use Tests\TestCase;
*/
class GroupwfTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**

View File

@@ -17,6 +17,16 @@ use Tests\TestCase;
class TaskTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Set up method.
* @return void
@@ -24,7 +34,6 @@ class TaskTest extends TestCase
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
@@ -257,6 +266,7 @@ class TaskTest extends TestCase
*/
public function it_should_test_get_tasks_for_home_method()
{
Task::truncate();
$process1 = Process::factory()->create();
$process2 = Process::factory()->create();

View File

@@ -13,15 +13,6 @@ use Tests\TestCase;
*/
class UserConfigTest extends TestCase
{
/**
* Setup method,
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
* Teardown method.
*/
@@ -59,7 +50,7 @@ class UserConfigTest extends TestCase
*/
public function it_should_test_addSetting()
{
$id = 1;
$id = 2;
$name = "test";
$setting = ["test" => 1];
@@ -79,7 +70,7 @@ class UserConfigTest extends TestCase
*/
public function it_should_test_editSetting()
{
$id = 1;
$id = 3;
$name = "test";
$setting = ["test" => 1];
$result = UserConfig::addSetting($id, $name, $setting);
@@ -102,7 +93,7 @@ class UserConfigTest extends TestCase
*/
public function it_should_test_deleteSetting()
{
$id = 2;
$id = 4;
$name = "test2";
$setting = ["test2" => 1];
$result = UserConfig::addSetting($id, $name, $setting);

View File

@@ -16,13 +16,22 @@ class BpmnWorkflowTest extends TestCase
{
private $user;
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Set up testing.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
$this->user = User::factory()->create();
}
@@ -106,6 +115,7 @@ class BpmnWorkflowTest extends TestCase
*/
public function it_should_create_from_structure()
{
Process::truncate();
$faker = Factory::create();
$projectDataFilename = PATH_TRUNK . "tests/resources/projectData.json";

View File

@@ -28,6 +28,16 @@ class LightTest extends TestCase
private $authorization;
private $optionsForConvertDatetime;
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* This is using instead of DatabaseTransactions
* @todo DatabaseTransactions is having conflicts with propel
@@ -35,7 +45,6 @@ class LightTest extends TestCase
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
$this->workspace = env("DB_DATABASE", "test");
$this->clientId = config("oauthClients.pm.clientId");
$this->clientSecret = config("oauthClients.pm.clientSecret");

View File

@@ -29,13 +29,22 @@ use Tests\unit\workflow\engine\src\ProcessMaker\BusinessModel\Cases\UnassignedTe
*/
class MetricsTest extends TestCase
{
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Method set up.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
* Initialize Rest API.
@@ -104,6 +113,7 @@ class MetricsTest extends TestCase
*/
public function it_tests_get_counters_list_method_inbox()
{
$this->markTestSkipped('Invoking this test causes unexpected behavior.');
$inbox = new InboxTest();
$user = $inbox->createMultipleInbox(10);
$this->initializeRestApi($user->USR_UID);
@@ -119,6 +129,7 @@ class MetricsTest extends TestCase
*/
public function it_tests_get_counters_list_method_draft()
{
$this->markTestSkipped('Invoking this test causes unexpected behavior.');
$draft = new DraftTest();
$user = $draft->createManyDraft(10);
$this->initializeRestApi($user->USR_UID);
@@ -134,6 +145,7 @@ class MetricsTest extends TestCase
*/
public function it_tests_get_counters_list_method_paused()
{
$this->markTestSkipped('Invoking this test causes unexpected behavior.');
$paused = new PausedTest();
$user = $paused->createMultiplePaused(5);
$this->initializeRestApi($user->USR_UID);
@@ -149,6 +161,7 @@ class MetricsTest extends TestCase
*/
public function it_tests_get_counters_list_method_unassigned()
{
$this->markTestSkipped('Invoking this test causes unexpected behavior.');
$unassignedTest = new UnassignedTest();
$cases = $unassignedTest->createMultipleUnassigned(3);
$unassigned = new Unassigned();

View File

@@ -20,13 +20,22 @@ class TaskTest extends TestCase
{
private $faker;
/**
* This method is called before the first test of this test class is run.
* @return void
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::truncateNonInitialModels();
}
/**
* Method setUp.
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
$this->faker = Factory::create();
}