Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ask() method with a string argument can't be tested with assertQuestion #52

Open
chimit opened this issue Dec 9, 2020 · 0 comments
Open

Comments

@chimit
Copy link

chimit commented Dec 9, 2020

If you ask a question by providing a simple string as a question the assertQuestion fails, but assertReply passes. So it looks like the ask() method produces replies (BotMan\BotMan\Messages\Outgoing\OutgoingMessage) instead of questions (BotMan\BotMan\Messages\Outgoing\Question) if you pass strings to it.

// Conversation 1
$this->ask('How are you?', function (Answer $answer) {
    // ...
});
// Test
$this->bot->assertQuestion('How are you?'); // fails
$this->bot->assertReply('How are you?'); // passes
// Conversation 2
$this->ask(Question::create('How are you?'), function (Answer $answer) {
    // ...
});
// Test
$this->bot->assertQuestion('How are you?'); // passes
$this->bot->assertReply('How are you?'); // fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant