| Total Complexity | 6 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class ObjectTest extends DbalTestCase |
||
| 13 | { |
||
| 14 | /** @var MockPlatform */ |
||
| 15 | private $platform; |
||
| 16 | |||
| 17 | /** @var Type */ |
||
| 18 | private $type; |
||
| 19 | |||
| 20 | protected function setUp() |
||
| 24 | } |
||
| 25 | |||
| 26 | public function testObjectConvertsToDatabaseValue() |
||
| 27 | { |
||
| 28 | self::assertInternalType('string', $this->type->convertToDatabaseValue(new stdClass(), $this->platform)); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function testObjectConvertsToPHPValue() |
||
| 32 | { |
||
| 33 | self::assertInternalType('object', $this->type->convertToPHPValue(serialize(new stdClass()), $this->platform)); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function testConversionFailure() |
||
| 37 | { |
||
| 38 | $this->expectException(ConversionException::class); |
||
| 39 | $this->expectExceptionMessage("Could not convert database value to 'object' as an error was triggered by the unserialization: 'unserialize(): Error at offset 0 of 7 bytes'"); |
||
| 40 | $this->type->convertToPHPValue('abcdefg', $this->platform); |
||
| 41 | } |
||
| 42 | |||
| 43 | public function testNullConversion() |
||
| 44 | { |
||
| 45 | self::assertNull($this->type->convertToPHPValue(null, $this->platform)); |
||
|
|
|||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @group DBAL-73 |
||
| 50 | */ |
||
| 51 | public function testFalseConversion() |
||
| 54 | } |
||
| 55 | } |
||
| 56 |
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.