<commit_before><?php

/*
 * This file is part of PHP CS Fixer.
 *
 * (c) <NAME> <<EMAIL>>
 *     <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace PhpCsFixer\Tests\Console\Output;

use PhpCsFixer\Console\Output\ErrorOutput;
use PhpCsFixer\Error\Error;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\StreamOutput;

/**
 * @author SpacePossum
 *
 * @internal
 *
 * @covers \PhpCsFixer\Console\Output\ErrorOutput
 */
final class ErrorOutputTest extends TestCase
{
    /**
     * @param Error  $error
     * @param int    $verbosityLevel
     * @param int    $lineNumber
     * @param int    $exceptionLineNumber
     * @param string $process
     *
     * @dataProvider provideTestCases
     */
    public function testErrorOutput(Error $error, $verbosityLevel, $lineNumber, $exceptionLineNumber, $process)
    {
        $source = $error->getSource();

        $output = new StreamOutput(fopen('php://memory', 'bw', false));
        $output->setDecorated(false);
        $output->setVerbosity($verbosityLevel);

        $errorOutput = new ErrorOutput($output);<commit_msg>Fix `fopen` mode<commit_after><?php

/*
 * This file is part of PHP CS Fixer.
 *
 * (c) <NAME> <<EMAIL>>
 *     <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace PhpCsFixer\Tests\Console\Output;

use PhpCsFixer\Console\Output\ErrorOutput;
use PhpCsFixer\Error\Error;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\StreamOutput;

/**
 * @author SpacePossum
 *
 * @internal
 *
 * @covers \PhpCsFixer\Console\Output\ErrorOutput
 */
final class ErrorOutputTest extends TestCase
{
    /**
     * @param Error  $error
     * @param int    $verbosityLevel
     * @param int    $lineNumber
     * @param int    $exceptionLineNumber
     * @param string $process
     *
     * @dataProvider provideTestCases
     */
    public function testErrorOutput(Error $error, $verbosityLevel, $lineNumber, $exceptionLineNumber, $process)
    {
        $source = $error->getSource();

        $output = new StreamOutput(fopen('php://memory', 'wb', false));
        $output->setDecorated(false);
        $output->setVerbosity($verbosityLevel);

        $errorOutput = new ErrorOutput($output);
{'fraction_non_alphanumeric': 0.12303980699638119, 'fraction_numerical': 0.0, 'mean_word_length': 3.3725834797891037, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, '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': '1070748', 'n_tokens_mistral': 772, 'n_tokens_neox': 759, 'n_words': 187}