<commit_before><?php

namespace KarlosAgudo\Fixtro\Tests\CodeQualityTool\Checkers;

use KarlosAgudo\Fixtro\CodeQualityTool\Checker\CodeStyleFixer;

class CodeStyleFixerTest extends GeneralCheckerTestCase
{
	public function testFunctionalOk()
	{
		$filesToAnalyzer = [__DIR__ . '/../CodeExamples/CodeStylePhp/Good.php'];
		$exit = $this->executeChecker($filesToAnalyzer, CodeStyleFixer::class);

		self::assertEquals($exit, [[], []]);
	}

	public function testFunctionalKo()
	{
		$filesToAnalyzer = [__DIR__ . '/../CodeExamples/CodeStylePhp/Bad.php'];
		$this->parameters = [
			'extraParams' => '--dry-run',
			'afterParams' => ' --diff',
		];

		$exit = $this->executeChecker($filesToAnalyzer, CodeStyleFixer::class, true);

		self::assertContains('---------- begin diff ----------', $exit[0][2]);
	}
}<commit_msg>Trying to solve strange behaviour in test in travis with php7.0<commit_after><?php

namespace KarlosAgudo\Fixtro\Tests\CodeQualityTool\Checkers;

use KarlosAgudo\Fixtro\CodeQualityTool\Checker\CodeStyleFixer;

class CodeStyleFixerTest extends GeneralCheckerTestCase
{
	public function testFunctionalOk()
	{
		$filesToAnalyzer = [__DIR__ . '/../CodeExamples/CodeStylePhp/Good.php'];
		$exit = $this->executeChecker($filesToAnalyzer, CodeStyleFixer::class);

		self::assertEquals($exit, [[], []]);
	}

	public function testFunctionalKo()
	{
		$filesToAnalyzer = [__DIR__ . '/../CodeExamples/CodeStylePhp/Bad.php'];
		$this->parameters = [
			'extraParams' => '--dry-run',
			'afterParams' => ' --diff',
		];

		$exit = $this->executeChecker($filesToAnalyzer, CodeStyleFixer::class, true);

		self::assertContains('/Bad.php', $exit[0][2]);
	}
}
{'fraction_non_alphanumeric': 0.17451690821256038, 'fraction_numerical': 0.0036231884057971015, 'mean_word_length': 4.896797153024911, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '7483007', 'n_tokens_mistral': 594, 'n_tokens_neox': 557, 'n_words': 84}