I try to use feature for applying settings to sandbox in simpletest but can't make them applied.
How I try to do this (feature module is deploy_example):
parent::setUp('features', 'ctools', 'uuid', 'views', 'views_ui', 'entity', 'deploy', 'deploy_ui', 'deploy_aggregator_views', 'deploy_example');
features_rebuild();
cache_clear_all();
$this->resetAll();
I can see module enabled (I checked system table and did $this->drupalGet('admin/structure/features')) but can't see objects imported (feature has view, deploy plan, deploy endpoint).
Could you please guide how to enable feature so settings get applied?
Thank you in advance.
Comments
Comment #1
mpotter commentedClosing this for lack of activity. Please re-open this issue if you can reproduce it in the latest version.
Comment #2
zenlan commentedIn case you didn't get your feature working in your test, I found that features_get_features('myfeature') in setUp() works for me.
You can check the feature contents by assigning it to a variable:
$obj = features_get_features('myfeature');
$this->assertTrue(is_object($obj), 'FEATURES OBJECT: ' . print_r($obj, 1));
Comment #3
bbinkovitz commentedHow do you use features_get_feature() in setUp()? I thought setUp() just takes an array of module names?
Comment #4
lambic commentedI'm having this issue too. I tried calling features_get_features() in setup() and it didn't make any difference, the module is enabled but none of the featurised components are available to simpletest.
Comment #5
theolem commentedHaving the same problem, I never managed to activate a feature (containing custom content type, user permissions, etc) from within
setUp().Seems like I'll have to transfer everything to the module I want to test, which seems ... tedious.
Somebody got any update on this problem ?