ErrorTest.php 1000 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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\Error;
  12. use PhpCsFixer\Error\Error;
  13. use PHPUnit\Framework\TestCase;
  14. /**
  15. * @internal
  16. *
  17. * @covers \PhpCsFixer\Error\Error
  18. */
  19. final class ErrorTest extends TestCase
  20. {
  21. public function testThatErrorTypeConstantValuesAreDifferent()
  22. {
  23. $this->assertNotSame(Error::TYPE_INVALID, Error::TYPE_EXCEPTION);
  24. $this->assertNotSame(Error::TYPE_EXCEPTION, Error::TYPE_LINT);
  25. }
  26. public function testConstructorSetsValues()
  27. {
  28. $type = 123;
  29. $filePath = 'foo.php';
  30. $error = new Error(
  31. $type,
  32. $filePath
  33. );
  34. $this->assertSame($type, $error->getType());
  35. $this->assertSame($filePath, $error->getFilePath());
  36. }
  37. }