How do you wire up your copy of the team’s project to the project’s repository on the remote server, i.e. GitHub? Let’s talk about the wiring as I introduce you to the concept of forking, cloning, remotes, origin and upstream.
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.
3 Locals – Working, Staging, & Storage
Let’s explore the 3 distinct, local areas that git is managing for you. I’ll show you in my code. And then we’ll talk about the different commands for taking snapshots and storing them into the staging, storage, and even on GitHub.
The Big Picture
Let’s focus on the big picture of what’s going on with git, as well as the bigger picture of how git fits into a collaborative, distributed, and automated end-to-end workflow from development to QA to deployment.
What is Git?
To truly understand git and its workflow, you need to first start with what git and version control are. In this episode, we’ll talk about what they are as well as what you get by using this workflow in your daily work.
Local Development Environment Setup for Windows
Your local web development environment is critical to your ability to efficiently produce high quality and well-tested software projects. This environment should be incredibly easy to use. It should support the way you work, making you better and faster while demanding very little of your time. In this hands-on lab, you will setup your local web development environment. It will include version control with Git, helper apps, package managers (Composer, Node, and npm), task runner with Gulp, local webserver, and a professional editor.
Unit Testing with Brain Monkey
How can you unit test your plugin or theme without WordPress or other dependencies? You simulate the dependencies. My favorite tool to redefine and mock functions is Brain Monkey. In this hands-on testing lab, you will write unit tests using Brain Monkey.
`with()` – Code Challenge
Let’s walk through the code challenge I gave to you in the last episode.
More with `with()`
Let’s build another test to learn more about using with()
`with()`
We can test that the arguments the mocked function receives are what we expect by using the with() method. Mockery, which is baked into Brain Monkey, inspects the received arguments and then tests each one against what you’ve defined it should receive. This feature allows us to ensure our code is properly doing its work and sending the right set of data to the function we are mocking. Here, let me show you.
`stubs()`
Stubs give you a way to redefine multiple functions by passing an array to Brain Monkey. This toolset is handy for things such as WordPress escaping and internationalization functions, as we can bulk define these functions in your Test Case. Here is an example of how we do it with the Beans framework.