<commit_before><?php

use CoRex\Support\Str;
use CoRex\Support\System\Input;

class InputTest extends PHPUnit_Framework_TestCase
{
    const HTTP_HOST = 'test.host';
    const REQUEST_METHOD = 'PaTcH';
    const USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36';
    const IP = '1.2.3.4';
    const URI = '/test1/test2?firstname=Roger&lastname=Moore&encoded=%28%C3%A6%C3%B8%C3%A5%C3%86%C3%98%C3%85%29';
    const QUERY_STRING = 'firstname=Roger&lastname=Moore&encoded=%28%C3%A6%C3%B8%C3%A5%C3%86%C3%98%C3%85%29';
    const HEADER_CONTENT_TYPE = 'application/type';
    const HEADER_ACCEPT = 'application/type';
    const TEST = 'test';
    const PATH = 'test1/test2';
    const QUERY_ARRAY = [
        'firstname' => 'Roger',
        'lastname' => 'Moore',
        'encoded' => '(æøåÆØÅ)'
    ];

    /**
     * Setup.
     */
    protected function setUp()
    {
        parent::setUp();

        // Setup basic server variables.
        $_SERVER['HTTP_HOST'] = self::HTTP_HOST;
        $_SERVER['REQUEST_METHOD'] = self::REQUEST_METHOD;
        $_SERVER['HTTP_USER_AGENT'] = self::USER_AGENT;
        $_SERVER['REMOTE_ADDR'] = self::IP;
        $_SERVER['REQUEST_URI'] = self::URI;
        $_SERVER['QUERY_STRING'] = self::QUERY_STRING;

        // Make sure function getallheaders() exists for tests.
        if (!function_exists('getallheaders')) {
            function getallheaders()
            {
                return [
                    self::TEST => self::TEST,
                    'Content-Type' => self::HEADER_CONTENT_TYPE,
                    'Accept' => self::HEADER_ACCEPT
                ];
            }<commit_msg>Updated test for Input.<commit_after><?php

use CoRex\Support\Str;
use CoRex\Support\System\Input;

class InputTest extends PHPUnit_Framework_TestCase
{
    const HTTP_HOST = 'test.host';
    const REQUEST_METHOD = 'PaTcH';
    const USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36';
    const IP = '172.16.58.3';
    const URI = '/test1/test2?firstname=Roger&lastname=Moore&encoded=%28%C3%A6%C3%B8%C3%A5%C3%86%C3%98%C3%85%29';
    const QUERY_STRING = 'firstname=Roger&lastname=Moore&encoded=%28%C3%A6%C3%B8%C3%A5%C3%86%C3%98%C3%85%29';
    const HEADER_CONTENT_TYPE = 'application/type';
    const HEADER_ACCEPT = 'application/type';
    const TEST = 'test';
    const PATH = 'test1/test2';
    const QUERY_ARRAY = [
        'firstname' => 'Roger',
        'lastname' => 'Moore',
        'encoded' => '(æøåÆØÅ)'
    ];

    /**
     * Setup.
     */
    protected function setUp()
    {
        parent::setUp();

        // Setup basic server variables.
        $_SERVER['HTTP_HOST'] = self::HTTP_HOST;
        $_SERVER['REQUEST_METHOD'] = self::REQUEST_METHOD;
        $_SERVER['HTTP_USER_AGENT'] = self::USER_AGENT;
        $_SERVER['REMOTE_ADDR'] = self::IP;
        $_SERVER['REQUEST_URI'] = self::URI;
        $_SERVER['QUERY_STRING'] = self::QUERY_STRING;

        // Make sure function getallheaders() exists for tests.
        if (!function_exists('getallheaders')) {
            /**
             * Get all headers.
             *
             * @return array
             */
            function getallheaders()
            {
                return [
                    self::TEST => self::TEST,
                    'Content-Type' => self::HEADER_CONTENT_TYPE,
                    'Accept' => self::HEADER_ACCEPT
                ];
            }
{'fraction_non_alphanumeric': 0.1477074869413813, 'fraction_numerical': 0.035983749274521186, 'mean_word_length': 2.412871287128713, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3798955', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1154, 'n_words': 192}