Add test for GET request of chats by customer_id
This commit is contained in:
parent
62ff2ec979
commit
4b898fdc95
@ -75,6 +75,27 @@ class ClientListTest extends TestCase
|
|||||||
static::assertInstanceOf(Chat::class, $response[0], "Incorrect chat instance");
|
static::assertInstanceOf(Chat::class, $response[0], "Incorrect chat instance");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group("list")
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function testGetChatsByCustomerId(): void
|
||||||
|
{
|
||||||
|
$client = self::getApiClient(
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
$this->getJsonResponse('chatsByCustomerId')
|
||||||
|
);
|
||||||
|
|
||||||
|
$request = new Request\ChatsRequest();
|
||||||
|
$request->setCustomerId(39);
|
||||||
|
|
||||||
|
$response = $client->chats($request);
|
||||||
|
static::assertCount(1, $response, "Incorrect chats count");
|
||||||
|
static::assertInstanceOf(Chat::class, $response[0], "Incorrect chat instance");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group("list")
|
* @group("list")
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
|
63
tests/Resources/chatsByCustomerId.json
Normal file
63
tests/Resources/chatsByCustomerId.json
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 30,
|
||||||
|
"avatar": "",
|
||||||
|
"name": "",
|
||||||
|
"channel": {
|
||||||
|
"id": 72,
|
||||||
|
"avatar": "",
|
||||||
|
"transport_id": 4,
|
||||||
|
"type": "fbmessenger",
|
||||||
|
"settings": {
|
||||||
|
"status": {
|
||||||
|
"delivered": "send"
|
||||||
|
},
|
||||||
|
"text": {
|
||||||
|
"creating": "both",
|
||||||
|
"editing": "both",
|
||||||
|
"quoting": "both",
|
||||||
|
"deleting": "receive",
|
||||||
|
"max_chars_count": 4096
|
||||||
|
},
|
||||||
|
"product": {
|
||||||
|
"creating": "receive",
|
||||||
|
"editing": "receive"
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"creating": "receive",
|
||||||
|
"editing": "receive"
|
||||||
|
},
|
||||||
|
"image": {
|
||||||
|
"creating": "both",
|
||||||
|
"editing": "both",
|
||||||
|
"quoting": "both",
|
||||||
|
"deleting": "receive",
|
||||||
|
"max_items_count": 10
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
|
"creating": "both",
|
||||||
|
"editing": "both",
|
||||||
|
"quoting": "both",
|
||||||
|
"deleting": "receive",
|
||||||
|
"max_items_count": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "testbot",
|
||||||
|
"is_active": true
|
||||||
|
},
|
||||||
|
"members": null,
|
||||||
|
"customer": {
|
||||||
|
"id": 39,
|
||||||
|
"type": "customer",
|
||||||
|
"avatar": "",
|
||||||
|
"name": "Иван",
|
||||||
|
"username": "Иван",
|
||||||
|
"first_name": "Иван"
|
||||||
|
},
|
||||||
|
"author_id": 0,
|
||||||
|
"last_message": null,
|
||||||
|
"last_activity": "2019-06-11T17:36:20+03:00",
|
||||||
|
"created_at": "2019-06-11T12:49:26.938879Z",
|
||||||
|
"updated_at": "2019-06-14T14:40:28.7111Z"
|
||||||
|
}
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user