/**
* @param int $expected
* @param string $code
* @param int $index
*
* @dataProvider provideCommentBlockStartDetectionCases
*/
public function testCommentBlockStartDetection($expected, $code, $index)
{
Tokens::clearCache();
$tokens = Tokens::fromCode($code);
$fixer = $this->getFixer();
$method = new \ReflectionMethod($fixer, 'findCommentBlockStart');
$method->setAccessible(true);
if ($expected !== ($result = $method->invoke($fixer, $tokens, $index))) {
$this->fail(sprintf('Expected index %d (%s) got index %d (%s).', $expected, $tokens[$expected]->toJson(), $result, $tokens[$result]->toJson()));
}
}