Shortcut to Gutenberg: How To Learn Gutenberg Development in 6 Days

So I published How To Learn Gutenberg Development, which outlines a roadmap for learning ES6, React, Redux, and Gutenberg. This is a proven, and sure way to master Gutenberg.

But this approach also takes time. In fact several readers have reached out to me expressing that they don’t have time for a long learning process.

With Gutenberg in Core, developers need to be productive with Gutenberg right now.

As a consequence I’ve reworked my initial learning approach, to fit with this short timeframe. The learning process outlined below takes 6 days, or 3 weekends, or 48 hours.

At the end of it, you’ll be able to:

  • Adapt existing WordPress themes to work with Gutenberg content.
  • Add Gutenberg specific features to themes.
  • Understand the basics of React.
  • Feel comfortable exploring Gutenberg’s user interface component library.
  • Develop custom Gutenberg blocks.
Read More

Understanding WordPress PHP Unit Test Fixture Setup and Teardown

WordPress PHP Unit Testing When I get started writing unit tests in WordPress, I continuously ran into what seemed to be strange behaviours by the WordPress Unit Testing framework. Strange when comparing to other PHP unit tests anyway.

It wasn’t until I read all the code of the bootstrap and install scripts, as well as the base WordPress unit test case, that I was able to make sense of it all.

So in this article, I’ll detail how WordPress Unit Testing framework handles fixtures. In addition, I’ll touch on a few things to watch out for when writing your own tests.

Read More

WP_UnitTest_Factory: The Missing Documentation

Most WordPress functions interact with data objects like posts, users, or terms. This creates a problem for developers, as every test starts with an empty WordPress installation. The WordPress Unit Test Factory helps to solve this issue.

It provides a set offers a set of helper classes to create these database objects, called database fixtures in a unit testing scenario.

The test framework offers factories for creating:

  • Attachments
  • Comments
  • Posts
  • Categories, Tags, and Terms
  • Users

It also has multisite specific factories for:

  • Networks
  • Blogs

In this article, we’ll see about how you can interact with these factories, and what issues to watch out for.

Read More