form_validation_module_refactor_srp

This repository builds on a previous repository (https://github.com/PilotProgrammer/form_validation_unit_test_module), in showing how to safely use unit tests to refactor a Drupal 8 form to more closely align it's validation logic with the Single Responsibility Principle.

Please see the following 3-part companion articles for further details - "TDD your Legacy Code to Single Responsibility Principle." --

  1. Part 1 – Setup and Planning (http://pilotprogrammer.com/archive/2016/12/programmers-tdd-legacy-code-single-responsibility-principle-part-1-setup-planning/)
  2. Part 2 – The Glorious TDD Cycle (http://pilotprogrammer.com/archive/2016/12/programmers-tdd-legacy-code-single-responsibility-principle-part-2-glorious-tdd-cycle/)
  3. Part 3 – Dependency Injection For the New Class and Wrap Up (http://pilotprogrammer.com/archive/2016/12/programmers-tdd-legacy-code-single-responsibility-principle-part-3-dependency-injection-new-class-wrap/)