Skip to content

Commit d4887f9

Browse files
committed
Merge pull request #64 from intercom/jo/remove-admin_id-constraint-on-note
remove requirement of admin_id from note creation
2 parents fcb906f + accf6c4 commit d4887f9

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

CHANGES.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changes
22
=========
33

4+
1.0.0-b7
5+
6+
- Removed requirement for admin_id on note creation
7+
48
1.0.0-b6
59

610
- Added rate limit details to response, thanks @ziemkowski
@@ -29,4 +33,4 @@ Changes
2933

3034
1.0.0-b1
3135

32-
- initial beta release
36+
- initial beta release

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ In your composer.json file:
1515
```js
1616
{
1717
"require": {
18-
"intercom/intercom-php": "1.0.0-b5"
18+
"intercom/intercom-php": "1.0.0-b7"
1919
}
2020
}
2121
```

src/Intercom/Service/config/intercom_public_note.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"parameters": {
4747
"admin_id": {
4848
"location": "json",
49-
"required": true,
5049
"type": "string"
5150
},
5251
"user": {

tests/Intercom/Resources/NoteTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ public function testCreateNote()
5555
$this->assertRequestJson(['admin_id' => '6', 'user' => ['email' => '[email protected]'], 'body' => 'Hi']);
5656
}
5757

58+
public function testCreateNoteWithoutAdmin() {
59+
$this->setMockResponse($this->client, 'Note/Note.txt');
60+
$this->client->createNote(['user' => ['email' => '[email protected]'], 'body' => 'Hi']);
61+
62+
$this->assertRequest('POST', '/notes');
63+
$this->assertRequestJson(['user' => ['email' => '[email protected]'], 'body' => 'Hi']);
64+
}
65+
5866
/**
5967
* @expectedException \Guzzle\Service\Exception\ValidationException
6068
*/
@@ -94,4 +102,4 @@ public function testCreateNoteNoBody()
94102
{
95103
$this->client->getNote(['admin_id' => '6', 'user' => ['email' => '[email protected]']]);
96104
}
97-
}
105+
}

0 commit comments

Comments
 (0)