You are here

function OgFieldWidgetTestCase::testFieldSettings in Organic groups 7.2

Test "field widget settings" of the OG reference widget.

File

./og.test, line 1157

Class

OgFieldWidgetTestCase
Test the complex widget.

Code

function testFieldSettings() {
  $user = $this
    ->drupalCreateUser(array(
    'administer content types',
    'administer group',
    'access content',
    'administer fields',
  ));
  $this
    ->drupalLogin($user);
  $widgets = field_info_widget_types();
  foreach ($widgets as $widget => $settings) {
    if (in_array('entityreference', $settings['field types'])) {
      $widget_type_url = "admin/structure/types/manage/post/fields/" . OG_AUDIENCE_FIELD . "/widget-type";
      $this
        ->drupalPost($widget_type_url, array(
        'widget_type' => $widget,
      ), 'Continue');
      $edit_url = "admin/structure/types/manage/post/fields/" . OG_AUDIENCE_FIELD;
      $this
        ->drupalPost($edit_url, array(), 'Save settings');
    }
  }
}