<commit_before><commit_msg>add tests for textarea field<commit_after><?php

class TextareaTest extends \tests\cases\Field
{
    public function getInputProvider()
    {
        return [
            'simple field' => [
                [
                    'name' => 'test',
                ],
                '<textarea name="test"></textarea>'
            ],
            'field with attributes' => [
                [
                    'attributes' => [
                        'class' => 'test',
                        'data-param' => 1,
                    ],
                    'name' => 'test',
                ],
                '<textarea class="test" data-param="1" name="test"></textarea>'
            ],
            'xss in value' => [
                [
                    'name' => 'test',
                    'value' => '" onclick="alert(\'xss\')" data-param="',
                ],
                '<textarea name="test">&quot; onclick=&quot;alert(&#039;xss&#039;)&quot; data-param=&quot;</textarea>'
            ],
            'xss in attribute' => [
                [
                    'attributes' => [
                        'data-param' => '" onclick="alert(\'xss\')" data-param="',
                    ],
                    'name' => 'test',
                ],
                '<textarea data-param="&quot; onclick=&quot;alert(&#039;xss&#039;)&quot; data-param=&quot;" name="test"></textarea>'
            ],
        ];
    }


    protected function getField()
    {
        return new \serviform\fields\Textarea;
    }
}
{'fraction_non_alphanumeric': 0.16333118140735958, 'fraction_numerical': 0.009038089089735314, 'mean_word_length': 1.146814404432133, 'pattern_counts': {'":': 0, '<': 12, '<?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': '2751965', 'n_tokens_mistral': 432, 'n_tokens_neox': 389, 'n_words': 65}