Start learning with our library of video tutorials taught by experts. Get started

Drupal 7 New Features

Assuring quality with the testing module


From:

Drupal 7 New Features

with Tom Geller

Video: Assuring quality with the testing module

You've probably heard the saying "measure twice cut onc"". That makes sense in the physical world where you can't undo a cut, but in the development world, the winning path is to cut, see how the cut turned out, then redo the cut, then check it again, and on and on until you get it right. Since Version 4, the Drupal way of doing that iterative process has involved a module called Simple Test, which is still available at drupal.org/project/simpletest. Simple Test automatically stress-tests a module by running your custom scripts of actions against it, then it reports the results of those tests back to you.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
Please wait...
Drupal 7 New Features
2h 38m Intermediate Oct 07, 2010

Viewers: in countries Watching now:

In Drupal 7 New Features, author Tom Geller demonstrates changes to the Drupal 7 administrative interface and other enhancements that have come out of its three-year development period. This course covers its simplified installation process, new themes that will help kick-start design projects, the customizable shortcut bar that puts often-used commands in easy reach, update procedures that leverage its browser-based interface, and a new way of defining fields to create complex content types without additional modules.

Topics include:
  • Configuring the new Dashboard
  • Using contextual link controls
  • Exploring new themes
  • Reviewing the new modules
  • Understanding the expanded block system
  • Using images in content
  • Allowing users to delete accounts
  • Testing modules with the Testing module
  • Building themes using Drupal Gardens
Subjects:
Web CMS
Software:
Drupal
Author:
Tom Geller

Assuring quality with the testing module

You've probably heard the saying "measure twice cut onc"". That makes sense in the physical world where you can't undo a cut, but in the development world, the winning path is to cut, see how the cut turned out, then redo the cut, then check it again, and on and on until you get it right. Since Version 4, the Drupal way of doing that iterative process has involved a module called Simple Test, which is still available at drupal.org/project/simpletest. Simple Test automatically stress-tests a module by running your custom scripts of actions against it, then it reports the results of those tests back to you.

Drupal's developers thought that Simple Test was so good that they integrated it into Drupal 7 as the Testing module. This video won't show you how to actually write your own tests. That's really much too big a job, and you have to know the programming language PHP. Instead, we'll run some of the tests that are included with Drupal 7, look at the reports that it creates, and follow some links to see where to go to create custom tests yourself. By default, the Testing module is turned off. To turn it on, of course, you go up to Modules, scroll down until you see Testing, turn it on, and save configuration.

Once you've turned it on, you configure it by clicking Configuration, then you scroll down until you see the Development area, and there it is, Testing. Drupal 7 includes quite a lot of tests that you could run automatically, that is, without writing any additional scripts. If you click on any of these arrows, you see the individual tests that run against that module. Again, when all is said and done, there are dozens and dozens of tests. By the way, notice that the Aggregator module has tests available. Even though we haven't turned on the Aggregator module, you can test modules that aren't actually enabled on your site.

To run all of the tests for a module, you simply click in the checkbox. to run an individual one, you would open up that particular module and then check and uncheck as you'd like. I'm going to run all of the tests that are included against the Actions module. So we just click there, scroll down to the bottom, and say Run tests. To save some time, we'll just fast- forward through these tests in this video. In reality, this testing suite takes a couple of minutes, but as you can see, you get a progress bar while the tests are running, along with some real-time information about what's going on.

When the tests are done, you of course get a report. You can see the reports by scrolling down here and opening up any of the links that it gives you, and here we have our results. For the most part, they're given in one- line statements like this, but in some cases, more information is required. In that case, it gives you a verbose message link. When we click on it, we see exactly what the test was and what the results were. It shows the page that it affected and what it actually did. In this case, it requested a user account. Let's go back to the Testing module and take a look at some of the settings that you have.

Once you're back on the Testing page, scroll up to the top and click Return to list. Of course, you could also click the back arrow in your browser. On the main Testing page, you can look at some of the settings you have by clicking the Settings tab. For the most part, you won't have to touch these. As you see, you only have two settings in general. The second link is just an HTTP authentication settings, which you would add if you had some sort of special settings in your web server. If you are a non-programmer like me, you'll probably never use the Testing module for your own projects, but it does have an additional advantage.

You can actually use the Testing module to help produce Drupal itself. To learn how to do that, go to drupal.org/contribute. Once there, scroll down to Testing, and click on the link to find out how you could help, even if you're not a developer. Beyond what you learn on this page, you can also look through the Issue Queue on any particular module that you're interested in and would like to help develop and join the discussions in the Issues Queues to find out exactly what you could do to help test them.

There are currently no FAQs about Drupal 7 New Features.

Share a link to this course
Please wait... Please wait...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Drupal 7 New Features.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked