How to setup headless selenium with chromedriver for PHPUnit tests

Setting up Selenium with chromedriver for PHPUnit tests was causing me some headaches. Lots of Googling and experimenting later I have it working stably and you can borrow all of the config/files I used from GitHub.