diff --git a/tests/unit/workflow/engine/src/ProcessMaker/BusinessModel/SkinsTest.php b/tests/unit/workflow/engine/src/ProcessMaker/BusinessModel/SkinsTest.php index 1046ec7e2..f18b3d98c 100644 --- a/tests/unit/workflow/engine/src/ProcessMaker/BusinessModel/SkinsTest.php +++ b/tests/unit/workflow/engine/src/ProcessMaker/BusinessModel/SkinsTest.php @@ -62,13 +62,16 @@ class SkinsTest extends TestCase */ public function testGetSkinsCurrentWorkspace() { - $this->object->createSkin('test2', 'test2', 'description skin', config("system.workspace")); - $skins = $this->object->getSkins(); - $this->assertCount(3, $skins); - $this->assertEquals('test2', $skins[2]['SKIN_FOLDER_ID']); - $this->object->createSkin('test', 'test', 'description skin', config("system.workspace")); + $this->object->createSkin('test', 'test'); + $this->object->createSkin('test2', 'test2', 'Second skin', 'ProcessMaker Team', 'current', 'neoclassic'); $skins = $this->object->getSkins(); + $skins = collect($skins) + ->sortBy('SKIN_FOLDER_ID') + ->values() + ->toArray(); $this->assertCount(4, $skins); - $this->assertEquals('test2', $skins[3]['SKIN_FOLDER_ID']); + $this->assertEquals($skins[2]['SKIN_FOLDER_ID'], 'test'); + $this->assertEquals($skins[3]['SKIN_FOLDER_ID'], 'test2'); + $this->assertEquals($skins[3]['SKIN_WORKSPACE'], config("system.workspace")); } } diff --git a/tests/unit/workflow/engine/src/ProcessMaker/Importer/ImporterTest.php b/tests/unit/workflow/engine/src/ProcessMaker/Importer/ImporterTest.php index c10fe7500..5a0d852be 100644 --- a/tests/unit/workflow/engine/src/ProcessMaker/Importer/ImporterTest.php +++ b/tests/unit/workflow/engine/src/ProcessMaker/Importer/ImporterTest.php @@ -5,6 +5,7 @@ namespace Tests\unit\workflow\engine\src\ProcessMaker\Importer; use ProcessMaker\Importer\Importer; use ProcessMaker\Model\BpmnProject; use ProcessMaker\Model\Process; +use ProcessMaker\Model\User; use ReflectionClass; use Tests\TestCase; @@ -292,6 +293,7 @@ define ('DB_REPORT_PASS', '" . env('DB_PASSWORD') . "' );"); // Mock the load method $importer->method("load") ->willReturn($array); + $importer->setData("usr_uid", factory(User::class)->create()->USR_UID); // Call the import method $res = $importer->import(Importer::IMPORT_OPTION_KEEP_WITHOUT_CHANGING_AND_CREATE_NEW, @@ -541,6 +543,7 @@ define ('DB_REPORT_PASS', '" . env('DB_PASSWORD') . "' );"); // Mock the load method $importer->method("load") ->willReturn($array); + $importer->setData("usr_uid", factory(User::class)->create()->USR_UID); // Call the setProtectedProperty method $this->setProtectedProperty($importer, 'metadata', ['uid' => $process['PRO_UID']]);