/** * @param string $data */ public function unserialize($data) { $properties = (array) Serializer::create(Serializer::TYPE_IGBINARY)->unserialize($data); foreach ($properties as $name => $value) { Inspect::this($this)->getProperty($name)->setValue($this, $value); } }
public function testNotSupported() { $serializer = Serializer::create(SerializerTypeNotSupported::class); $this->assertInstanceOf(SerializerInterface::class, $serializer); $this->assertTrue($serializer->hasDefaultSerializer()); $serializer = Serializer::create(); $this->assertFalse($serializer->hasDefaultSerializer()); }