mirror of
https://github.com/danog/Valinor.git
synced 2024-12-12 17:17:25 +01:00
27 lines
840 B
PHP
27 lines
840 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace CuyZ\Valinor\Tests\Unit\Mapper\Tree\Builder;
|
|
|
|
use CuyZ\Valinor\Mapper\Tree\Builder\CasterNodeBuilder;
|
|
use CuyZ\Valinor\Mapper\Tree\Builder\RootNodeBuilder;
|
|
use CuyZ\Valinor\Mapper\Tree\Exception\NoCasterForType;
|
|
use CuyZ\Valinor\Tests\Fake\Mapper\FakeShell;
|
|
use CuyZ\Valinor\Tests\Fake\Type\FakeType;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class CasterNodeBuilderTest extends TestCase
|
|
{
|
|
public function test_no_caster_found_throws_exception(): void
|
|
{
|
|
$type = new FakeType();
|
|
|
|
$this->expectException(NoCasterForType::class);
|
|
$this->expectExceptionCode(1630693475);
|
|
$this->expectExceptionMessage("No caster was found to convert to type `{$type->toString()}`.");
|
|
|
|
(new RootNodeBuilder(new CasterNodeBuilder([])))->build(FakeShell::new($type));
|
|
}
|
|
}
|