Nelmio\Alice\FixtureBuilder\Denormalizer\Fixture\SpecificationBagDenormalizer\SimpleSpecificationsDenormalizerTest::testCanDenormalizeCalls PHP Method

testCanDenormalizeCalls() public method

    public function testCanDenormalizeCalls()
    {
        $fixture = new FakeFixture();
        $specs = ['__calls' => [['setLocation' => $setLocationArgs = ['<latitude()>', '<longitude()>']]]];
        $flagParser = new FakeFlagParser();
        $callsDenormalizerProphecy = $this->prophesize(CallsDenormalizerInterface::class);
        $callsDenormalizerProphecy->denormalize($fixture, $flagParser, 'setLocation', $setLocationArgs)->willReturn($call = new NoMethodCall());
        /** @var CallsDenormalizerInterface $callsDenormalizer */
        $callsDenormalizer = $callsDenormalizerProphecy->reveal();
        $expected = new SpecificationBag(null, new PropertyBag(), (new MethodCallBag())->with($call));
        $denormalizer = new SimpleSpecificationsDenormalizer(new FakeConstructorDenormalizer(), new FakePropertyDenormalizer(), $callsDenormalizer);
        $actual = $denormalizer->denormalize(new FakeFixture(), $flagParser, $specs);
        $this->assertEquals($expected, $actual);
        $callsDenormalizerProphecy->denormalize(Argument::cetera())->shouldHaveBeenCalledTimes(1);
    }