public function testHandOverTheLexificationToItsDecoratedLexerIfStringIsNotEmpty() { $value = 'bob'; $decoratedLexerProphecy = $this->prophesize(LexerInterface::class); $decoratedLexerProphecy->lex($value)->willReturn($expected = [new \stdClass()]); /** @var LexerInterface $decoratedLexer */ $decoratedLexer = $decoratedLexerProphecy->reveal(); $lexer = new EmptyValueLexer($decoratedLexer); $actual = $lexer->lex($value); $this->assertEquals(count($expected), count($actual)); $this->assertEquals($expected, $actual); $decoratedLexerProphecy->lex(Argument::any())->shouldHaveBeenCalledTimes(1); }