Nelmio\Alice\Generator\Resolver\Value\Chainable\ListValueResolverTest::testResolvesAllTheValuesInArrayBeforeImplodingIt PHP Method

testResolvesAllTheValuesInArrayBeforeImplodingIt() public method

    public function testResolvesAllTheValuesInArrayBeforeImplodingIt()
    {
        $value = new ListValue(['a', new FakeValue(), 'c', new FakeValue()]);
        $fixture = new FakeFixture();
        $set = ResolvedFixtureSetFactory::create(new ParameterBag(['foo' => 'bar']));
        $scope = ['scope' => 'epocs'];
        $context = new GenerationContext();
        $context->markIsResolvingFixture('foo');
        $valueResolverProphecy = $this->prophesize(ValueResolverInterface::class);
        $valueResolverProphecy->resolve(new FakeValue(), $fixture, $set, $scope, $context)->willReturn(new ResolvedValueWithFixtureSet('b', $newSet = ResolvedFixtureSetFactory::create(new ParameterBag(['foo' => 'baz']))));
        $valueResolverProphecy->resolve(new FakeValue(), $fixture, $newSet, $scope, $context)->willReturn(new ResolvedValueWithFixtureSet('d', $newSet2 = ResolvedFixtureSetFactory::create(new ParameterBag(['foo' => 'zab']))));
        /** @var ValueResolverInterface $valueResolver */
        $valueResolver = $valueResolverProphecy->reveal();
        $expected = new ResolvedValueWithFixtureSet('abcd', $newSet2);
        $resolver = new ListValueResolver($valueResolver);
        $actual = $resolver->resolve($value, $fixture, $set, $scope, $context);
        $this->assertEquals($expected, $actual);
        $valueResolverProphecy->resolve(Argument::cetera())->shouldHaveBeenCalledTimes(2);
    }