<?php namespace Doctrine\DBAL\Tests\Types; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\SmallIntType; use Doctrine\DBAL\Types\Type; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class SmallIntTest extends TestCase { /** @var AbstractPlatform|MockObject */ private $platform; /** @var SmallIntType */ private $type; protected function setUp(): void { $this->platform = $this->createMock(AbstractPlatform::class); $this->type = Type::getType('smallint'); } public function testSmallIntConvertsToPHPValue(): void { self::assertIsInt($this->type->convertToPHPValue('1', $this->platform)); self::assertIsInt($this->type->convertToPHPValue('0', $this->platform)); } public function testSmallIntNullConvertsToPHPValue(): void { self::assertNull($this->type->convertToPHPValue(null, $this->platform)); } }