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

Planning a scenario

From the course: PHP: Testing Legacy Applications

Start my 1-month free trial

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…

Contents