Split the code and added a test
1 unresolved thread
1 unresolved thread
Closes #3204558
Merge request reports
Activity
added 107 commits
-
356964cc...148d8ddb - 106 commits from branch
project:11.x
- f547afb4 - Merged 11.x
-
356964cc...148d8ddb - 106 commits from branch
521 498 return $result; 522 499 } 523 500 501 /** 502 * Gets the default handlers for a field's data column. 503 * 504 * @param string $column_type 505 * The type of data stored in the field's database table column. 506 * @param string $field_type 507 * The ID of the field's type plugin. 508 * 509 * @return string[] 510 * An array containing the IDs of Views handlers in the following order: 511 * filter, argument, sort. 512 */ 513 public function getHandlers(string $column_type, string $field_type): array { @smustgrave I started to write a test and then decided "There is no way I'm writing a Unit test that covers an entire, complicated, nearly 500 line function." So I split the offending code out into its own function in the same class.
defaultFieldImplementation() is too big as it is. If we want this code to be more testable, then it needs to be broken up. This is just one step toward doing that. No, it isn't strictly necessary from a functionality standpoint. But I will argue that it's necessary for sanity.
Please register or sign in to reply