From the course: PHP: Testing Legacy Applications
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Planning a scenario
- [Instructor] Okay, so having identified all the dependencies that we need in order to test our method, both the visible ones and the kind of hidden dependencies, I want to show you how I go about planning my scenario by using pseudo code. So, of course, we're using PHPUnit. If you're not familiar with PHPUnit, it's a stand alone testing framework that we've installed with this application using Composer. Don't worry. There will be a documentation included with this course that shows you how to install all this stuff. You want to follow along with me instead of just looking at the results. So whenever I'm doing a test, I always start off with a failing test. So we create a test. We give it a name that makes sense to us. Try to group things according to the behavior we're trying to test. So in this case we're trying to test behavior of our roster model. So this file's called RosterModelTest. And then, of course, we give the class the name that matches it, RosterModelTest. We extend…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Why test a legacy application?1m 57s
-
(Locked)
Identifying dependencies3m 20s
-
(Locked)
Planning a scenario5m 32s
-
(Locked)
Building a scenario6m 6s
-
(Locked)
Planning real to doubles4m 19s
-
(Locked)
Building real to doubles7m 7s
-
(Locked)
Refactor your tests4m 11s
-
(Locked)
Add getters and setters3m 58s
-
-