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
37 lines (33 loc) · 926 Bytes
/
GroupTest.php
File metadata and controls
37 lines (33 loc) · 926 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
<?php
namespace ProcessMaker\Models;
use Tests\TestCase;
class GroupTest extends TestCase
{
/**
* Test group without manager.
*
* @return void
*/
public function testGroupWithManager()
{
$manager = factory(User::class)->create();
$group = factory(Group::class)->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 = \factory(Group::class)->make([
'manager_id' => null,
]);
$this->assertInstanceOf(Group::class, $group);
$this->assertNull($group->manager);
$this->assertNull($group->manager_id);
}
}