FactoryGirl\Provider\Doctrine\DBAL\Types\StatusArrayType::convertToPHPValue PHP Method

convertToPHPValue() public method

public convertToPHPValue ( $value, Doctrine\DBAL\Platforms\AbstractPlatform $platform )
$platform Doctrine\DBAL\Platforms\AbstractPlatform
    public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform)
    {
        if ($value === null) {
            return null;
        }
        $ret = explode(';', $value);
        array_walk($ret, function (&$unwashed) {
            $unwashed = trim($unwashed, '[]');
        });
        return $ret;
    }

Usage Example

 /**
  * @test
  * @dataProvider provideSerializedValues
  */
 public function valuesShouldDeserializeProperly($expected, $serialized)
 {
     $deserialized = $this->type->convertToPHPValue($serialized, $this->platform);
     $this->assertSame($expected, $deserialized);
 }