So... I found a solution that's working, at least for my case.
It has to do with the fact that test cases are actually PHP classes that can be extended. So I tried to leverage inheritance, with a caveat...
I want to run a test on the pager, Drupal 7, after I have enabled a module that replaces the core pager.
The core pager test class is defined as
class PagerFunctionalWebTestCase extends DrupalWebTestCase {
now, my problem was that the core test would not be caring about my module to be loaded before running the tests.
I created my module test class as an extension of the core one, like
class MyPagerTest extends PagerFunctionalWebTestCase {
This is OK, but the point is that if I call parent::setUp() at this stage, the core setup will be run and I will still miss my module from loading before the actual test.
So the caveat is that instead of calling parent::setUp, I will call directly the 'ancestor' DrupalWebtestCase::setUp function, with my setup, and skip the call to parent.
Like this:
...
public function setUp() {
// Enable required modules.
$modules = array(
'dblog',
'mypager',
);
DrupalWebTestCase::setUp($modules);
// Insert 300 log messages.
for ($i = 0; $i < 300; $i++) {
watchdog('pager_test', $this->randomString(), NULL, WATCHDOG_DEBUG);
}
$this->admin_user = $this->drupalCreateUser(array(
'access site reports',
));
$this->drupalLogin($this->admin_user);
}
....
That's all - class inheritance will do the magic and bring the rest of the test functions in.
Anybody sees other options?