From 284a6a4fa3007a0bd1f3be579b0632f90be35c83 Mon Sep 17 00:00:00 2001 From: tamucola Date: Tue, 22 Nov 2016 00:47:58 +0900 Subject: [PATCH] Update EventRequestParserTest.php Add test getMessageType --- tests/LINEBot/EventRequestParserTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/LINEBot/EventRequestParserTest.php b/tests/LINEBot/EventRequestParserTest.php index c14f1282..be81ff55 100644 --- a/tests/LINEBot/EventRequestParserTest.php +++ b/tests/LINEBot/EventRequestParserTest.php @@ -206,6 +206,7 @@ public function testParseEventRequest() /** @var TextMessage $event */ $this->assertEquals('replytoken', $event->getReplyToken()); $this->assertEquals('contentid', $event->getMessageId()); + $this->assertEquals('text', $event->getMessageType()); $this->assertEquals('message', $event->getText()); } @@ -218,6 +219,7 @@ public function testParseEventRequest() $this->assertInstanceOf('LINE\LINEBot\Event\MessageEvent\ImageMessage', $event); /** @var ImageMessage $event */ $this->assertEquals('replytoken', $event->getReplyToken()); + $this->assertEquals('image', $event->getMessageType()); } { @@ -229,6 +231,7 @@ public function testParseEventRequest() $this->assertInstanceOf('LINE\LINEBot\Event\MessageEvent\VideoMessage', $event); /** @var VideoMessage $event */ $this->assertEquals('replytoken', $event->getReplyToken()); + $this->assertEquals('video', $event->getMessageType()); } { @@ -237,6 +240,7 @@ public function testParseEventRequest() $this->assertInstanceOf('LINE\LINEBot\Event\MessageEvent\AudioMessage', $event); /** @var AudioMessage $event */ $this->assertEquals('replytoken', $event->getReplyToken()); + $this->assertEquals('audio', $event->getMessageType()); } { @@ -245,6 +249,7 @@ public function testParseEventRequest() $this->assertInstanceOf('LINE\LINEBot\Event\MessageEvent\LocationMessage', $event); /** @var LocationMessage $event */ $this->assertEquals('replytoken', $event->getReplyToken()); + $this->assertEquals('location', $event->getMessageType()); $this->assertEquals('label', $event->getTitle()); $this->assertEquals('tokyo', $event->getAddress()); $this->assertEquals('-34.12', $event->getLatitude()); @@ -257,6 +262,7 @@ public function testParseEventRequest() $this->assertInstanceOf('LINE\LINEBot\Event\MessageEvent\StickerMessage', $event); /** @var StickerMessage $event */ $this->assertEquals('replytoken', $event->getReplyToken()); + $this->assertEquals('sticker', $event->getMessageType()); $this->assertEquals(1, $event->getPackageId()); $this->assertEquals(2, $event->getStickerId()); }