Nelmio\Alice\FixtureBuilder\ExpressionLanguage\Lexer\FunctionLexerTest::testTokenizeValueBeforePassingItToTheDecoratedLexer PHP Метод

testTokenizeValueBeforePassingItToTheDecoratedLexer() публичный Метод

    public function testTokenizeValueBeforePassingItToTheDecoratedLexer()
    {
        $value = '<foo()>';
        $decoratedLexerProphecy = $this->prophesize(LexerInterface::class);
        $decoratedLexerProphecy->lex('<aliceTokenizedFunction(FUNCTION_START__foo__IDENTITY_OR_FUNCTION_END)>')->willReturn($expected = [new Token('something', new TokenType(TokenType::FUNCTION_TYPE))]);
        /** @var LexerInterface $decoratedLexer */
        $decoratedLexer = $decoratedLexerProphecy->reveal();
        $lexer = new FunctionLexer($decoratedLexer);
        $actual = $lexer->lex($value);
        $this->assertEquals($expected, $actual);
        $decoratedLexerProphecy->lex(Argument::any())->shouldHaveBeenCalledTimes(1);
    }