Here's a start, I plan to move the createProject method to a separate class and have all the test* methods live in classes that extend ProjectTestCase.

Comments

mikey_p’s picture

Status: Active » Needs work
StatusFileSize
new432 bytes

Here's a follow up to move the abstracted stuff such as createProject to ProjectWebTestCase, so that ProjectTestCase and ProjectIssueTestCase can extend a common class where we can stash basic functionality (like createProject).

dww’s picture

@mikey_p: wrong patch. ;)

mikey_p’s picture

StatusFileSize
new4.82 KB

Yes :(

dww’s picture

great start, thanks! a few questions:

A) WTF?

+    call_user_func_array(array($this, 'parent::setUp'), $modules);

Why not just:

+   parent::setUp($modules);

?

B) What's up with the patch against project.js? ;)

Thanks!
-Derek

dave reid’s picture

D6 simpletest's setUp() doesn't accept only one parameter for an array of modules, that's why cufa() is needed since it needs to pass each module name as a separate parameter.

mikey_p’s picture

Status: Needs work » Needs review
StatusFileSize
new4.4 KB

Sorry about the mixup with project.js (it's not *that* wrong). Part of my notes from #371957: Add customized per project type related vocabularies were included.

This is passing for me.

dww’s picture

Status: Needs review » Fixed
StatusFileSize
new4.63 KB

Ran locally myself and saw all assertions pass, yay! Fixed some comments (see attached patch), and committed to HEAD.

YAY!!!

grendzy’s picture

dww’s picture

Component: Projects » Tests

For posterity. ;)

mikey_p’s picture

Status: Fixed » Needs review
StatusFileSize
new1.9 KB

It'd be good to have a standard pattern for this, updating project.test to match #776128: Add tests for issue creation (including metadata fields).

dww’s picture

Status: Needs review » Fixed

Yup, totally agreed. Ran tests locally and got all passes. Code looks good. Not going to wait for the bot -- committed to HEAD. Thanks!

Status: Fixed » Closed (fixed)

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