Module: Introducing WordPress, PHP Unit Testing
Topics: WordPress Terminology, FSE Introduction
WordPress Terminologies
To develop or understand WordPress better we should be familiar with the terminologies WordPress uses. Understanding terminologies not only helps in developing alone but also helps in collaborating with others.
Some common WordPress terminologies are:
- Codex: It is an official WordPress manual that contains support articles, documentation, and code snippets.
- cPanel: It is a web-based tool to manage the content on the website.
- Back-end: It is the WordPress Dashboard from where we can manage everything.
- Database: It is used to store data in an organized manner.
- Default Theme: They come pre-installed with the WordPress installation.
- DNS: Domain Name Server maps domain names to their respective IP address.
- DOM: It lets us access HTML and XML on a web page.
- Footer Area: It is at the bottom of the web page; we can place widgets over there.
- Gravatar: It is a service that allows users to have a global image with their photos.
- IDE: Integrated Development Environment is used to develop software and test code.
- Nonce: It is a one-time token generated by WordPress to protect against duplicate requests.
- XML-RPC: A remote procedure call (RPC) protocol that uses XML to encode its calls and HTTP as a transport mechanism.
- Admin Bar: A black top bar at the top of the screen to control and manage the website.
- 404 Page: Page which does not exist on the website.
FSE Introduction
Full Site Editing allows users to edit different site templates without making any changes to the code. It is a part of the Gutenberg project.
The core concepts of FSE are:
- Site Editor: It is a block editor that allows users to use blocks and templates to create a webpage.
- Blocks: They are the individual components that make up the webpage. They are also Customizable.
- Templates: When we combine block items then it is called a template.
- Block Themes: Themes that support blocks and can be edited through the site editor are called block themes.
Jetpack blocks
Jetpack blocks in WordPress offer a powerful and versatile set of tools that can elevate your website to new heights. These blocks, seamlessly integrated into the Jetpack plugin, provide users with a streamlined and user-friendly experience in content creation. From dynamic image galleries to customizable contact forms, Jetpack blocks empower website owners to design engaging and interactive pages without the need for extensive coding knowledge.
What is PHPUnit?
It is a testing framework for PHP. It is a framework for writing tests as well as command line tools for running these tests.
Unit testing provides documentation
Unit tests are a kind of living documentation of the product. To learn what functionality is provided by one module or another, developers can refer to unit tests to get a basic picture of the logic of the module and the system as a whole. Unit test cases represent indicators that carry information about the appropriate or inappropriate use of a software component. Thus, these cases provide the perfect documentation for these indicators.
Installation of PHPUnit
To install via composer we can use the command below:
composer require --dev phpunit/phpunit
we are using --dev
flag because we need this only for the development environment.
You can run PHPUnit tests by running the command from plugin root directory:
./vendor/bin/phpunit
Leave a Reply