/**
* This method tests that the parser does not substitute keyword tokens in
* a class or object operator chain.
*
* @param string $sourceFile Name of the text file.
* @param array(integer) $tokenTypes List of all expected token types.
*
* @return void
* @dataProvider dataProviderTokenizerKeywordSubstitutionInOperatorChain
*/
public function testTokenizerKeywordSubstitutionInOperatorChain($sourceFile, array $tokenTypes)
{
$tokenizer = new PHPTokenizerInternal();
$tokenizer->setSourceFile($this->createCodeResourceURI($sourceFile));
$actual = array();
while (is_object($token = $tokenizer->next())) {
$actual[] = $token->type;
}
$this->assertEquals($tokenTypes, $actual);
}