Drupal Planet Posts

Drupal 8 AJAX button

I needed to implement "Add another" functionality on an entity form for a module I'm working on. The AJAX changes in D8 are subtle, but this was enough to derail me for a bit.

Objective: Show 1 text field on load. Provide a button that adds another text field with each click.

Running Tests in Drupal 8

The dust is still settling in core, but I wanted to get PHPUnit running on my D8 custom modules. I'm not going to go into how to write tests here, just how to run tests.

My problem was that PHPUnit was running core tests just fine, but it wasn't picking up my custom module tests. Initially I had my tests in: modules/mymodule/lib/Drupal/mymodule/Tests

I looked around core a bit and moved them to a new directory: modules/mymodule/tests/Drupal/mymodule/Tests

API & Drush access to Pantheon with Terminus

I've spent more time extending terminus, and thought it would be a good time to write a little more about it.

Terminus is an API/Drush integration project, by Pantheon. At its base is an API they have exposed to access information and execute workflow functionality you would otherwise only have access to via their dashboard. Drush wraps the API and provides the shell power make for some awesome command line tools.