Cover image for Instant Hands-on Testing with PHPUnit How-to.
Instant Hands-on Testing with PHPUnit How-to.
Title:
Instant Hands-on Testing with PHPUnit How-to.
Author:
Lively, Mike.
ISBN:
9781782169598
Personal Author:
Edition:
1st ed.
Physical Description:
1 online resource (91 pages)
Contents:
Instant Hands-on Testing with PHPUnit How-to -- Instant Hands-on Testing with PHPUnit How-to -- Credits -- About the Author -- About the Reviewers -- www.PacktPub.com -- Support files, eBooks, discount offers and more -- Why Subscribe? -- Free Access for Packt account holders -- Preface -- What this book covers -- What you need for this book -- Who this book is for -- Conventions -- Reader feedback -- Customer support -- Downloading the example code -- Errata -- Piracy -- Questions -- 1. Instant Hands-on Testing with PHPUnit How-to -- Installing PHPUnit (Simple) -- How to do it... -- How it works... -- There's more... -- Installing PHPUnit using Composer -- Installing PHPUnit on older versions of PHP -- Writing your first test (Simple) -- Getting ready... -- How to do it... -- How it works... -- There's more... -- Class names -- Running tests (Simple) -- How to do it... -- How it works... -- There's more... -- Command line options -- --colors -- --stop-on-error and --stop-on-failure -- --debug -- --strict -- Configuring PHPUnit (Simple) -- How to do it... -- How it works... -- There's more... -- Additional configurations -- Using phpunit.xml.dist -- Adding PHPUnit to your project (Simple) -- Getting ready... -- How to do it… -- How it works… -- There's more... -- Generating tests from code (Advanced) -- Getting ready -- How to do it... -- How it works... -- There's more... -- Using @assert to generate additional code -- Using the Skeleton Generator for test-driven development -- Using test fixtures (Simple) -- How to do it... -- How it works... -- There's more... -- Using data providers (Intermediate) -- How to do it... -- How it works... -- Identifying test failures -- Using test dependencies (Advanced) -- How to do it... -- How it works... -- Multiple test dependencies -- Multiple dependent tests -- Using mock objects (Simple).

How to do it... -- How it works... -- There's more... -- Thoughts on partial mocks -- Ignoring parameters on method expectations -- Stubbing exceptions -- Stubbing multiple return values -- Stubbing with callbacks -- Using mock builders -- Using alternative mock frameworks -- Phake -- Mockery -- Testing abstract classes (Intermediate) -- How to do it... -- How it works... -- Abstract classes in Phake -- Testing traits (Intermediate) -- How to do it... -- How it works... -- Testing exceptions and errors (Intermediate) -- How to do it... -- How it works... -- There's more... -- Testing output (Intermediate) -- How to do it... -- How it works... -- There's more... -- Testing protected and private methods (Intermediate) -- How to do it... -- How it works... -- Private and protected methods -- Testing database interaction (Advanced) -- Getting ready -- How to do it... -- How it works... -- There's more... -- Alternate data sets -- Flat XML data set -- MySQL XML data set -- YAML data set -- Validating your data with queries -- Viewing code coverage (Advanced) -- Getting ready -- How to do it... -- How it works...
Abstract:
Filled with practical, step-by-step instructions and clear explanations for the most important and useful tasks. This is a Packt Instant How-to guide, which provides concise and clear recipes for getting started with PHPUnit for performing code testing and improving code quality."Instant Hands-on Testing with PHPUnit How-to" is for PHP developers that have an appreciation for writing accurate code. If you are new to PHPUnit, it will give you a solid foundation for understanding how to use PHPUnit to write tests for your projects. If you already have a cursory understanding of PHPUnit it will whet your appetite for some of the more difficult-to-understand concepts in PHPUnit.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Electronic Access:
Click to View
Holds: Copies: