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 real to doubles
From the course: PHP: Testing Legacy Applications
Planning real to doubles
- [Instructor] Okay, so you've seen how I turn my pseudocode into this working test that you have in front of you. Now the next step is, I'm going to create a test that uses test doubles so that we no longer need to talk directly to the database. So the first step is we're going to create an empty test, and then I'm going to write the pseudocode that I'm going to later turn into code. So we can do the same thing with the annotation, and then we will call this test function sortOrderWorksAsExpectedWithDoubles. We have the assertion in here, but we're not going to run it just yet, because first, I want to go over the pseudocode. You'll see how it changes, how we now go from one to use real things to using doubles, so what I say in this pseudocode, plan changes. So if we go over what we have here already on lines 14 through 19, where I'm describing the test, I'm going to now describe as if we're using doubles, so as before, we had a QueryFactory object, I'm going to need to create a…
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
-
-