|
@@ -30,6 +30,7 @@ use JMS\Serializer\Tests\Fixtures\Garage;
|
|
|
use JMS\Serializer\Tests\Fixtures\InlineChildEmpty;
|
|
|
use JMS\Serializer\Tests\Fixtures\NamedDateTimeArraysObject;
|
|
|
use JMS\Serializer\Tests\Fixtures\Tree;
|
|
|
+use JMS\Serializer\Tests\Fixtures\VehicleInterfaceGarage;
|
|
|
use PhpCollection\Sequence;
|
|
|
use Symfony\Component\Form\FormFactoryBuilder;
|
|
|
use Symfony\Component\Translation\MessageSelector;
|
|
@@ -844,6 +845,28 @@ abstract class BaseSerializationTest extends \PHPUnit_Framework_TestCase
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @group polymorphic
|
|
|
+ */
|
|
|
+ public function testNestedPolymorphicInterfaces()
|
|
|
+ {
|
|
|
+ $garage = new VehicleInterfaceGarage(array(new Car(3), new Moped(1)));
|
|
|
+ $this->assertEquals(
|
|
|
+ $this->getContent('garage'),
|
|
|
+ $this->serialize($garage)
|
|
|
+ );
|
|
|
+
|
|
|
+ if ($this->hasDeserializer()) {
|
|
|
+ $this->assertEquals(
|
|
|
+ $garage,
|
|
|
+ $this->deserialize(
|
|
|
+ $this->getContent('garage'),
|
|
|
+ 'JMS\Serializer\Tests\Fixtures\VehicleInterfaceGarage'
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @group polymorphic
|
|
|
* @expectedException LogicException
|