-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathIntercomContactsTest.php
More file actions
83 lines (65 loc) · 2.28 KB
/
IntercomContactsTest.php
File metadata and controls
83 lines (65 loc) · 2.28 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
namespace Intercom\Test;
use Intercom\IntercomContacts;
use stdClass;
class IntercomContactsTest extends TestCase
{
public function testContactCreate()
{
$this->client->method('post')->willReturn('foo');
$contacts = new IntercomContacts($this->client);
$this->assertSame('foo', $contacts->create([]));
}
public function testContactUpdate()
{
$this->client->method('put')->willReturn('foo');
$contacts = new IntercomContacts($this->client);
$this->assertSame('foo', $contacts->update('', []));
}
public function testContactsGet()
{
$this->client->method('get')->willReturn('foo');
$contacts = new IntercomContacts($this->client);
$this->assertSame('foo', $contacts->getContacts([]));
}
public function testContactGet()
{
$this->client->method('get')->willReturn('foo');
$contacts = new IntercomContacts($this->client);
$this->assertSame('foo', $contacts->getContact("123"));
}
public function testContactDelete()
{
$this->client->method('delete')->willReturn('foo');
$contacts = new IntercomContacts($this->client);
$this->assertSame('foo', $contacts->deleteContact(''));
}
public function testContactSearch()
{
$this->client->method('post')->willReturn('foo');
$contacts = new IntercomContacts($this->client);
$this->assertSame('foo', $contacts->search([]));
}
public function testContactNextSearch()
{
$this->client->method('nextSearchPage')->willReturn('foo');
$query = [];
$pages = new stdClass;
$pages->per_page = "10";
$pages->next = new stdClass;
$pages->next->starting_after = "abc";
$contacts = new IntercomContacts($this->client);
$this->assertSame('foo', $contacts->nextSearch([], $pages));
}
public function testContactNextCursor()
{
$this->client->method('nextCursorPage')->willReturn('foo');
$query = [];
$pages = new stdClass;
$pages->per_page = 150;
$pages->next = new stdClass;
$pages->next->starting_after = "abc";
$contacts = new IntercomContacts($this->client);
$this->assertSame('foo', $contacts->nextCursor($pages));
}
}