Get started with PHPUnit and learn how to write and test code using advanced technologiesAbout This BookLearn how to install PHPUnit as well as how to write and execute testsUnderstand the advanced concepts of testing using test doubles and the continuous integration processA hands-on, step-by-step guide full of real-life examples to help you learn quickly and effectivelyWho This Book Is ForThis book is a practical guide featuring a step-by-step approach that aims to help PHP developers who want to learn or improve their software testing skills. It also takes you through many real-life examples encountered by PHP developers to help you avoid common pitfalls.
What You Will LearnHow to install PHPUnit and configure IDEs for PHPUnit supportWhat are unit tests and why to test codeWrite test doubles and learn how to replace dependenciesExplore how to test legacy codeTest code calling APIs and connecting to the databaseRun functional tests in a web browser using Selenium testsUse tests as part of the continuous integration processDiscover the alternatives to PHPUnitUse PHPUnit tests in the Jenkins and Travis CI serversIn DetailThe ability to write unit tests and software testing have become skills that every PHP developer should master.
This book is a practical guide to PHPUnit and unit testing, covering all aspects of writing PHPUnit tests and using them. The book shows why testable code is better code and how to write good tests with the help of simple and easy-to-understand examples.
With this book, you will learn how to write, organize, and execute effective tests. Step-by-step techniques of how to write testable code, how to refactor the code, and how to run your tests are shown. You will also learn about advanced testing techniques, including how to test databases, APIs, and legacy code. PHPUnit Essentials is a guide for PHP developers who want to learn or improve their software testing skills. It is a book for developers who begin with testing but is also a good source of information for developers who are already familiar with PHPUnit.
Legacy book but covers most of the things about PHPUnit. Readers first try with official documentation and read this as supplementary because many things in PHPUnit changed so reading documentation first gives you a stronger grip on the topic.