/** * @dataProvider provideTestHaltCompiler */ public function testHandleHaltCompiler($code, $remaining) { $this->lexer->startLexing($code); while (PHPParser_Parser::T_HALT_COMPILER !== $this->lexer->getNextToken()) { } $this->assertEquals($this->lexer->handleHaltCompiler(), $remaining); $this->assertEquals(0, $this->lexer->getNextToken()); }
public function startLexing($code) { $this->inObjectAccess = false; // on PHP 5.4 don't do anything if (version_compare(PHP_VERSION, '5.4.0RC1', '>=')) { parent::startLexing($code); } else { $code = $this->preprocessCode($code); parent::startLexing($code); $this->postprocessTokens(); } }