File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -71,10 +71,10 @@ $client->users->create([
7171 ]
7272]);
7373
74- // Find a single user by email
74+ // Find a single user by email
7575$client->users->getUsers(["email" => "
[email protected] "]);
7676
77- // List all users
77+ // List all users
7878$client->users->getUsers([]);
7979```
8080
@@ -152,6 +152,11 @@ $client->companies->create([
152152 "name" => "foocorp", "id" => "3"
153153]);
154154
155+ // Update a company (Note: This method is an alias to the create method. In practice you can use create to update companies if you wish)
156+ $client->companies->update([
157+ "name" => "foocorp", "id" => "3"
158+ ]);
159+
155160// List Companies
156161$client->companies->getCompanies([]);
157162```
Original file line number Diff line number Diff line change 99use GuzzleHttp \Middleware ;
1010
1111class IntercomCompaniesTest extends PHPUnit_Framework_TestCase {
12- public function testUserCreate ()
12+ public function testCompanyCreate ()
1313 {
1414 $ stub = $ this ->getMockBuilder ('Intercom\IntercomClient ' )->disableOriginalConstructor ()->getMock ();
1515 $ stub ->method ('post ' )->willReturn ('foo ' );
@@ -18,7 +18,16 @@ public function testUserCreate()
1818 $ this ->assertEquals ('foo ' , $ companies ->create ([]));
1919 }
2020
21- public function testUserGet ()
21+ public function testCompanyUpdate ()
22+ {
23+ $ stub = $ this ->getMockBuilder ('Intercom\IntercomClient ' )->disableOriginalConstructor ()->getMock ();
24+ $ stub ->method ('post ' )->willReturn ('foo ' );
25+
26+ $ companies = new IntercomCompanies ($ stub );
27+ $ this ->assertEquals ('foo ' , $ companies ->update ([]));
28+ }
29+
30+ public function testCompanyGet ()
2231 {
2332 $ stub = $ this ->getMockBuilder ('Intercom\IntercomClient ' )->disableOriginalConstructor ()->getMock ();
2433 $ stub ->method ('get ' )->willReturn ('foo ' );
You can’t perform that action at this time.
0 commit comments