You are here

function nodeButtonsEditTestCase::testEditButtonsAdminForm in Node buttons edit 7

Test setting our variables in the admin form.

File

./node_buttons_edit.test, line 22

Class

nodeButtonsEditTestCase

Code

function testEditButtonsAdminForm() {
  $preview_new_label = $this
    ->randomName();
  $preview_edit_label = $this
    ->randomName();
  $save_new_label = $this
    ->randomName();
  $save_edit_label = $this
    ->randomName();
  $delete_label = $this
    ->randomName();
  $edit = array();
  $edit['node_buttons_edit_preview_new'] = $preview_new_label;
  $edit['node_buttons_edit_preview_edit'] = $preview_edit_label;
  $edit['node_buttons_edit_save_new'] = $save_new_label;
  $edit['node_buttons_edit_save_edit'] = $save_edit_label;
  $edit['node_buttons_edit_delete_edit'] = $delete_label;
  $this
    ->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
  $this
    ->assertEqual($preview_new_label, variable_get('node_buttons_edit_preview_new_page'));
  $this
    ->assertEqual($preview_edit_label, variable_get('node_buttons_edit_preview_edit_page'));
  $this
    ->assertEqual($save_new_label, variable_get('node_buttons_edit_save_new_page'));
  $this
    ->assertEqual($save_edit_label, variable_get('node_buttons_edit_save_edit_page'));
  $this
    ->assertEqual($delete_label, variable_get('node_buttons_edit_delete_edit_page'));
}