API's Need Tests Too!
API's Need Tests Too!
About the Bundle
APIs form the backbone of online applications at a time where multiple front-ends are becoming business-as-usual so learning to create them in a way so you don't hate yourself later is important. But a good API isn't enough -- you need to be able to test what you've done so pushes to production are no longer stressful and changes don't break what you've already built.
This bundle gives you the building blocks for creating well-designed and properly-tested API's written in PHP. Phil Sturgeon and Chris Hartjes have more than 25 years of combined experience building PHP applications of all shapes and sizes and want to help you get better. The combination of Phil's "Build APIs You Won't Hate" and Chris' "Minimum Viable Tests" can give you the foundation to create and maintain the APIs that are the key to the success of your application.
Build APIs You Won't Hate
Everyone and their dog wants an API, so you should probably learn how to build them.
After finding many of the existing resources for API development to be lacking, Phil learned a lot of things the hard way through years of trial and error. This book aims to condense that experience, taking examples and explanations further than the trivial apples and pears nonsense tutorials often provide.
Phil worked primarily as an API developer for the last three years. One horror was managing an API built in FuelPHP by a freelancer at the million dollar startup he joined. It was utilizing a then deprecated ORM which had been hacked to death by the previous developer, so took the time to delete that mess and build the next version in Laravel, leveraging it's simple routing, database migrations, schema, seeding, etc. When the following major version of the API was built no rewrite was required, and both managed to live side-by-side on the same "API" servers.
By passing on some best practices and general good advice you can hit the ground running with API development, combined with some horror stories and how they were overcome/avoided/averted. This book will discuss the theory of designing and building APIs in any language or framework, with this theory applied in PHP-based examples.
Some of the more advanced topics covered here are endpoint testing, embedding data objects in a consistent and scalable manner, paginating responses (including embedded objects) and hypermedia "HATEOAS" controls.
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 starts you off with the basics on the concepts surrounding test-driven development and shows you how a long-time grumpy programmer writes application with testing always in the front of his mind. Along the way 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 Leanpub Unconditional, No Risk, 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms