Nelmio\Alice\FixtureBuilder\ExpressionLanguage\Parser\FunctionFixtureReferenceParserTest::testIfTheValueReturnedIsAListValueThenIteratesOverEachValuesToHandleFunctionFixtureReferences PHP Method

testIfTheValueReturnedIsAListValueThenIteratesOverEachValuesToHandleFunctionFixtureReferences() public method

    public function testIfTheValueReturnedIsAListValueThenIteratesOverEachValuesToHandleFunctionFixtureReferences()
    {
        $value = 'foo';
        $decoratedParserProphecy = $this->prophesize(ParserInterface::class);
        $decoratedParserProphecy->parse($value)->willReturn(new ListValue([new FakeValue(), new FixtureReferenceValue('bob'), new FunctionCallValue('f'), new FakeValue(), new FunctionCallValue('i'), new FixtureReferenceValue('alice'), new FakeValue(), new FixtureReferenceValue('mad'), new FakeValue(), new FunctionCallValue('g'), new FakeValue(), new FixtureReferenceValue('hatter'), new FunctionCallValue('h')]));
        /** @var ParserInterface $decoratedParser */
        $decoratedParser = $decoratedParserProphecy->reveal();
        $expected = new ListValue([new FakeValue(), new FixtureReferenceValue(new ListValue(['bob', new FunctionCallValue('f')])), new FakeValue(), new FunctionCallValue('i'), new FixtureReferenceValue('alice'), new FakeValue(), new FixtureReferenceValue('mad'), new FakeValue(), new FunctionCallValue('g'), new FakeValue(), new FixtureReferenceValue(new ListValue(['hatter', new FunctionCallValue('h')]))]);
        $parser = new FunctionFixtureReferenceParser($decoratedParser);
        $actual = $parser->parse($value);
        $this->assertEquals($expected, $actual);
        $decoratedParserProphecy->parse(Argument::any())->shouldHaveBeenCalledTimes(1);
    }