Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matt Glaman:
Running Drupal's PHPUnit test suites on DDEV
Oct 15, 2018 @ 14:36:29

Matt Glaman has a new post to his site where he walks you through the setup and execution of Drupal's unit tests in the DDEV platform (a Docker-based project that makes it easy to get an environment up quickly).

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?

I have had quite a few people ask me how I configure my setup for testing with Drupal’s PHPUnit test suites. [...] All of these are the same reasons for using a virtual machine or containerized local development stack. So, it is fitting we run our tests within these local stacks as well!

In this article, part one of three, he assumes you already have a DDEV environment up and running with a Drupal application running inside (there's a guide here). With that in place, he shows how to configure PHPUnit via the phpunit.xml file, changing the "SIMPLETEST_*" values for the localhost and local DB connections. He shows how to run the tests by SSHing into the web Docker container and pointing PHPUnit at the configuration file. The end result should look something like this in a terminal.

tagged: tutorial series part1 drupal test unittest ddev docker testsuite

Link: https://glamanate.com/blog/running-drupals-phpunit-test-suites-ddev

Debuggable Blog:
Running Tests from The Commandline in CakePHP
May 08, 2008 @ 15:27:41

New on the Debuggable blog today there's this post from Tim Koschutzki about a new feature he's contributed back to the CakePHP project. It allows you to run tests on the command line without having to worry about loading up a web interface to check your code.

It allows you to run all of the following: all core testcases at once, all core test groups, each core test case individually, all application-specific testcases at once, all application-specific test groups and each core test case individually. It also supports plugins, which means you can run plugin cases and groups.

He includes some samples of how it works - a few command line calls and what the output looks like.

tagged: test unittest commandline cakephp framework testsuite

Link:

Evert Pot's Blog:
PHPUnit3 : first impressions
May 10, 2007 @ 16:48:00

Evert Pot has posted some of his initial impressions of the latest version of PHPUnit that he got his hands on - PHPUnit 3:

For a testing framework I picked PHPUnit. My main reason for picking this was that its fully written in PHP5, it can produce some pretty good reports and the biggest reason is simply because I hear a lot of good stuff about it.

Among his thoughts were mentions of PHPUnit's great documentation (but made it hard to just get started), a bit of unintuitive functionality with the addTestSuite method and some of the pain that it took to get together a full suite of tests.

tagged: phpunit first impression documentation testsuite zendframework phpunit first impression documentation testsuite zendframework

Link:

Evert Pot's Blog:
PHPUnit3 : first impressions
May 10, 2007 @ 16:48:00

Evert Pot has posted some of his initial impressions of the latest version of PHPUnit that he got his hands on - PHPUnit 3:

For a testing framework I picked PHPUnit. My main reason for picking this was that its fully written in PHP5, it can produce some pretty good reports and the biggest reason is simply because I hear a lot of good stuff about it.

Among his thoughts were mentions of PHPUnit's great documentation (but made it hard to just get started), a bit of unintuitive functionality with the addTestSuite method and some of the pain that it took to get together a full suite of tests.

tagged: phpunit first impression documentation testsuite zendframework phpunit first impression documentation testsuite zendframework

Link:


Trending Topics: