19 July 2018
I’ve recently re-watched A Clean PHPUnit Workflow in PHPStorm on Laracasts, where Jeffrey configures PhpStorm to run tests from within the IDE. With Drupal 8 using PHPUnit too, I decided to try and do the same with a local D8 site.
Though because I’m using Docksal for my local development environment which, at least on a Mac, runs Docker containers within a virtual machine, there were some additional steps needed to achieve this and to have the tests run within the Docksal virtual machine and using the correct containers.
28 June 2018
Yesterday evening, I did my first workshop (and I believe, the first workshop) held at the Drupal Bristol user group. The subject was automated testing with PHPUnit in Drupal 8, in preparation for my talk at Drupal Developer Days 2018 next week and to help process some ideas for my testing book.
Here are some details about what we covered, and some of my thoughts in review.
4 June 2018
Within the Docksal documentation for Drupal settings, the example database settings include hard-coded credentials to connect to the Drupal database. For example, within a
settings.phpfile, you could add this:
$databases['default']['default'] = [ 'driver' => 'mysql', 'host' => 'db', 'database' => 'myproject_db', 'username' => 'myproject_user', 'password' => 'myproject_pass', ];
Whilst this is fine, it does mean that there is duplication in the codebase as the database credentials can also be added as environment variations within
.docksal/docksal.env- this is definitely the case if you want to use a custom database name, for example.
Also if one of these values were to change, then Drupal wouldn't be aware of that and would no longer be able to connect to the database.
It also means that the file can’t simply be re-used on another project as it contains project-specific credentials.
We can improve this by using the environment variables within the settings file.
6 May 2018
This week I’ve started writing some custom commands for my Drupal projects that use Docksal, including one to easily run PHPUnit tests in Drupal 8. This is the process of how I created this command.
23 April 2018
This is one of those “there’s probably already a better way to do this” situations, but it worked.
I was having some issues this past weekend where, despite everything working fine locally, a server was showing a “500 Internal Server” after I pushed some changes to a site. In order to bring the site back online, I needed to revert the site files back to the previous version, but as part of a new commit.
12 March 2018
In January, Chris Fidao posted a video to Servers for Hackers showing how to put different PHP applications in different subdirectories and have them serving on different paths with Nginx. I’ve had to do this a few times previously, and it’s great to have this video as a reference.
10 March 2018
Yay! You’ve written a new Drupal module, theme or installation profile as part of your site, and now you’ve decided to open source it and upload it to Drupal.org as a new contrib project. But how do you split it from the main site repository into it’s own?
Well, there are a couple of options.
9 March 2018
This week the latest minor version of Drupal 8, 8.5.0, was released.
This new version makes Media module available for all, improves migrations significantly, stabilizes the Content Moderation and Settings Tray modules, serves dynamic pages faster with BigPipe enabled by default, and introduces a new experimental entity layout user interface. The release includes several very important fixes for workflows of content translations and supports running on PHP 7.2.
4 March 2018
In the end, I wasn’t able to make it to DrupalCamp London because of the heavy snow that’s hit the UK over the last few days. I did though keep a close eye on Twitter and still had good conversations with some of the attendees, so it did feel that in some ways I was still part of the conference.
Here are some of my favourites that I saw, and no snow next year, please!
2 March 2018
Back in November, Mediacurrent introduced the contrib half hour - a weekly online meeting to provide guidance and assistance on contributing to Drupal and Drupal projects. A range of topics were covered in the first few sessions, including finding and testing bug fixes, Composer, Drush, and how to re-roll patches.