forked from inetprocess/libsugarcrm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTeamTest.php
49 lines (42 loc) · 1.41 KB
/
TeamTest.php
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
39
40
41
42
43
44
45
46
47
48
49
<?php
namespace Inet\SugarCRM\Tests;
use Inet\SugarCRM\EntryPoint;
use Inet\SugarCRM\DB;
use Inet\SugarCRM\Team;
class TeamTest extends SugarTestCase
{
public function testRightInstanciation()
{
$team = new Team($this->getEntryPointInstance());
$this->assertInstanceOf('Inet\SugarCRM\Team', $team);
}
public function testGetTeamsFromTeamSet()
{
$team = new Team($this->getEntryPointInstance());
$teams = $team->getTeamsFromTeamSet(1);
$this->assertCount(1, $teams);
$this->assertEquals(1, $teams[0]['id']);
$this->assertEquals('Global', $teams[0]['name']);
}
public function testGetTeamsFromTeamSetWrongTeamId()
{
$team = new Team($this->getEntryPointInstance());
$teams = $team->getTeamsFromTeamSet("NOTEAMID");
$this->assertInternalType('array', $teams);
$this->assertEmpty($teams);
}
public function testGetTeamMembers()
{
$team = new Team($this->getEntryPointInstance());
$members = $team->getTeamMembers(1);
$this->assertInternalType('array', $members);
$this->assertNotEmpty($members);
}
public function testGetTeamMembersWrongTeamId()
{
$team = new Team($this->getEntryPointInstance());
$members = $team->getTeamsFromTeamSet("NOTEAMID");
$this->assertInternalType('array', $members);
$this->assertEmpty($members);
}
}