1 | <?php |
||
2 | |||
3 | namespace Doctrine\Tests\DBAL\Types; |
||
4 | |||
5 | use Doctrine\DBAL\Platforms\AbstractPlatform; |
||
6 | use Doctrine\DBAL\Types\SmallIntType; |
||
7 | use Doctrine\DBAL\Types\Type; |
||
8 | use Doctrine\Tests\DbalTestCase; |
||
9 | use PHPUnit\Framework\MockObject\MockObject; |
||
10 | |||
11 | class SmallIntTest extends DbalTestCase |
||
12 | { |
||
13 | /** @var AbstractPlatform|MockObject */ |
||
14 | private $platform; |
||
15 | |||
16 | /** @var SmallIntType */ |
||
17 | private $type; |
||
18 | |||
19 | protected function setUp() : void |
||
20 | { |
||
21 | $this->platform = $this->createMock(AbstractPlatform::class); |
||
22 | $this->type = Type::getType('smallint'); |
||
23 | } |
||
24 | |||
25 | public function testSmallIntConvertsToPHPValue() |
||
26 | { |
||
27 | self::assertIsInt($this->type->convertToPHPValue('1', $this->platform)); |
||
28 | self::assertIsInt($this->type->convertToPHPValue('0', $this->platform)); |
||
29 | } |
||
30 | |||
31 | public function testSmallIntNullConvertsToPHPValue() |
||
32 | { |
||
33 | self::assertNull($this->type->convertToPHPValue(null, $this->platform)); |
||
0 ignored issues
–
show
|
|||
34 | } |
||
35 | } |
||
36 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.