<commit_before><?php

namespace s9e\TextFormatter\Tests\Configurator\TemplateNormalizations;

use DOMDocument;
use s9e\TextFormatter\Configurator\TemplateNormalizations\Custom;
use s9e\TextFormatter\Tests\Test;

/**
* @covers s9e\TextFormatter\Configurator\TemplateNormalizations\Custom
*/
class CustomTest extends Test
{
	/**
	* @testdox Constructor expects a valid callback
	* @expectedException PHPUnit_Framework_Error
	* @expectedExceptionMessage callable, string given
	*/
	public function testInvalidCallback()
	{
		if (version_compare(PHP_VERSION, '6', '>='))
		{
			$this->markTestSkipped('Triggers a fatal error on PHP 7');
		}
		new Custom('*invalid*');
	}

	/**
	* @testdox normalize() calls the user-defined callback with a DOMElement as argument
	*/
	public function testNormalize()
	{
		$dom = new DOMDocument;<commit_msg>Removed test because bad type hinting does not seem to be recoverable anymore.<commit_after><?php

namespace s9e\TextFormatter\Tests\Configurator\TemplateNormalizations;

use DOMDocument;
use s9e\TextFormatter\Configurator\TemplateNormalizations\Custom;
use s9e\TextFormatter\Tests\Test;

/**
* @covers s9e\TextFormatter\Configurator\TemplateNormalizations\Custom
*/
class CustomTest extends Test
{
	/**
	* @testdox normalize() calls the user-defined callback with a DOMElement as argument
	*/
	public function testNormalize()
	{
		$dom = new DOMDocument;
{'fraction_non_alphanumeric': 0.10208483105679367, 'fraction_numerical': 0.007189072609633357, 'mean_word_length': 5.5046728971962615, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5322237', 'n_tokens_mistral': 436, 'n_tokens_neox': 424, 'n_words': 102}