You can dynamically parse PHP code with tokenizer or library like nikic/php-parser to extract method names and their leading lines from a test data class.
Map methods to expected errors. Specify which methods in your test data should generate errors and which should not, using their names rather than line numbers.