PHPUnit Snapshot Assertions – a way to test without writing actual test cases

phpunit-snapshot-assertions – is an interesting addition to the PHPUnit assertions which allows testing against previously created snapshots.  This is particularly useful for testing the outputs of API end-points, format conversion functions, and the like.  Instead of testing the actual functionality, these assertions allow to compare the output of the current test run with the known good output of a previously created snapshot.

This works well for generic text, but even better for widely used formats like JSON and XML, where, in case of a failed assertion, a meaningful difference can be provided.

Here is a blog post providing some more details on philosophy and methodology.

Hellenic Bank Open API

Oh. My. God.  The future is here.  Hellenic Bank is (finally!) introducing an API.  Not sure yet what exactly one would be able to do with it, but even if it’s just to check an account balance, it’s progress already.

I vaguely remember being part of the effort to convince Hellenic Bank (or any Cyprus bank for that matter) to provide an API to my then employer … erm … about 10 years ago.  The effort was beyond describable at the time.  But I knew the day would come, and it’s finally here.

These are probably the biggest technology news since the time PrimeTel became an ISP with its own submarine cables.

GitHub to MySQL

GitHub to MySQL is a handy little app in PHP that pulls labels, milestones and issues from GitHub into your local MySQL database.  This is useful for analysis and backup purposes.

There are a few example queries provided that show issues vs. pull requests, average number of days to merge a pull request over the past weeks, average number of pull requests open every day, and total number of issues.

I think this tool can be easily extended to pull other information from GitHub, such as release notes, projects, web hooks.  Also, if you are using multiple version control services, such as BitBucket and GitLab, extending this tool can help with merging data from multiple sources and cross-referencing it with the company internal tools (bug trackers, support ticketing systems, CRM, etc).

This is not something I’ll be doing now, but I’m sure the future is not too far away.