Notes | Transcript | Playlist Notes In this episode, you and I will walk through setting up your testing environment. You’ll do the following: Spin up a locally hosted website on your machine. I’ll show you in Local (my preferred app). Download the Beans 1.4.0 framework, which you’ll use to write your tests in this lab and series. Set up the tests file structure. Look at Make WordPress’ Testing Standards You’ll also look at 2 different test repositories, which will give you ideas on how tests and the environment are constructed: Beans – which is built strictly following the WordPress […]
Labs
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.
Unit vs. Integration Tests
Notes | Transcript | Playlist Notes A unit test tests your code without your code’s dependencies, whereas an integration test tests your code integrated with its dependencies. Dependencies include: WordPress – as it’s outside of your code. An external API – such as Stripe, PayPal, a help desk, weather, population, demographics, etc. An external package you embedded into your plugin, theme, or application, such as Guzzle, CMB2, Fulcrum’s Extender module, or Fulcrum’s Config module. A reusable module that you or your company built and tested separately. In a unit test, you are testing the expected behavior for the given conditions […]
What is Testing?
Notes | Transcript | Playlist Notes So before we can go too far down the rabbit hole, we need to start right now and define what “testing” is. I want you to cement this in your mind. I’ve already talked about the benefits to you. But now we need to what it is. And then we’re going to break it down into different classifications. Testing validates your code to the expected behavior for a given set of conditions and scenarios. It also helps you to think through how the function will work and different scenarios that will happen. That makes […]
Lab Introduction
Let’s discuss what we will be doing in this lab…together.
Unit & Integration Testing Basics
Testing is a critical component of your workflow, as it validates each piece of your code to ensure it works exactly as you intended. As a professional developer, testing is a skill that will set you a part and give you a competitive advantage in the marketplace. In this hands-on lab, you will be building unit and integration tests as you learn the basics of PHP testing.
Add UIKit Button Attributes
Let’s talk about UIKit. Right now in Beans 1.x, it’s baked into Beans. In Beans 2, we’ll provide it via a plugin. Let’s explore the button component and play around with different styling. Before we do that though, I want to talk to you about developer costs and efficiency. I’ve become a UIKit advocate. Why? Because it’s an example of a third party dependency that delivers on: Reducing your time and costs. Lean – meaning it’s a small file to be downloaded to a person’s browser. Backed by a large FOSS community. The UIKit team keeps it up-to-date with the […]
Wrap it Up
WooHoo! You made through this lab. Congratulations! I’m proud of you. Let’s recap what we did in this lab: We looked at the Beans code that builds the “read more” link. If you are a Pro member, we looked at various Beans functions and walked through the code. We talked about various strategies to find the ID and hooks you need to customize your child theme. One hint was to turn on “development mode” as the IDs are then put into the HTML. We then did a lot of different customizations including: We changed the text. We got rid of […]
Adding HTML Attributes using beans_add_attributes()
In the beans_open_markup, we modified the attributes using a filter that is within beans_add_attributes() function. Let’s take a look at this function and the tasks that it performs. What if you wanted to change the class attribute, add a new one, or even add a “rel” to the <a> tag, how would you do it?
Change the UIKit Icon
In this episode, let’s put the UIKit icon back in, but let’s explore how to change which icon is used. We’ll talk about which filter event name to use as well as explore UIKit icon classes. Let’s add a book icon. Code Challenge I’m also challenging you to strip out the text and make the link be a round button. Hint: Look at the UIKit’s Icon Button class attribute.
Dive into Beans’ beans_close_markup()
In the last episode, you saw how Beans builds the opening tag markup. But that’s not valid HTML. Why? Because we need to close the tag. Aha. We use beans_close_markup() to build that closing tag.