packages/sql-catalog/tests/Unit/Core/Source/SourceScanExceptionTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Core\Source;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\TestCase;
9use SqlCatalog\Core\Source\SourceScanException;
10
11#[CoversClass(SourceScanException::class)]
12final class SourceScanExceptionTest extends TestCase
13{
14 public function testMessageNamesThePathAndTheReason(): void
15 {
16 $exception = new SourceScanException('missing', 'no such file or directory');
17 self::assertSame('Cannot read "missing": no such file or directory.', $exception->getMessage());
18 self::assertSame('missing', $exception->path);
19 }
20}
21