Skip to content

Commit 446f561

Browse files
author
Skaelv
committed
update leads
1 parent 38fee00 commit 446f561

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/IntercomLeads.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ public function create($options)
2828
return $this->client->post("contacts", $options);
2929
}
3030

31+
/**
32+
* Creates Lead.
33+
* @see https://developers.intercom.io/reference#create-lead
34+
* @param array $options
35+
* @return mixed
36+
* @throws \GuzzleHttp\Exception\GuzzleException
37+
*/
38+
public function update($options)
39+
{
40+
return $this->create($options);
41+
}
42+
3143
/**
3244
* Lists Leads.
3345
* @see https://developers.intercom.io/reference#list-leads

test/IntercomLeadsTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ public function testLeadCreate()
1212
$this->assertEquals('foo', $leads->create([]));
1313
}
1414

15+
public function testLeadUpdate()
16+
{
17+
$stub = $this->getMockBuilder('Intercom\IntercomClient')->disableOriginalConstructor()->getMock();
18+
$stub->method('post')->willReturn('foo');
19+
20+
$leads = new IntercomLeads($stub);
21+
$this->assertEquals('foo', $leads->update([]));
22+
}
23+
1524
public function testLeadsList()
1625
{
1726
$stub = $this->getMockBuilder('Intercom\IntercomClient')->disableOriginalConstructor()->getMock();

0 commit comments

Comments
 (0)