<commit_before><?php
namespace anlutro\Form\Tests;

use PHPUnit_Framework_TestCase;
use Mockery as m;
use Illuminate\Session\Store;
use Illuminate\Html\HtmlBuilder;
use anlutro\Form\Builder;
use anlutro\Form\Adapters\LaravelSessionAdapter;
use anlutro\Form\Adapters\LaravelValidationAdapter;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;

abstract class TestCase extends PHPUnit_Framework_TestCase
{
	protected $session;

	protected function makeForm($class)
	{
		$self = get_class($this);
		$namespace = substr($self, 0, strrpos($self, '\\'));
		$class = $namespace . '\\' . $class;

		return new $class($this->makeFormBuilder());
	}

	protected function makeFormBuilder()
	{
		$formBuilder = new Builder();
		$this->session = new Store('test', new NullSessionHandler);
		$formBuilder->setSession(new LaravelSessionAdapter($this->session));
		$this->validator = m::mock('Illuminate\Validation\Factory');
		$formBuilder->setValidationAdapter(new LaravelValidationAdapter($this->validator));
		return $formBuilder;
	}

	protected function mockRequest($form, array $input)
	{
		$mockRequest = m::mock('Symfony\Component\HttpFoundation\Request');
		$mockRequest->request = m::mock('Symfony\Component\HttpFoundation\ParameterBag');
		$mockRequest->request->shouldReceive('all')->andReturn($input);
		$form->getBuilder()->setRequest($mockRequest);
	}
}
<commit_msg>fix test<commit_after><?php
namespace anlutro\Form\Tests;

use PHPUnit_Framework_TestCase;
use Mockery as m;
use Illuminate\Session\Store;
use Illuminate\Html\HtmlBuilder;
use anlutro\Form\Builder;
use anlutro\Form\Adapters\LaravelSessionAdapter;
use anlutro\Form\Adapters\LaravelValidationAdapter;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;

abstract class TestCase extends PHPUnit_Framework_TestCase
{
	protected $session;

	protected function makeForm($class)
	{
		$self = get_class($this);
		$namespace = substr($self, 0, strrpos($self, '\\'));
		$class = $namespace . '\\' . $class;

		return new $class($this->makeFormBuilder());
	}

	protected function makeFormBuilder()
	{
		$formBuilder = new Builder();
		$this->session = new Store('test', new NullSessionHandler);
		$formBuilder->setSessionAdapter(new LaravelSessionAdapter($this->session));
		$this->validator = m::mock('Illuminate\Validation\Factory');
		$formBuilder->setValidationAdapter(new LaravelValidationAdapter($this->validator));
		return $formBuilder;
	}

	protected function mockRequest($form, array $input)
	{
		$mockRequest = m::mock('Symfony\Component\HttpFoundation\Request');
		$mockRequest->request = m::mock('Symfony\Component\HttpFoundation\ParameterBag');
		$mockRequest->request->shouldReceive('all')->andReturn($input);
		$form->getBuilder()->setRequest($mockRequest);
	}
}

{'fraction_non_alphanumeric': 0.14326647564469913, 'fraction_numerical': 0.0007163323782234957, 'mean_word_length': 6.548648648648649, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '3174038', 'n_tokens_mistral': 879, 'n_tokens_neox': 840, 'n_words': 147}