ProjectFixerConfigurationTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /*
  3. * This file is part of PHP CS Fixer.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. * Dariusz Rumiński <dariusz.ruminski@gmail.com>
  7. *
  8. * This source file is subject to the MIT license that is bundled
  9. * with this source code in the file LICENSE.
  10. */
  11. namespace PhpCsFixer\Tests\AutoReview;
  12. use PhpCsFixer\Console\ConfigurationResolver;
  13. use PhpCsFixer\Tests\TestCase;
  14. use PhpCsFixer\ToolInfo;
  15. /**
  16. * @author SpacePossum
  17. *
  18. * @internal
  19. *
  20. * @coversNothing
  21. * @group auto-review
  22. */
  23. final class ProjectFixerConfigurationTest extends TestCase
  24. {
  25. public function testCreate()
  26. {
  27. /** @var \PhpCsFixer\Config $config */
  28. $config = require __DIR__.'/../../.php_cs.dist';
  29. $this->assertInstanceOf(\PhpCsFixer\Config::class, $config);
  30. $this->assertEmpty($config->getCustomFixers());
  31. $this->assertNotEmpty($config->getRules());
  32. // call so the fixers get configured to reveal issue (like deprecated configuration used etc.)
  33. $resolver = new ConfigurationResolver(
  34. $config,
  35. [],
  36. __DIR__,
  37. new ToolInfo()
  38. );
  39. $resolver->getFixers();
  40. }
  41. }