December 10, 2013
Drupal

Prepare! Prepare! for… PHPUnit tests

Author photo
Cheppers
Cheppers Zrt.

The Migrate in Core group of people working on Drupal 8 is preparing some meta issues

PHPUnit tests

The Migrate in Core group of people working on Drupal 8 is preparing some meta issues, making doable sub issues, and improving documentation, for:

  • people new to Drupal contribution but not new to PHPUnit,
  • people new to PHPUnit but not new to Drupal contribution.

Let's get ready to help with those small doable sub issues.

PHPUnit

Let's prepare to work on those issues, by first doing something simple: running Drupal's PHPUnit tests. If you have Drupal 8, you have PHPUnit already. Start with a git clone of Drupal 8.x (and git pull --rebase).

Now, run them. The Drupal.org documentation page Running PHPUnit tests has lots of helpful information. It covers running all tests, listing groups, running only tests in a group, or only a single test class, and also how to generate a code coverage report. And anyone, you, can edit the doc page to improve it if you like.

Ran the tests? Cool. You are prepared. :) The community is working on improved help documentation for how to get started writing tests. I'll let you know when it posts. But, if you can't wait, join the migrate in core group, or the general core issue [Meta] Convert UnitTestBase to PHPUnit has work going on.

[Migrate in core? Yep. See Dries's recent outline for Drupal 8 betas or go way back for some history in an issue.]

More good d.o docs

Recently when I had to send away my MacBook to get fixed, my daughter loaned her laptop to me. I didn't want to go on without PHPStorm, so installed it and had to set it up for Drupal coding standards.

The Drupal.org documentation page Setting up PhpStorm for Drupal's Coding Standards is nice, and still applies to the new versions. Since I just went through that experience, and it is fresh in my mind again, I thought it would be a good time to share more of the good documentation on Drupal.org. - YesCT

Related posts

Nginx + Ansible + HTTPS with LetsEncrypt and Nagios on top
Author
2018-05-22
Cloud

It's never good to do something that needs to be idempotent by hand. Here's how to configure Nginx with HTTPS using LetsEncrypt and Ansible.

cover
Author
2019-04-25
Drupal

One of our clients required an image of a map for print. As will be seen on the map, there will be marked places that represent where the company performed surveys.