OutputContextTest.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of PHP CS Fixer.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.com>
  7. * Dariusz Rumiński <dariusz.ruminski@gmail.com>
  8. *
  9. * This source file is subject to the MIT license that is bundled
  10. * with this source code in the file LICENSE.
  11. */
  12. namespace PhpCsFixer\Tests\Console\Output;
  13. use PhpCsFixer\Console\Output\OutputContext;
  14. use PhpCsFixer\Tests\TestCase;
  15. use Symfony\Component\Console\Output\NullOutput;
  16. /**
  17. * @internal
  18. *
  19. * @covers \PhpCsFixer\Console\Output\OutputContext
  20. */
  21. final class OutputContextTest extends TestCase
  22. {
  23. public function testProvidedValuesAreAccessible(): void
  24. {
  25. $output = new NullOutput();
  26. $width = 100;
  27. $filesCount = 10;
  28. $outputContext = new OutputContext($output, $width, $filesCount);
  29. self::assertSame($output, $outputContext->getOutput());
  30. self::assertSame($width, $outputContext->getTerminalWidth());
  31. self::assertSame($filesCount, $outputContext->getFilesCount());
  32. }
  33. }