ProcessLinterTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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\Linter;
  13. use PhpCsFixer\Linter\LinterInterface;
  14. use PhpCsFixer\Linter\ProcessLinter;
  15. /**
  16. * @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
  17. *
  18. * @internal
  19. *
  20. * @covers \PhpCsFixer\Linter\ProcessLinter
  21. * @covers \PhpCsFixer\Linter\ProcessLintingResult
  22. */
  23. final class ProcessLinterTest extends AbstractLinterTestCase
  24. {
  25. public function testIsAsync(): void
  26. {
  27. self::assertTrue($this->createLinter()->isAsync());
  28. }
  29. public function testSleep(): void
  30. {
  31. $this->expectException(\BadMethodCallException::class);
  32. $this->expectExceptionMessage('Cannot serialize PhpCsFixer\Linter');
  33. $linter = new ProcessLinter();
  34. $linter->__sleep();
  35. }
  36. public function testWakeup(): void
  37. {
  38. $this->expectException(\BadMethodCallException::class);
  39. $this->expectExceptionMessage('Cannot unserialize PhpCsFixer\Linter');
  40. $linter = new ProcessLinter();
  41. $linter->__wakeup();
  42. }
  43. protected function createLinter(): LinterInterface
  44. {
  45. return new ProcessLinter();
  46. }
  47. }