Chris' books helped me to get over that horrible early bump in the road that you find when you're learning to test. He helped everything click and made me understand not just how to test, but why you should do it. I liked them so much I've bought copies for other people! Thank you, ChrisGary Hockin, Developer Relations at JetBrains
Minimum Viable Tests
You've been doing PHP development for a while but you find yourself constantly battling bugs, finding it hard to integrate bits of code together, and staying late to do deployments. You know there is a better way through test-driven development but you have no idea where to start.
You imagine yourself sitting down with an experienced developer -- just you and them, steadily working through problems and learning how to use test-driven development to design the API's and interfaces for your code while making sure nothing leaves development until you're 100% sure it's working.
In "Minimum Viable Tests" long-time PHP testing evangelist Chris Hartjes goes over what his experiences lead him to believe are the basic concepts surrounding test-driven development. You'll learn about:
- Chris' concept of "metatesting"
- The basics of what PHPUnit is and how it works
- The role of tests in the development process
- Effective use of test doubles
- Understanding how to mimic your application's environment via bootstrapping
- Writing wrappers around web API calls to make testing easier
- How fixtures and data providers help simplify your tests both today and tomorrow
- When you should use (and not abuse) monkey-patching tools
- The Arrange-Act-Assert test-writing strategy
- How to refactor existing tests
Chris has been watching and listening to people as they start their journey towards become test-driven developers. "Minimum Viable Tests" is designed to be your guide on the path to having well-tested, confidently-deployed PHP applications.
The Grumpy Programmer's PHPUnit Cookbook
Learning how to use PHPUnit doesn't have to suck
PHPUnit is the most commonly-used unit testing framework for PHP developers. While it's very powerful it also has a big learning curve. You know now is the time to master it but you have no where to start. There's lots of examples but you need some guidance on how to use it's features.
I'm a long-time PHP developer who has been promoting testing practices for almost a decade. For almost a decade I have spoken at conferences about best practices for writing tests and been recognized as an expert on unit testing. Now, I want to help you learn to use PHPUnit to create tests that give you confidence that your code is on the right track.
You'll know exactly how to tackle your existing code. You'll learn how to drive new features with your tests. You'll write tests that run fast and keep you moving quickly. Here's what I cover:
- How PHPUnit actually works
- Creating test doubles
- Creating data providers
- Data fixtures that grow along with your application
- How PHPUnit can be used to test API's
- Using DBUnit
- How to test exceptions
My new ebook "The Grumpy Programmer's PHPUnit Cookbook" is a collection of tips and tricks for making PHPUnit do what you need it do in order to write tests for your code. With the information contained in this book you will get a jump start to make writing tests something you do effortlessly.
We have a mailing list that you can join that drops some grumpy knowledge in your inbox roughly once every two weeks. We hate spam as much as you do, so we pledge to never give your email address to any third parties.