forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroupTest.php
More file actions
38 lines (34 loc) · 941 Bytes
/
GroupTest.php
File metadata and controls
38 lines (34 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace ProcessMaker\Models;
use ProcessMaker\Models\Group;
use Tests\TestCase;
class GroupTest extends TestCase
{
/**
* Test group without manager.
*
* @return void
*/
public function testGroupWithManager()
{
$manager = User::factory()->create();
$group = Group::factory()->create(['manager_id' => $manager->id]);
$this->assertInstanceOf(Group::class, $group);
$this->assertInstanceOf(User::class, $group->manager);
$this->assertEquals($group->manager_id, $group->manager->id);
}
/**
* Test group without manager.
*
* @return void
*/
public function testGroupWithoutManager()
{
$group = Group::factory()->make([
'manager_id' => null,
]);
$this->assertInstanceOf(Group::class, $group);
$this->assertNull($group->manager);
$this->assertNull($group->manager_id);
}
}