Counterpart to #774844: Consider moving some setup logic from pift.test into project.test.

boombatower has written a number of tests for PIFT and this is an attempt to move some of the code there into project module.

This sets up taxonomy terms for the project and fixes the createProject method to return a more useful value (the created node).

Comments

dww’s picture

Status: Needs review » Needs work

Great start for this, yay.

A) I think it makes sense for this base class *not* to have PIFT-specific stuff (since that's really a special case) and left pift.test have a class that derives from this which adds its own PIFT-specific stuff, e.g. this block:

/**
+   * Associative array of PIFT settings used for testing.
+   *
+   * @var array
+   */
+  protected $settings = array();

p.s. even in pift.test, this variable should probably be called $pift_settings if that's what it is. ;)

B) I'm a bit hesitant to write tests with cvs.module involved, since it's *just* about to die and be replaced. Seems like extra effort we should avoid if at all possible.

C) This sounds like a bug we should fix in a new issue, not something to hack-around in this patch:

+    // Temporarily set vocabulary to remove notices during login.
+    _project_get_vid();
+    variable_set('project_release_api_vocabulary', 1);

D) Wow, really, this is the only way to add a vocab from inside a test?

+    $this->drupalPost('admin/content/taxonomy/add/vocabulary', $edit, t('Save'));

Alas...

E) s/dumy/dummy/

F) s/proeject/project/

mikey_p’s picture

StatusFileSize
new8.14 KB

This addresses ABCDEF, but still doesn't seem to handle creating the project releases properly. This still fixes up createIssue to return the node object as well.

mikey_p’s picture

Status: Needs work » Needs review

I'm tired.

dww’s picture

Status: Needs review » Fixed

Committed to HEAD. Yay, thanks!!!

mikey_p’s picture

Status: Fixed » Needs review
StatusFileSize
new546 bytes

This seems to be causing some errors when running tests, since ProjectDrupalOrgWebTestCase doesn't have any tests method, but does have an info method.

dww’s picture

Status: Needs review » Needs work

I'd rather have a test method in that class if that's what we need. ;)