Our great sponsors
-
php-compatibility-demo
Example PHP library using a GitHub Actions workflow to check whether the code is compatible with a range of PHP and dependency versions
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
setup-php
GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
-
composer-install
:gift: A GitHub Action to streamline installation of PHP dependencies with Composer.
-
openapi-httpfoundation-testing
Validate your HttpFoundation requests and responses against OpenAPI (3+) definitions
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Here's the file structure you should get at the end of this section (remember that you can also refer to this article's repository at any time for comparison):
With that in place, let's talk about our test project for a minute. We are going to build a small library on top of Money, a popular PHP package facilitating the manipulation of monetary values and currencies.
Checkout (GitHub Action)
Setup PHP (GitHub Action)
Let's also instal PHPUnit as a development dependency:
Composer Install (GitHub Action)
But then again, most PHP developers don't have to think about this too much. I personally started to look into compatibility testing more seriously when I created my first open-source library and, later on, when I started exploring building for the console with PHP.
A common aspect of a PHP developer's job is to deal with Composer dependencies. We use the work of others as Lego bricks to build our own projects, making the most of the beautiful thing that is the open-source movement.