<?php declare(strict_types=1);

namespace Rector\Tests\Rector\Argument\ArgumentAdderRector;

use Rector\Rector\Argument\ArgumentAdderRector;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Rector\Tests\Rector\Argument\ArgumentAdderRector\Source\SomeContainerBuilder;

final class ArgumentAdderRectorTest extends AbstractRectorTestCase
{
    public function test(): void
    {
        $this->doTestFiles([
            __DIR__ . '/Fixture/fixture.php.inc',
            __DIR__ . '/Fixture/fixture2.php.inc',
            __DIR__ . '/Fixture/fixture3.php.inc',
            __DIR__ . '/Fixture/already_added.php.inc',
        ]);
    }

    /**
     * @return mixed[]
     */
    protected function getRectorsWithConfiguration(): array
    {
        return [ArgumentAdderRector::class => [
            '$positionWithDefaultValueByMethodNamesByClassTypes' => [
                SomeContainerBuilder::class => [
                    'compile' => [
                        0 => [
                            'name' => 'isCompiled',
                            'default_value' => false,
                        ],
                    ],
                    'addCompilerPass' => [
                        2 => [
                            'name' => 'priority',
                            'default_value' => 0,
                            'type' => 'int',
                        ],
                    ],
                ],
            ],
        ]];
    }
}
