You are here

function WebformLocalizationApiTestCase::testWebformLocalizationApi in Webform Localization 7.4

Same name and namespace in other branches
  1. 7 tests/webform_localization.test \WebformLocalizationApiTestCase::testWebformLocalizationApi()

Test submissions API function with webform localization presence.

File

tests/webform_localization.test, line 516
Webform localization module tests.

Class

WebformLocalizationApiTestCase

Code

function testWebformLocalizationApi() {
  $this
    ->drupalLogin($this->adminuser);
  $node = $this
    ->createWebformForm();

  /**
   * Enables localization by string translation and reuse the single webform
   * across the translation set.
   */
  $edit = array();
  $edit['expose_strings'] = TRUE;
  $edit['single_webform'] = TRUE;
  $this
    ->drupalPost('node/' . $node->nid . '/webform/configure', $edit, t('Save configuration'));
  $this
    ->assertRaw(t('The form settings have been updated.'), 'Webform string translation and single webform enabled.');
  module_load_include('inc', 'webform', 'includes/webform.submissions');
  $this
    ->assertFalse(webform_get_submissions($node->nid), "Function webform_get_submission({$node->nid},1000) work correctly with empty submissions.");
}