<commit_before><?php

use Frlnc\Slack\Core\Commander;
use Frlnc\Slack\Http\CurlInteractor;
use Frlnc\Slack\Http\SlackResponseFactory;
use Mockery as m;

use Mockery\MockInterface;
use Mpociot\SlackBot\Button;
use Mpociot\SlackBot\Question;
use Mpociot\SlackBot\SlackBot;
use SuperClosure\Serializer;
use Symfony\Component\HttpFoundation\ParameterBag;

class ConversationTest extends Orchestra\Testbench\TestCase
{

    /** @var  MockInterface */
    protected $commander;

    public function tearDown()
    {
        m::close();
    }

    /** @test */
    public function it_can_set_a_bot_and_store_its_token()
    {
        $bot = m::mock(SlackBot::class);
        $bot->shouldReceive('getToken')
            ->once()
            ->andReturn('Foo');
        $conversation = new TestConversation();
        $conversation->setBot($bot);

        $this->assertSame('Foo', $conversation->getToken());
    }

    /** @test */
    public function it_can_reply()
    {
        $bot = m::mock(SlackBot::class);
        $bot->shouldReceive('getToken');
        $bot->shouldReceive('respond')
            ->once()
            ->with('This is my reply');

        $conversation = new TestConversation();
        $conversation->setBot($bot);
        $conversation->reply('This is my reply');
    }
}

class TestConversation extends \Mpociot\SlackBot\Conversation {

    /**
     * @return mixed
     */
    public function run()
    {<commit_msg>More tests<commit_after><?php

use Frlnc\Slack\Core\Commander;
use Frlnc\Slack\Http\CurlInteractor;
use Frlnc\Slack\Http\SlackResponseFactory;
use Mockery as m;

use Mockery\MockInterface;
use Mpociot\SlackBot\Button;
use Mpociot\SlackBot\Question;
use Mpociot\SlackBot\SlackBot;
use SuperClosure\Serializer;
use Symfony\Component\HttpFoundation\ParameterBag;

class ConversationTest extends Orchestra\Testbench\TestCase
{

    /** @var  MockInterface */
    protected $commander;

    public function tearDown()
    {
        m::close();
    }

    /** @test */
    public function it_can_set_a_bot_and_store_its_token()
    {
        $bot = m::mock(SlackBot::class);
        $bot->shouldReceive('getToken')
            ->once()
            ->andReturn('Foo');
        $conversation = new TestConversation();
        $conversation->setBot($bot);

        $this->assertSame('Foo', $conversation->getToken());
    }

    /** @test */
    public function it_can_reply()
    {
        $bot = m::mock(SlackBot::class);
        $bot->shouldReceive('getToken');
        $bot->shouldReceive('respond')
            ->once()
            ->with('This is my reply');

        $conversation = new TestConversation();
        $conversation->setBot($bot);
        $conversation->reply('This is my reply');
    }

    /** @test */
    public function it_can_ask_questions()
    {
        $conversation = new TestConversation();
        $question = 'Will this test work?';
        $closure = function($answer){};

        $bot = m::mock(SlackBot::class);
        $bot->shouldReceive('getToken');
        $bot->shouldReceive('respond')
            ->once()
            ->with($question);
        $bot->shouldReceive('storeConversation')
            ->once()
            ->with($conversation, $closure);

        $conversation->setBot($bot);
        $conversation->ask($question, $closure);
    }
}

class TestConversation extends \Mpociot\SlackBot\Conversation {

    /**
     * @return mixed
     */
    public function run()
    {
{'fraction_non_alphanumeric': 0.14310544611819234, 'fraction_numerical': 0.0, 'mean_word_length': 2.669500531349628, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4908581', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1054, 'n_words': 188}