packages/deriver/tests/Unit/Exception/CollectorExceptionTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Exception;
6
7use Deriver\Deriver\Sources\Collector;
8use Deriver\Exception\CollectorException;
9use PHPUnit\Framework\Attributes\CoversClass;
10use PHPUnit\Framework\Attributes\Small;
11use PHPUnit\Framework\Attributes\UsesClass;
12use PHPUnit\Framework\TestCase;
13
14#[CoversClass(CollectorException::class)]
15#[UsesClass(Collector::class)]
16#[Small]
17final class CollectorExceptionTest extends TestCase
18{
19    public function testReportsAnUnavailableFile(): void
20    {
21        $this->expectException(CollectorException::class);
22        $this->expectExceptionMessage('does-not-exist.php');
23        (new Collector())->collect([__DIR__ . '/does-not-exist.php']);
24    }
25}
26