How do I enable a features module in the setup of a simpletest testcase I'm trying to test some permissions that are related to custom node types and Organic Groups that I've built and packaged as a feature using the features module.

I'm trying to enable the feature (and create all the content types and taxonomies that are part of the feature) in the setUp method of my simpletest test case class like this:

class PermissionsTestCase extends DrupalWebTestCase {
  public function setUp() {
    parent::setUp(array(
      'addressfield',
      'ctools',
      'date',
      'entityreference',
      'features',
      'file',
      'list',
      'node',
      'og',
      'og_field_access',
      'og_ui',
      'options',
      'strongarm',
      'taxonomy',
      'text',
      'my_custom_feature',
    ));
    debug(module_list(TRUE));
    debug(features_get_features());

    // More setup stuff that depends on content types and taxonomies in my feature
    // ...
  }
}


However, when I look at the output of module_list it doesn't include my feature or the dependencies and subsequent setup tasks that rely on a taxonomy that's part of my feature don't find the taxonomy vocabulary.

Can I enable a module created with features in the setUp method? What's the best way to do this?

Do I have to explicitly specify the dependencies of my feature in the call to parent::setUp?  What about the dependencies of my dependencies? Does the order matter?
As of Drupal 7 you don't have to explicitly specify module dependencies, they are resolved automatically.  The order doesn't matter either for that same reason.

As far as actually enabling the feature, it should be fine... I was going to suggest calling drupal_static_reset('system_list') before module_list() but it already does that itself when you pass TRUE as the first param like you did.

I've had some issues when testing features modules and, in certain situations, I've found that it's actually better (and much slower) to force SimpleTest to use the live database.

Granted, that's very specific to certain types of client projects, but still, might help! :)