InvalidFrontMatterExceptionTest.php 866 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of the league/commonmark package.
  5. *
  6. * (c) Colin O'Dell <colinodell@gmail.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace League\CommonMark\Tests\Unit\Extension\FrontMatter\Exception;
  12. use League\CommonMark\Extension\FrontMatter\Exception\InvalidFrontMatterException;
  13. use PHPUnit\Framework\TestCase;
  14. final class InvalidFrontMatterExceptionTest extends TestCase
  15. {
  16. public function testWrap(): void
  17. {
  18. $previous = new \RuntimeException('Something bad happened');
  19. $ex = InvalidFrontMatterException::wrap($previous);
  20. $this->assertSame('Failed to parse front matter: Something bad happened', $ex->getMessage());
  21. $this->assertSame($previous, $ex->getPrevious());
  22. }
  23. }