Valinor/tests/Unit/Definition/Repository/Cache/Compiler/ClassDefinitionCompilerTest.php
Romain Canon 396f64a524 feat: initial release
🎉
2021-11-28 18:21:56 +01:00

37 lines
892 B
PHP

<?php
declare(strict_types=1);
namespace CuyZ\Valinor\Tests\Unit\Definition\Repository\Cache\Compiler;
use AssertionError;
use CuyZ\Valinor\Definition\Repository\Cache\Compiler\ClassDefinitionCompiler;
use PHPUnit\Framework\TestCase;
use stdClass;
final class ClassDefinitionCompilerTest extends TestCase
{
private ClassDefinitionCompiler $compiler;
protected function setUp(): void
{
parent::setUp();
$this->compiler = new ClassDefinitionCompiler();
}
public function test_compile_wrong_type_fails_assertion(): void
{
$this->expectException(AssertionError::class);
$this->compiler->compile(new stdClass());
}
public function test_compile_validation_for_wrong_type_fails_assertion(): void
{
$this->expectException(AssertionError::class);
$this->compiler->compileValidation(new stdClass());
}
}