Nelmio\Alice\FixtureBuilder\Denormalizer\Fixture\SpecificationBagDenormalizer\Constructor\ConstructorWithCallerDenormalizerTest::testCanDenormalizeSelfStaticFactoriesConstructor PHP Method

testCanDenormalizeSelfStaticFactoriesConstructor() public method

    public function testCanDenormalizeSelfStaticFactoriesConstructor()
    {
        $constructor = ['create' => $arguments = ['<latitude()>', '1 (unique)' => '<longitude()>']];
        $fixtureProphecy = $this->prophesize(FixtureInterface::class);
        $fixtureProphecy->getClassName()->willReturn('Nelmio\\Alice\\Entity\\User');
        /** @var FixtureInterface $fixture */
        $fixture = $fixtureProphecy->reveal();
        $flagParser = new FakeFlagParser();
        $argumentsDenormalizerProphecy = $this->prophesize(ArgumentsDenormalizerInterface::class);
        $argumentsDenormalizerProphecy->denormalize($fixture, $flagParser, $arguments)->willReturn($arguments);
        /** @var ArgumentsDenormalizerInterface $argumentsDenormalizer */
        $argumentsDenormalizer = $argumentsDenormalizerProphecy->reveal();
        $expected = new MethodCallWithReference(new StaticReference('Nelmio\\Alice\\Entity\\User'), 'create', $arguments);
        $denormalizer = new ConstructorWithCallerDenormalizer(new SimpleConstructorDenormalizer($argumentsDenormalizer));
        $actual = $denormalizer->denormalize($fixture, $flagParser, $constructor);
        $this->assertEquals($expected, $actual);
    }