Hi @all,
I just wrote a little module that provides another image effect and I would like to test this effect using atest class extending the ImageToolkitTestCase class. Unfortunately the ImageToolkitTestCase's setUp method looks like this:
function setUp() {
parent::setUp('image_test');
// ... more code to come
}
The parent call makes it impossible to extend that class, while having other modules to be loaded... So perhaps it should be changed to:
function setUp() {
$modules = func_get_args();
$modules[] = 'image_test';
call_user_func_array(array('parent', 'setUp'), $modules);
// ... more code to come
}
This would allow to extend that class for custom tests... and I guess every other base test class should do the following so any respective test cases may extend them, in order to not write the same code again and again.
See also:
- #610072: setUp() function accepting array as arguments
- #644628: FieldAttachTestCase cannot be reused
I'd appreciate your feedback.
Thanx un advance & cheers
hctom
Comments
Comment #1
pingers commentedThis has since been resolved. The code you provided is very similar to what is now in the test in 7.x.
(looking at func_get_args() and loading all modules provided in addition to 'image_test')
See 4d392996a29b5e650018d403684333884530b9c6 & #1761086: Caching in image_effects_definitions() broken