/**
* @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,
'third' => AbstractDummyThirdChild::
class,
]);
$this->
assertEquals('first',
$mapping->
getMappedObjectType(AbstractDummyFirstChild::
class));