packages/sql-fixture/tests/Unit/Hydrator/Exception/ClassNotFoundExceptionTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Hydrator\Exception;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\UsesClass;
9use PHPUnit\Framework\TestCase;
10
11#[CoversClass(\SqlFixture\Hydrator\Exception\ClassNotFoundException::class)]
12#[UsesClass(\SqlFixture\Hydrator\HydrationException::class)]
13#[UsesClass(\SqlFixture\Hydrator\Exception\MissingConstructorArgumentException::class)]
14final class ClassNotFoundExceptionTest extends TestCase
15{
16    public function testDescribesClassNotFound(): void
17    {
18        $exception = new \SqlFixture\Hydrator\Exception\ClassNotFoundException('NonExistentClass');
19        self::assertSame('Class not found: NonExistentClass', $exception->getMessage());
20        self::assertSame('NonExistentClass', $exception->className);
21    }
22}
23