InvalidArgumentExceptionTest.php 997 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php declare(strict_types=1);
  2. /*
  3. * This file is part of sebastian/diff.
  4. *
  5. * (c) Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace SebastianBergmann\Diff;
  11. use PHPUnit\Framework\TestCase;
  12. /**
  13. * @covers SebastianBergmann\Diff\InvalidArgumentException
  14. */
  15. final class InvalidArgumentExceptionTest extends TestCase
  16. {
  17. public function testInvalidArgumentException(): void
  18. {
  19. $previousException = new \LogicException();
  20. $message = 'test';
  21. $code = 123;
  22. $exception = new InvalidArgumentException($message, $code, $previousException);
  23. $this->assertInstanceOf(Exception::class, $exception);
  24. $this->assertSame($message, $exception->getMessage());
  25. $this->assertSame($code, $exception->getCode());
  26. $this->assertSame($previousException, $exception->getPrevious());
  27. }
  28. }