public function FeaturesHelperTestCase::testRevert in Helper 7
File
- tests/
FeaturesHelperTestCase.test, line 20
Class
Code
public function testRevert() {
$instance = field_info_instance('node', 'field_features_test', 'features_test');
$original_name = $instance['label'];
$override_name = 'Overridden';
$this
->assertNotEqual($original_name, $override_name);
$instance['label'] = 'Overridden';
field_update_instance($instance);
FeaturesHelper::revert(array(
'features_test',
));
$instance = field_info_instance('node', 'field_features_test', 'features_test');
$this
->assertIdentical($original_name, $instance['label']);
$instance['label'] = 'Overridden';
field_update_instance($instance);
FeaturesHelper::revertAll(FALSE, array(
'features_test',
));
$instance = field_info_instance('node', 'field_features_test', 'features_test');
$this
->assertIdentical($override_name, $instance['label']);
FeaturesHelper::revertAll();
$instance = field_info_instance('node', 'field_features_test', 'features_test');
$this
->assertIdentical($original_name, $instance['label']);
}