mirror of
https://github.com/danog/Valinor.git
synced 2024-12-15 10:27:02 +01:00
27 lines
817 B
PHP
27 lines
817 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\Mapper\Tree\Shell;
|
|
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`.");
|
|
|
|
(new RootNodeBuilder(new CasterNodeBuilder([])))->build(Shell::root($type, []));
|
|
}
|
|
}
|