Free Downloads
PHPUnit Essentials

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.

File Size: 15747 KB

Print Length: 316 pages

Page Numbers Source ISBN: 1783283432

Publisher: Packt Publishing (May 26, 2014)

Publication Date: May 26, 2014

Sold by:  Digital Services LLC

Language: English

ASIN: B00KM5QDY0

Text-to-Speech: Enabled

X-Ray: Not Enabled

Word Wise: Not Enabled

Lending: Not Enabled

Enhanced Typesetting: Enabled

Best Sellers Rank: #796,835 Paid in Kindle Store (See Top 100 Paid in Kindle Store) #118 in Kindle Store > Kindle eBooks > Computers & Technology > Programming > PHP #214 in Books > Computers & Technology > Programming > Web Programming > PHP #469 in Books > Computers & Technology > Programming > Software Design, Testing & Engineering > Testing

PHPUnit Essentials by Zdenek Machek is a technical resource book that provides an impressive overview of PHPUnit and unit testing in general. The book starts at the very beginning, explaining the common methods of installing PHPUnit, progressing through into running basic tests, then more advanced techniques, and automated testing.A lot of technical resource books simply focus on their specific subject and skip over the environment, but not this book. Zdenek takes a lot of effort to not only explain the specifics of PHPUnit, but also to explain how testing benefits proper application design and problem solving with some real examples. Before he digs too deep into showing the different testing functions, he spends some time showing how you'd design code based on how to test it. The result is a well written, and well tested, piece of code.I approached this book as a PHP developer who has only lightly touched on PHPUnit in recent years. As is often the case when you're working to very strict time limits, unit testing often falls by the wayside, so I set out to remedy this with PHPUnit Essentials. I sat down with one of my projects, and started implementing test cases as I worked through the book. It didn't take long for me to discover a couple of bugs in my code, and I even swapped dependencies to a more suitable solution, all because I'd spent 15 minutes writing a test for what I thought was a working piece of code.Although most of the earlier chapters conveyed pretty standard PHPUnit functionality, it soon moved into talking about Mocking, backing up globals, data providers, and other interesting things that I've not used much and didn't really understand (or hadn't even heard of).

"PHPUnit Essentials" would have come in handy while on a recent contracting gig and on all the other PHP projects I've worked on.The book is great in covering multiple installation methods and multiple IDEs. I liked how much detail the book went into about each method of install, for example I haven't used Composer on a project yet but seeing how simple it is in this chapter, I'm going to consider its use on future PHP projects.Chapter 3 covers what a unit test is, and how to define them using PHPUnit. One thing I didn't like about this chapter is that it refers you to a URL to see a complete list of assertions you can use in tests. It would be nice if the complete list was shoved into the back as an appendix so that it could be used as a quick reference.An interesting real-world example that frequently comes up is how to test code that uses external APIs. PHPUnit Essentials covers this in chapter 10 with examples of integration with the Stackoverflow, the Paypal, the Facebook and the Twitter APIs. While the book covers publicly available APIs, the code examples are solid guide on how to test proprietary external APIs as well.The only criticism I would offer of this section is that maybe it tests too many external APIs at once. Sacrificing this chapter to addmore information on writing custom assertions or on how to test with legacy code might would have been a good idea.The source code in the book is nice and clear. The drawback of it are the comments.

PHPUnit Essentials Modern Essentials Bundle - Modern Essentials *7th Edition* a Contemporary Guide to the Therapeutic Use of Essential Oils, an Intro to Modern Essentials, Reference Card, and Aroma Designs Bookmark Prepper Essentials: Prepper Essentials What Every Survivalist Needs To Know When Building The Ultimate SHTF Stockpile (Survival Handbook, DIY, Emergency ... Essentials Books, Emergency Prepared) DSP Architecture Design Essentials (Electrical Engineering Essentials) Evernote Essentials: The Basics of the Most Popular Notebook App for Beginners with pics examples:(101 evernote app, evernote, evernote essentials, evernote for beginners, evernote mastery) Packaging Essentials: 100 Design Principles for Creating Packages (Design Essentials) Essentials of Online Course Design: A Standards-Based Guide (Essentials of Online Learning) Essentials for Blended Learning: A Standards-Based Guide (Essentials of Online Learning) Essentials of Lewis's Child and Adolescent Psychiatry (Essentials Of... (Lippincott Williams & Wilkins)) Essentials of WJ IV Tests of Achievement (Essentials of Psychological Assessment) Essentials of WJ IV Cognitive Abilities Assessment (Essentials of Psychological Assessment) Supervision Essentials for the Practice of Competency-Based Supervision (Clinical Supervision Essentials) The Essentials of Massachusetts Mental Health Law: A Straightforward Guide for Clinicians of All Disciplines (The Essentials of Series) Essentials of Trademarks and Unfair Competition (Essentials Series) Respiratory Physiology: The Essentials (Respiratory Physiology: The Essentials (West)) Essentials of Oral Histology and Embryology: A Clinical Approach, 3e (Avery, Essentials of Oral Histology and Embryology) Essentials of Clinical Geriatrics 7/E (LANGE Essentials) 'Essentials of General Surgery, 4th Edition and Essentials of Surgical Specialties, 3rd edition Set AACN Essentials of Critical Care Nursing, Third Edition (Chulay, AACN Essentials of Critical Care Nursing) Essentials for Nursing Practice, 8e (Basic Nursing Essentials for Practice)