use Symfony\Component\Serializer\Tests\Fixtures\Attributes\AbstractDummyFirstChild;
use Symfony\Component\Serializer\Tests\Fixtures\Attributes\AbstractDummySecondChild;
use Symfony\Component\Serializer\Tests\Fixtures\Attributes\AbstractDummyThirdChild;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*/
class ClassDiscriminatorMappingTest extends TestCase
{ public function testGetClass() { $mapping =
new ClassDiscriminatorMapping('type',
[ 'first' => AbstractDummyFirstChild::
class,
]);
$this->
assertEquals(AbstractDummyFirstChild::
class,
$mapping->
getClassForType('first'
));
$this->
assertNull($mapping->
getClassForType('second'
));
} public function testMappedObjectType() { $mapping =
new ClassDiscriminatorMapping('type',
[ 'first' => AbstractDummyFirstChild::
class,