Nelmio\Alice\FixtureBuilder\ExpressionLanguage\Lexer\ReferenceEscaperLexerTest::testEscapesStringBeforeHandlingItOverToTheDecoratedLexer PHP Method

testEscapesStringBeforeHandlingItOverToTheDecoratedLexer() public method

public testEscapesStringBeforeHandlingItOverToTheDecoratedLexer ( string $value, string $expectedEscapedValue = null )
$value string
$expectedEscapedValue string
    public function testEscapesStringBeforeHandlingItOverToTheDecoratedLexer(string $value, string $expectedEscapedValue = null)
    {
        if (null === $expectedEscapedValue) {
            $expectedEscapedValue = $value;
        }
        $decoratedLexerProphecy = $this->prophesize(LexerInterface::class);
        $decoratedLexerProphecy->lex($expectedEscapedValue)->willReturn($expected = [new \stdClass()]);
        /** @var LexerInterface $decoratedLexer */
        $decoratedLexer = $decoratedLexerProphecy->reveal();
        $lexer = new ReferenceEscaperLexer($decoratedLexer);
        $actual = $lexer->lex($value);
        $this->assertEquals($expected, $actual);
        $decoratedLexerProphecy->lex(Argument::any())->shouldHaveBeenCalledTimes(1);
    }