You are here

public function CacheFlushUICRUD::testAddInterfaceIntegrity in CacheFlush 7.3

Test if add interface has all buttons/links/etc.

File

modules/cacheflush_ui/cacheflush_ui.test, line 45
Contains test suite for cacheflush ui module.

Class

CacheFlushUICRUD
Test the UI CRUD.

Code

public function testAddInterfaceIntegrity() {
  $this
    ->drupalGet('admin/structure/cacheflush/add');
  $this
    ->assertResponse(200);
  $this
    ->assertFieldByName('title');
  $this
    ->assertFieldByName('op', t('Save'));
  $this
    ->assertLink('Cancel');
  $tabs = module_invoke_all('cacheflush_ui_tabs');
  if ($tabs) {
    foreach ($tabs as $key => $value) {
      $this
        ->assertText($value['name']);
    }
  }
  $checkboxes = _cacheflush_get_option_list();
  if ($checkboxes) {
    foreach ($checkboxes as $key => $value) {

      // Special tab element added only if there module are instaled.
      if ($value['category'] == 'vertical_tabs_often' && !module_exists($key)) {
        continue;
      }
      $this
        ->assertFieldByName($value['category'] . "[{$key}]");
    }
  }
}