<commit_before><?php
use \ParagonIE\AntiCSRF\AntiCSRF;

class AntiCSRFTest extends PHPUnit_Framework_TestCase
{
    /**
     * @covers AntiCSRF::insertToken()
     */
    public function testInsertToken()
    {
        $post = [];
        $session = [];
        $server = $_SERVER;

        $csrft = new AntiCSRF($post, $session, $server);
        $token_html = $csrft->insertToken('', false);
        
        $idx = $csrft->getSessionIndex();
        $this->assertFalse(
            empty($csrft->session[$idx])
        );

        $this->assertFalse(
            empty($session[$idx])
        );

        $this->assertContains("<input", $token_html);
    }

    /**
     * @covers AntiCSRF::getTokenArray()<commit_msg>Fix tests<commit_after><?php
use ParagonIE\AntiCSRF\AntiCSRF;
use PHPUnit\Framework\TestCase;

/**
 * Class AntiCSRFTest
 */
class AntiCSRFTest extends TestCase
{
    /**
     * @covers AntiCSRF::insertToken()
     */
    public function testInsertToken()
    {
        $post = [];
        $session = [];
        $server = $_SERVER;

        $csrft = new AntiCSRF($post, $session, $server);
        $token_html = $csrft->insertToken('', false);
        
        $idx = $csrft->getSessionIndex();
        $this->assertFalse(
            empty($csrft->session[$idx])
        );

        $this->assertFalse(
            empty($session[$idx])
        );

        $this->assertNotFalse(
            strpos($token_html, "<input")
        );
    }

    /**
     * @covers AntiCSRF::getTokenArray()
{'fraction_non_alphanumeric': 0.15751158173395102, 'fraction_numerical': 0.0, 'mean_word_length': 2.12396694214876, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '5864190', 'n_tokens_mistral': 480, 'n_tokens_neox': 467, 'n_words': 73}