Notes | Transcript | Code | Playlist Notes In this episode, we’ll start laying out the steps to bootstrap our integration tests. Transcript Code

Developing & Empowering WordPress Developers
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
0 Videos Runtime
Notes | Transcript | Code | Playlist Notes In this episode, we’ll start laying out the steps to bootstrap our integration tests. Transcript Code
0 Videos Runtime
WooHoo! You did it! You made it through this lab. In doing so, you setup your testing environment, learned a few new things about Composer, dove into the formula for figuring out what to test, and wrote real unit and integration tests. Congratulations for completing this lab!
0 Videos Runtime
Notes | Transcript | Code | Playlist Notes Let’s write a real test together. Remember back in an earlier episode where I told you that I found a bug in beans_replace_action() and beans_replace_action_hook()? Let’s write the test for that bug. You’ll get using the added functionality from WordPress’ Test Case, as you’ll create a new post and use the go_to() method. Transcript Code
0 Videos Runtime
Notes | Transcript | Playlist Notes WordPress packages a bunch of functionality for us to use in our integration tests. You extend off of the WP_UnitTestCase to gain access to things like: Factory for creating post content (i.e. posts, pages, and custom post types), terms, users, etc.) Loading a URL via go_to() Query tests to check that you did load the right stuff Setup for the query, global states, etc. Resets to return us to that original setup state, query, etc. Let’s talk about it in this episode. Transcript
0 Videos Runtime
Notes | Transcript | Code | Playlist Notes Next, we need to find where the WordPress test suite’s directory is on your localhost’s web server. Transcript Code
0 Videos Runtime
Notes | Transcript | Playlist Notes Are you running Local by Flywheel, like me? If no, you can skip this episode. But if yes, then in this episode, you and I will install the packages we need as well as get WordPress setup. It’s really easy as Kees Meijer already has the bash script and instructions ready for you. Click here to get the script. Transcript
0 Videos Runtime
Notes | Transcript | Code | Playlist Notes In this episode, you’ll be: Installing all of the dependencies specified by running composer install. Fixing a namespace error in the composer.json file. Adding in the integration tests PSR-4 configuration. Adding in the scripts, which will make your testing job so much easier. Transcript Code
0 Videos Runtime
Notes | Transcript | Code | Playlist Notes In this episode, you and I will create a composer.json file to configure all of the dependencies we will need for our testing suites. Transcript Code
0 Videos Runtime
Notes | Transcript | Code | Playlist Notes A great way to learn which assertions to use for your tests is to take the equivalent comparative code and find the assertion that does the comparison work for you. In this episode, I’m going to challenge you to do just that. I want you to take our test sample assertions, which are all assertTrue(), look at the comparison code, and figure out which assertion can replace that code. You’ll be using the PHPUnit manual. Then together, you and I will walk through the process together. We’ll look at the different assertions […]
0 Videos Runtime
Notes | Transcript | Code | Playlist Notes Before we can really dive into testing, I think any conversation about integration testing into workflow has to start with “how it benefits you.” Testing requires more work from you upfront, but saves you time and money later. The benefits are huge to your company, clients, and you. Let’s talk about why and what you get. In this episode, I’ll show you the benefits of testing by showing you a real world framework that had a bug in it. As I was writing tests for it, I found a bug, one that […]
Know the Code flies on WP Engine. Check out the managed hosting solutions from WP Engine.
WordPress® and its related trademarks are registered trademarks of the WordPress Foundation. The Genesis framework and its related trademarks are registered trademarks of StudioPress.
This website is not affiliated with or sponsored by Automattic, Inc., the WordPress Foundation, or the WordPress® Open Source Project.