Révision 389fb945
Ajouté par Assos Assos il y a presque 5 ans
drupal7/sites/all/modules/webform/tests/WebformSubmissionTestCase.test | ||
---|---|---|
23 | 23 |
$this->drupalLogin($this->webform_users['admin']); |
24 | 24 |
$this->webformReset(); |
25 | 25 |
$this->webformSubmissionExecute('sample'); |
26 |
|
|
27 |
$loggedInUser = $this->loggedInUser; |
|
28 |
|
|
26 | 29 |
$this->drupalLogout(); |
30 |
|
|
31 |
// Test webform_get_submission_count(). |
|
32 |
$this->webformSubmissionExecute('sample'); |
|
33 |
|
|
34 |
$count = webform_get_submission_count($this->webformForm()->nid); |
|
35 |
$this->assertIdentical((int) $count, 2, 'webform_get_submission_count() counts 2 total submissions.'); |
|
36 |
|
|
37 |
$count = webform_get_submission_count($this->webformForm()->nid, $loggedInUser->uid); |
|
38 |
$this->assertIdentical((int) $count, 1, 'webform_get_submission_count() counts 1 submission from loggedInUser.'); |
|
39 |
|
|
40 |
// Counting the anonymous submission doesn't work because |
|
41 |
// $_SESSION['webform_submission'] is not populated in testing. |
|
27 | 42 |
} |
28 | 43 |
|
29 | 44 |
/** |
... | ... | |
156 | 171 |
$actual_value = $actual_submission->data[$cid]; |
157 | 172 |
$result = $this->assertEqual($stable_value, $actual_value, t('Component @form_key data integrity check when using @type values.', array('@form_key' => $component['form_key'], '@type' => $value_type)), t('Webform')); |
158 | 173 |
if (!$result || $result === 'fail') { |
159 |
$this->fail(t('Expected !expected', array('!expected' => print_r($stable_value, TRUE))) . "\n\n" . t('Recieved !recieved', array('!recieved' => print_r($actual_value, TRUE))), t('Webform'));
|
|
174 |
$this->fail(t("Expected !expected\n\nRecieved !recieved", array('!expected' => print_r($stable_value, TRUE), '!recieved' => print_r($actual_value, TRUE))), t('Webform'));
|
|
160 | 175 |
} |
161 | 176 |
} |
162 | 177 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules