<commit_before><?php

use Twitch\Twitch;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Client;

/**
 * Class TwitchTest
 */
class TwitchTest extends PHPUnit_Framework_TestCase
{

    const TEST_STREAM_ID = 148018215;
    const TEST_USER = "misterrogers";

    /**
     * @expectedException \Twitch\Exceptions\ClientIDException
     */
    public function testInvalidClientID()
    {
        $twitch = $this->createTwitch(__DIR__ . '/invalidclientid.json', 400);

        $streams = $twitch->getStreams([self::TEST_STREAM_ID]);
    }

    /**
     *
     */
    public function testStreamNameWithValidStream()
    {
        $twitch = $this->createTwitch(__DIR__ . '/getstreamsv5valid.json');

        $streams = $twitch->getStreams([self::TEST_STREAM_ID]);

        $this->assertEquals("Mister Rogers' Neighborhood", $streams[0]->game());
    }

    /**
     *
     */
    public function testNoStreamsOnline()
    {
        $twitch = $this->createTwitch(__DIR__ . '/getstreamsv5nostreams.json');

        $streams = $twitch->getStreams([self::TEST_STREAM_ID]);

        $this->assertEquals(0, count($streams));
    }

    /**
     *
     */
    public function testGetUserGetID()
    {
        $twitch = $this->createTwitch(__DIR__ . '/getuservaliduser.json');

        $user = $twitch->getUser([self::TEST_USER]);

        $this->assertEquals((string)self::TEST_STREAM_ID, $user->_id());
    }

    /**
     *
     */
    public function testSuppliedClientID()
    {
        $twitch = new Twitch('FAKE');

        $this->assertNotEmpty($twitch->_clientID);
    }<commit_msg>Fixed test<commit_after><?php

use Twitch\Twitch;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Client;

/**
 * Class TwitchTest
 */
class TwitchTest extends PHPUnit_Framework_TestCase
{

    const TEST_STREAM_ID = 148018215;
    const TEST_USER = "misterrogers";

    /**
     * @expectedException \Twitch\Exceptions\ClientIDException
     */
    public function testInvalidClientID()
    {
        $twitch = $this->createTwitch(__DIR__ . '/invalidclientid.json', 400);

        $streams = $twitch->getStreams([self::TEST_STREAM_ID]);
    }

    /**
     *
     */
    public function testStreamNameWithValidStream()
    {
        $twitch = $this->createTwitch(__DIR__ . '/getstreamsv5valid.json');

        $streams = $twitch->getStreams([self::TEST_STREAM_ID]);

        $this->assertEquals("Mister Rogers' Neighborhood", $streams[0]->game());
    }

    /**
     *
     */
    public function testNoStreamsOnline()
    {
        $twitch = $this->createTwitch(__DIR__ . '/getstreamsv5nostreams.json');

        $streams = $twitch->getStreams([self::TEST_STREAM_ID]);

        $this->assertEquals(0, count($streams));
    }

    /**
     *
     */
    public function testGetUserGetID()
    {
        $twitch = $this->createTwitch(__DIR__ . '/getuservaliduser.json');

        $user = $twitch->getUsers([self::TEST_USER]);

        $this->assertEquals((string)self::TEST_STREAM_ID, $user[0]->id());
    }

    /**
     *
     */
    public function testSuppliedClientID()
    {
        $twitch = new Twitch('FAKE');

        $this->assertNotEmpty($twitch->_clientID);
    }
{'fraction_non_alphanumeric': 0.14948139109212935, 'fraction_numerical': 0.010677242220866382, 'mean_word_length': 2.8485915492957745, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '6471399', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1048, 'n_words': 147}