ApiPlatform\Core\Tests\Serializer\AbstractItemNormalizerTest::testJsonAllowIntAsFloat PHP Method

testJsonAllowIntAsFloat() public method

    public function testJsonAllowIntAsFloat()
    {
        $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class);
        $propertyNameCollectionFactoryProphecy->create(Dummy::class, [])->willReturn(new PropertyNameCollection(['foo']))->shouldBeCalled();
        $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class);
        $propertyMetadataFactoryProphecy->create(Dummy::class, 'foo', [])->willReturn(new PropertyMetadata(new Type(Type::BUILTIN_TYPE_FLOAT), '', false, true, false, false))->shouldBeCalled();
        $iriConverterProphecy = $this->prophesize(IriConverterInterface::class);
        $propertyAccessorProphecy = $this->prophesize(PropertyAccessorInterface::class);
        $propertyAccessorProphecy->setValue(Argument::type(Dummy::class), 'foo', 42)->shouldBeCalled();
        $resourceClassResolverProphecy = $this->prophesize(ResourceClassResolverInterface::class);
        $serializerProphecy = $this->prophesize(SerializerInterface::class);
        $serializerProphecy->willImplement(DenormalizerInterface::class);
        $normalizer = $this->getMockForAbstractClass(AbstractItemNormalizer::class, [$propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $iriConverterProphecy->reveal(), $resourceClassResolverProphecy->reveal(), $propertyAccessorProphecy->reveal()]);
        $normalizer->setSerializer($serializerProphecy->reveal());
        $normalizer->denormalize(['foo' => 42], Dummy::class, 'jsonfoo');
    }