コード例 #1
0
ファイル: MessageTest.php プロジェクト: veksa/carrot-api
 public function testGetConversation()
 {
     $item = new Message();
     $conversation = Conversation::fromResponse(array('id' => 1));
     $item->conversation = $conversation;
     $this->assertInstanceOf(Conversation::class, $item->conversation);
     $this->assertEquals($conversation, $item->conversation);
 }
コード例 #2
0
ファイル: Api.php プロジェクト: veksa/carrot-api
 /**
  * Get conversation by id.
  *
  * @param int $id
  *
  * @return Conversation
  *
  * @throws InvalidArgumentException
  * @throws Exception
  */
 public function getConversation($id)
 {
     if ($this->isEmptyId($id)) {
         throw new InvalidArgumentException();
     }
     return Conversation::fromResponse($this->call('conversations/' . $id, [], 'get'));
 }
コード例 #3
0
ファイル: ConversationTest.php プロジェクト: veksa/carrot-api
 public function testGetTypes()
 {
     $this->assertEquals(['email', 'popup_small', 'popup_big', 'popup_chat'], Conversation::getTypes());
 }