update MapperTypeTest

This commit is contained in:
Your Name
2024-10-19 18:38:33 +03:00
parent 53455912a8
commit 5eb9495529

View File

@@ -6,6 +6,7 @@ namespace App\Casting;
use App\Casting\Type\IntegerType; use App\Casting\Type\IntegerType;
use App\Casting\Type\StringType; use App\Casting\Type\StringType;
use App\Exception\Casting\TypeNotFountException;
use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
@@ -17,8 +18,8 @@ final class MapperTypeTest extends TestCase
$type = (new MapperType(MapperType::STRING))->create('value'); $type = (new MapperType(MapperType::STRING))->create('value');
self::assertInstanceOf( self::assertInstanceOf(
$type,
StringType::class, StringType::class,
$type,
); );
} }
@@ -27,8 +28,8 @@ final class MapperTypeTest extends TestCase
$type = (new MapperType(MapperType::INTEGER))->create(1); $type = (new MapperType(MapperType::INTEGER))->create(1);
self::assertInstanceOf( self::assertInstanceOf(
$type,
IntegerType::class, IntegerType::class,
$type,
); );
} }
@@ -37,8 +38,15 @@ final class MapperTypeTest extends TestCase
$type = (new MapperType(MapperType::INT))->create(1); $type = (new MapperType(MapperType::INT))->create(1);
self::assertInstanceOf( self::assertInstanceOf(
$type,
IntegerType::class, IntegerType::class,
$type,
); );
} }
public function testTypeNotFountException(): void
{
self::expectException(TypeNotFountException::class);
(new MapperType('type-exception'))->create('value');
}
} }