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.
Building real to doubles
From the course: PHP: Testing Legacy Applications
Building real to doubles
- [Narrator] Okay I showed you an example of how I would write all the pseudo-code that we would need to turn this test that used real dependencies into one that uses doubles. Now, rather than make you sit around and watch me for 45 minutes make syntax errors and mumble to myself and go read up on how different parts of the application work, I went and implemented the entire test. So this test actually does pass. Now I want to go over every little section of this test to explain what's going on, because I'm sure for many of you a lot of what's going on here is not obvious, and I want it to be obvious for you. Okay, so now we're ready to go from the pseudo-code where we've outlined all the doubles that we need to create to actually creating the doubles. Now the tool that I'm using is Mockery. I've mentioned it before, Mockery is a stand alone framework for creating test doubles. It's a little bit different from the built in one that comes with PHPUnit, and again that's a little bit…
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
-
-