PHP Test Doubles - Fakes, Stubs, and Mocks
Offered By: Gary Clarke via YouTube
Course Description
Overview
Explore the world of PHP test doubles in this comprehensive 51-minute video tutorial. Master the art of replacing objects in your PHP tests using stubs and mocks, a crucial skill for more efficient and focused code testing. Dive into topics such as PHPUnit test doubles, testing expectations, faking method return values, and handling consecutive returns. Learn how to throw exceptions from stubbed methods, utilize return callbacks, and verify that faked methods receive the correct arguments. Discover techniques for testing with callbacks and get acquainted with the Mock Builder. By the end of this tutorial, gain the knowledge to elevate your PHP testing practices and improve your overall code quality.
Syllabus
PHPUnit Test Doubles
Testing Expectations
Faking Method Return Values
Testing Consecutive Returns
Throwing Exceptions From Stubbed Methods
Will Return Callback
Test Faked Methods Receive Correct Args
Test Correct Args With Callbacks
The Mock Builder
Taught by
Gary Clarke
Related Courses
Object Oriented PHP & TDD with PHPUnit from ScratchUdemy Getting Started with PHP Unit Testing Course (How To)
Treehouse Unit Testing with PHPUnit
Pluralsight PHP Unit Testing with PHPUnit
Udemy Advance your Skills as a PHP Developer: Testing and Debugging
LinkedIn Learning