Published on Thursday 18, October 2018

Running Drupal's Nightwatch test suite on DDEV

This is the third, and final post in my series on running Drupal’s various test suites using the DDEV local development stack. Previously I covered running Drupal’s Unit, Kernel, and Functional tests and then running Chromedriver to execute the FunctionalJavascript test suite. In this post, I will talk about running the newly introduced Nightwatch.js test framework.

Published on Tuesday 16, October 2018

Running Drupal's FunctionalJavascript tests on DDEV

This is part two of a series on running Drupal’s testing suites on DDEV. We left off last time with trying to execute a FunctionalJavscript test and having every test case skipped because no browser emulator was available. In this post, we will run through getting set up to execute Drupal’s FunctionalJavascript tests inside of your DDEV web container.

Published on Friday 12, October 2018

Running Drupal's PHPUnit test suites on DDEV

DDEV is a local development stack built on top of Docker. It gives you all of your environment needs without messy configured on your host machine, without needing to know Docker or configure your own containers. Which is great, and makes life easier. Instead of just using DDEV to develop your site or application locally, why not also run your tests within it?

Published on Wednesday 10, October 2018

OK PhpStorm, what methods does my entity have?

Working in object-oriented programming is great. You can define interfaces which specify a contract that implementers need to fulfill. You can then extend these to define your end requirement and provide the implementation. This also means you can guarantee an object that implements that interface will have a guaranteed set of known methods. In Drupal, all entities implement EntityInterface, this is how we know that an entity can return its identifier, label, language, and other common methods.

Published on Sunday 7, October 2018

I am looking to try something new on my site, adding a way to just provide quick updates. Possibly experimenting with it being my way to publish to social networks.

Published on Saturday 6, October 2018

Test driven development in PhpStorm with auto-testing enabled

When I work, I try to follow the principles of Test-Driven Development. I have found it to aid me in writing cleaner code, identifying odd coupling of components or crazy accidental dependencies between components. It also lets me write my API first by using mocks against interfaces I have defined. PhpStorm's auto-test functionality speeds up my test-driven development process.
Published on Thursday 27, September 2018

Tracking changes in Migrate with dynamic row hashes

When it comes to Drupal and external data, I use Migrate. A lot. Like a lot, lot, lot. Many times this data is being imported over CSV files that are pushed to a server at some defined interval. Usually, the data can be derived directly from the CSV file itself, other times a custom process plugin derives data from other information. Drupal's Migrate system has two steps to check if new data should be imported or skipped. First, you can tell the migration source to track changes for each row. Then, if you are tracking changes, it hashes each row of data to see if it has been changed.

Published on Monday 24, September 2018

Xdebug over the command line with DDEV

I moved over to DDEV for my local development stack back in February. One of my favorite things is the ease of using Xdebug. You can configure Xdebug to always be enabled, or turn it on and off as needed (my preferred method.) When you have Xdebug enabled, it also enables it for any PHP scripts executed over the command line. That means you can debug your Drush or Drupal Console scripts like a breeze!

This article is based on using Xdebug within PhpStorm, as it is my primary IDE.

Published on Thursday 20, September 2018

Goodbye AdSense, hello CodeFund.

For a long time, I have had Google AdSense on my website. It generated enough revenue that I could hit the minimum payout of $100 about once a year, covering my hosting costs. Then, a few months ago, I found CodeFund by Gitcoin. I still have Google Analytics on my website, but as a responsible web property owner, I wanted to reduce the exposure of my visitors to Google's ad network and various profiling and trackers.

Also, CodeFund actually servers better-targeted ads for my readers. AdSense wasn't that great.