You are here

function ContentAccessTestCase::postToCurrentPage in Content Access 5

Replacement for drupalPostRequest() if we don't want to reload a path

3 calls to ContentAccessTestCase::postToCurrentPage()
ContentAccessACLTestCase::testDeleteAccess in tests/content_access_acl.test
Test Deleting accessibility with permissions for single users
ContentAccessACLTestCase::testEditAccess in tests/content_access_acl.test
Test Editing accessibility with permissions for single users
ContentAccessACLTestCase::testViewAccess in tests/content_access_acl.test
Test Viewing accessibility with permissions for single users

File

tests/content_access_test_help.php, line 125
Helper class with auxiliary functions for content access module tests

Class

ContentAccessTestCase
@file Helper class with auxiliary functions for content access module tests

Code

function postToCurrentPage($edit = array(), $submit) {
  foreach ($edit as $field_name => $field_value) {
    $ret = $this->_browser
      ->setFieldByName($field_name, $field_value) || $this->_browser
      ->setFieldById("edit-{$field_name}", $field_value);
    $this
      ->assertTrue($ret, " [browser] Setting {$field_name}=\"{$field_value}\"");
  }
  $ret = $this->_browser
    ->clickSubmit(t($submit)) || $this->_browser
    ->clickSubmitById($submit) || $this->_browser
    ->clickSubmitByName($submit) || $this->_browser
    ->clickImageByName($submit);
  $this
    ->assertTrue($ret, ' [browser] POST by click on ' . t($submit));
  $this->_content = $this->_browser
    ->getContent();
}