<commit_before><?php

require_once "DBTestCase.php";

use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\TestCase;

/**
 * @coversDefaultClass \Mini\Model\Twitch
 */
class TwitchTest extends TestCase
{
    /**
     * @var \Mini\Model\Twitch
     */
    private $twitch;

    /**
     * @var \Aeris\GuzzleHttp\Mock
     */
    private $httpMock;

    public function __construct()
    {
        ob_start();

        parent::__construct();
    }

    public function setUp()
    {
        $this->httpMock = new \GuzzleHttp\Handler\MockHandler();
        $client = new \GuzzleHttp\Client(array(
            'handler' => \GuzzleHttp\HandlerStack::create($this->httpMock)
        ));
        $this->twitch = new \Mini\Model\Twitch($client, 'test', ['http_errors' => false]);
        parent::setUp();
    }

    public function tearDown()
    {
        $this->httpMock = null;
        $this->twitch = null;
        parent::tearDown();
    }

    private function queueSuccessfulRequest()
    {
        $this->httpMock->append(new Response(200, [], json_encode([
            'data' => [
                [
                    'id' => 1
                ]
            ]
        ])));
    }

    /**
     * @covers ::findStreams<commit_msg>tests: return proper property on mock response<commit_after><?php

require_once "DBTestCase.php";

use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\TestCase;

/**
 * @coversDefaultClass \Mini\Model\Twitch
 */
class TwitchTest extends TestCase
{
    /**
     * @var \Mini\Model\Twitch
     */
    private $twitch;

    /**
     * @var \Aeris\GuzzleHttp\Mock
     */
    private $httpMock;

    public function __construct()
    {
        ob_start();

        parent::__construct();
    }

    public function setUp()
    {
        $this->httpMock = new \GuzzleHttp\Handler\MockHandler();
        $client = new \GuzzleHttp\Client(array(
            'handler' => \GuzzleHttp\HandlerStack::create($this->httpMock)
        ));
        $this->twitch = new \Mini\Model\Twitch($client, 'test', ['http_errors' => false]);
        parent::setUp();
    }

    public function tearDown()
    {
        $this->httpMock = null;
        $this->twitch = null;
        parent::tearDown();
    }

    private function queueSuccessfulRequest()
    {
        $this->httpMock->append(new Response(200, [], json_encode([
            'data' => [
                [
                    'user_id' => 1
                ]
            ]
        ])));
    }

    /**
     * @covers ::findStreams
{'fraction_non_alphanumeric': 0.1477181745396317, 'fraction_numerical': 0.0040032025620496394, 'mean_word_length': 1.9159859976662776, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '1160399', 'n_tokens_mistral': 800, 'n_tokens_neox': 765, 'n_words': 131}