The simpletest example modules from http://drupal.org/node/395012 should go here instead of being attached to that page.

Comments

dave reid’s picture

Since we're adding tests to all the example module anyway, what might be better is instead of having that attached example module there, say "The Examples Module project contains many smaller modules with tests written." or something like that.

ilo’s picture

I would say yes. Also, I'm considering changing the group in each .test file to a more generic one: "Example modules" or something like that, instead of a group for each module.

ideas?

rfay’s picture

@davereid, I'm still thinking that the simpletest example module should go here, as its intent is to teach about tests. The intent of the tests here is to test the modules. Also, that example is tied to that tutorial.

@ilo: My opinion would be that each module should have its own tests in its own directory. They're packaged together, but completely independent in every other way.

dave reid’s picture

Actually the mymodule in the SimpleTest example (mymodule.module) is a glorified simplified version of node_example.module. So I don't think it requires bringing in that example. Maybe just integrating the mymodule.test with node_example.test. But I don't think we need to add another module.

rfay’s picture

Title: Bring in Simpletest example modules » Enhance node_example.test as simpletest tutorial.

Seems reasonable.

ilo’s picture

One of the things I like from myexample.test is that introduces unit tests. I guess we can include some unit tests in each example module for the functions that are not hooks (or even the hooks).. but I'm unsure that this has to be done in any .test file. The ugly part is that if we choose one (node_example is a good candidate) we should notice to the developer that this one includes a test file deserving special attention. Otherwise I would prefer having a specific simpletest example module.

ilo’s picture

@rfay: I agree that each simpletest file should be shipped in each module directory. When I talked about regrouping them, I was talking about the simpletest getInfo() information:

  public static function getInfo() {
    return array(
      'name' => 'Batch example functionality',
      'description' => 'Verify that defined batches and its consistency in the database.',
      'group' => 'Batch example',
    );
  }

If each test defines a different group, we will finish with 10 or 15 'example' cagetories, rather than a "Examples" category.

dave reid’s picture

+1 for making all the tests 'group' => 'Examples'

rfay’s picture

Title: Enhance node_example.test as simpletest tutorial. » Create new simpletest tutorial example
Assigned: Unassigned » rfay

Since the D7 node example is now much more involved, I'm reworking the simpler example as simpletest_example.

My problem is making a test that can demonstrate a failure when run directly, but *not* fail when run by PIFR. I need a failure for when people run it by hand, to show how things work. But I don't want it to fail under the testbot.

Any thoughts?

rfay’s picture

Status: Active » Needs review
StatusFileSize
new7.13 KB

Here's the D7 version. Boombatower told me how to detect the bot, so we'll see how it works.

rfay’s picture

Version: » 6.x-1.x-dev
Status: Needs review » Needs work

Passed the bot, so committed:
http://drupal.org/cvs?commit=327436

Moving to D6.

rfay’s picture

Status: Needs work » Needs review
StatusFileSize
new6.21 KB

Here's the D6 version.

rfay’s picture

StatusFileSize
new6.07 KB

Minor change to comments.

rfay’s picture

Status: Needs review » Fixed

Passed the bot, so committing. http://drupal.org/cvs?commit=327476
The tutorial associated with this is at http://drupal.org/node/395012

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.