denormalize() public method

public denormalize ( $data, $class, $format = null, array $context = [] )
$context array
Example #1
0
 /**
  * @expectedException \ApiPlatform\Core\Exception\RuntimeException
  */
 public function testDonTSupportDenormalization()
 {
     $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class);
     $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class);
     $iriConverterProphecy = $this->prophesize(IriConverterInterface::class);
     $resourceClassResolverProphecy = $this->prophesize(ResourceClassResolverInterface::class);
     $normalizer = new ItemNormalizer($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $iriConverterProphecy->reveal(), $resourceClassResolverProphecy->reveal());
     $this->assertFalse($normalizer->supportsDenormalization('foo', ItemNormalizer::FORMAT));
     $normalizer->denormalize(['foo'], 'Foo');
 }