PMCORE-2614

This commit is contained in:
Paula Quispe
2020-12-22 11:01:49 -04:00
parent 1c36a18904
commit e901f82e6e
5 changed files with 78 additions and 10 deletions

View File

@@ -5,6 +5,11 @@ namespace ProcessMaker\BusinessModel;
use Exception;
use Tests\TestCase;
/**
* Class GroupTest
*
* @coversDefaultClass \ProcessMaker\BusinessModel\Group
*/
class GroupTest extends TestCase
{
/**

View File

@@ -10,7 +10,7 @@ use ProcessMaker\Model\User;
use Tests\TestCase;
/**
* Class DelegationTest
* Class ApplicationTest
*
* @coversDefaultClass \ProcessMaker\Model\Application
*/

View File

@@ -2,10 +2,16 @@
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use G;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\User;
use Tests\TestCase;
/**
* Class UserTest
*
* @coversDefaultClass \ProcessMaker\Model\User
*/
class UserTest extends TestCase
{
use DatabaseTransactions;
@@ -85,6 +91,8 @@ class UserTest extends TestCase
* It test get users for the new home view
*
* @covers \ProcessMaker\Model\User::getUsersForHome()
* @covers \ProcessMaker\Model\User::scopeActive()
* @covers \ProcessMaker\Model\User::scopeWithoutGuest()
* @test
*/
public function it_should_test_get_users_for_home()
@@ -128,4 +136,22 @@ class UserTest extends TestCase
// Only will considerate by default the actives and limit
$this->assertCount(1, User::getUsersForHome(null, 2, 1));
}
/**
* It test get the user Id
*
* @covers \ProcessMaker\Model\User::getId()
* @covers \ProcessMaker\Model\User::scopeUser()
* @test
*/
public function it_get_usr_id()
{
$user = factory(User::class)->create();
// When the user exist
$results = User::getId($user->USR_UID);
$this->assertGreaterThan(0, $results);
// When the user does not exist
$results = User::getId(G::generateUniqueID());
$this->assertEquals(0, $results);
}
}