From 055f20b6396d48abdfb0ba01af9bdc94545a3b27 Mon Sep 17 00:00:00 2001 From: Neil Herbert Date: Fri, 9 Oct 2020 16:00:36 +0100 Subject: [PATCH] Fix issue #19, question buttons response in wrong format Update BotFrameworkDriver.php to correct regex pattern Update BotFrameworkDriverTest.php it_interactive_responses_correctly to correct hardcoded format expected Set version number for mockery/mockery as doesn't support phpunit 5 --- .gitignore | 3 ++- composer.json | 2 +- src/BotFrameworkDriver.php | 2 +- tests/BotFrameworkDriverTest.php | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index fb0edf3..96a2129 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .DS_Store composer.lock .php_cs.cache -/vendor/ \ No newline at end of file +/vendor/ +.discovery/ \ No newline at end of file diff --git a/composer.json b/composer.json index 25c7132..34742ec 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "botman/studio-addons": "~1.0", "illuminate/contracts": "~5.5.0", "phpunit/phpunit": "~5.0", - "mockery/mockery": "dev-master", + "mockery/mockery": "~1.3", "ext-curl": "*" }, "autoload": { diff --git a/src/BotFrameworkDriver.php b/src/BotFrameworkDriver.php index 5145c27..5f97215 100644 --- a/src/BotFrameworkDriver.php +++ b/src/BotFrameworkDriver.php @@ -52,7 +52,7 @@ public function matchesRequest() public function getConversationAnswer(IncomingMessage $message) { if (false !== strpos($message->getText(), '<\/botman>/', $message->getText(), $matches); + preg_match('//', $message->getText(), $matches); return Answer::create($message->getText()) ->setInteractiveReply(true) diff --git a/tests/BotFrameworkDriverTest.php b/tests/BotFrameworkDriverTest.php index 870857a..75dd083 100644 --- a/tests/BotFrameworkDriverTest.php +++ b/tests/BotFrameworkDriverTest.php @@ -534,7 +534,7 @@ public function it_interactive_responses_correctly() ], ]); - $text = 'I use botman with Skype'; + $text = 'I use botman with Skype'; $message = new IncomingMessage($text, '29:2ZC81QtrQQti_yclfvcaNZnRgNSihIXUc6rgigeq82us', '29:2ZC81QtrQQti_yclfvcaNZnRgNSihIXUc6rgigeq82us'); $answer = $driver->getConversationAnswer($message);