PMCORE-3599

This commit is contained in:
Paula Quispe
2021-12-14 17:37:04 -04:00
parent d4beed9ae9
commit ba1562001b
32 changed files with 796 additions and 12 deletions

View File

@@ -3,11 +3,12 @@
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\GroupUser;
use ProcessMaker\Model\Groupwf;
use Tests\TestCase;
/**
* Class ProcessTest
* Class GroupwfTest
*
* @coversDefaultClass \ProcessMaker\Model\Groupwf
*/
@@ -15,6 +16,43 @@ class GroupwfTest extends TestCase
{
use DatabaseTransactions;
/**
* Method set up.
*/
public function setUp()
{
parent::setUp();
Groupwf::truncate();
}
/**
* Test belongs to GRP_ID
*
* @covers \ProcessMaker\Model\Groupwf::groupUsers()
* @test
*/
public function it_belong_group()
{
$table = factory(Groupwf::class)->create([
'GRP_ID' => function () {
return factory(GroupUser::class)->create()->GRP_ID;
}
]);
$this->assertInstanceOf(GroupUser::class, $table->groupUsers);
}
/**
* This test scopeActive
*
* @covers \ProcessMaker\Model\Groupwf::scopeActive()
* @test
*/
public function it_return_scope_active()
{
$table = factory(Groupwf::class)->create();
$this->assertNotEmpty($table->active()->get());
}
/**
* It tests the verifyGroupExists() method
*