Example code for the talk "How (Not) to Write Testable Code" at WordCamp Nuremberg, 2016.
This package is auto-updated.
Last update: 2022-07-15 10:38:48 UTC
This repository contains example code for the according talk at WordCamp Nuremberg, 2016.
You want to run the tests yourself? Here's how:
$ yarn && yarn run test
$ npm i && npm run test
In order to run the PHP tests, you have to install the required Composer packages first.
$ composer install && vendor/bin/phpunit
Since only presenting bad (i.e., hard-to-test) code doesn't do any good, this repository also includes improved versions of the code. For each of the code examples, you can find an according pull request. By means of the diff view, you can easily compare the original and the improved code.
Feel free to fork this repository, and work on possible tests, if you like.
Copyright (c) 2016 Thorsten Frommen
This code is licensed under the MIT License.