Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

PHP Test Doubles - Fakes, Stubs, and Mocks

Gary Clarke via YouTube

Overview

Learn how to replace objects in PHP tests with test-doubles using fakes, stubs, and mocks. This course aims to teach you the essential skill of testing code more efficiently and with a tighter focus. The course covers topics such as 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, and The Mock Builder. The teaching method includes practical demonstrations and examples. This course is intended for PHP developers looking to enhance their testing skills.

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

Reviews

Start your review of PHP Test Doubles - Fakes, Stubs, and Mocks

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.