packages/sql-catalog/tests/Unit/Core/Php/FunctionShapeTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Core\Php;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\UsesClass;
9use PHPUnit\Framework\TestCase;
10use SqlCatalog\Core\Php\FunctionShape;
11use SqlCatalog\Core\Type\TypeShape;
12
13#[CoversClass(FunctionShape::class)]
14#[UsesClass(TypeShape::class)]
15final class FunctionShapeTest extends TestCase
16{
17 public function testKeepsWhatWasDeclared(): void
18 {
19 $shape = new FunctionShape('App\\find', [], TypeShape::of(['string']), null, 'src/a.php');
20 self::assertSame('App\\find', $shape->name);
21 self::assertSame('string', $shape->returnType->display());
22 self::assertSame('src/a.php', $shape->file);
23 }
24}
25