The other week, I was asked about how I maintain my PHPUnit config file for my Drupal projects. When running Drupal’s PHPUnit test suites, you typically copy and modify the distribution
phpunit.xml.distfile which lives in the
web/coresubdirectory. There is just one problem. This directory is technically a vendor directory and is replaced during any updates to the
drupal/coredependency of your Drupal project. Every minor version will cause your file to reset, or anytime you install dependencies if Drupal core is patched.
One thing I noticed is that since I first followed your tuts a while back, my phpunit.xml is gone. I’m guessing it gets overwritten when core is updated. Do you just keep a copy of the file and paste it in when that happens? Is there a better solution?