Explore some of the basics of testing your software against a database and some of the key differences between an integration and unit test.
- [Instructor] A common scenario in testing your…software application is testing against a database.…To do database testing, we typically use a tool…called fixtures.…You can think of a fixture as fit database records.…We will add database testing to our work in this video.…Navigate to the Exercise files for this lesson,…and you'll see a snippets.txt file located in there.…You'll want to open this file now.…And here the Snippets file contains…two fully built out classes.…
First, a table class that handles talking to the database…and performing SQL queries.…The other is a companion test class.…Now, we'll want to copy lines one through 25…from our snippets.txt file.…After you have copied this, open up your editor,…and we want to create a new file in the source directory…and save it as itemsTable.php.…
And now paste in the contents from the Snippets file…that you copied and save it.…After this, we'll go back to the snippets.txt file…and copy the rest of the file from lines 32 all the way…to lines 136.…Again, go back to your editor, and create a new file…
- Why use unit testing?
- Writing unit tests
- Extending unit tests
- Filtering PHPUnit tests
- Building dummy objects
- Working with data providers
- Writing an exception-based test
- Using TDD tactics
- Using PHPUnit advanced tactics, such as database tests
Skill Level Intermediate
Managing PHP Persistent Sessionswith David Powers2h 41m Intermediate
1. The Basics of Test-Driven Development
2. Advanced Test-Driven Development
3. Test-Driven Development Tactics
4. PHPUnit Advanced Tactics
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.