$line) { if (strncmp('- ', $line, 2) === 0) { $result[] = [$line]; } if ($i > $lastIndex) { break; } } return $result; } /** * @dataProvider changeProvider */ public function testContributorLine($line) { /** * Each change line is tested for: * - Starts with "- " * - Has a type: Bug, Enh, Chg, New * - Has a number formatted like #12345 * - Description starts after ": " * - Description ends without a "." * - Line ends with contributor name between "(" and ")". */ $this->assertRegExp('/- (Bug|Enh|Chg|New)( #\d+(, #\d+)*)?: .*[^.] \(.*\)$/', $line); } }