Révision 389fb945
Ajouté par Assos Assos il y a environ 5 ans
drupal7/sites/all/modules/webform/tests/WebformTestCase.test | ||
---|---|---|
12 | 12 |
* {@inheritdoc} |
13 | 13 |
*/ |
14 | 14 |
public function setUp($added_modules = array()) { |
15 |
// Enable Webform and Token module if available. |
|
16 |
if (module_exists('token')) { |
|
17 |
$modules = array('webform', 'token'); |
|
18 |
} |
|
19 |
else { |
|
20 |
$modules = array('webform'); |
|
21 |
} |
|
15 |
// Enable Webform and Token modules. |
|
16 |
$modules = array('webform', 'token'); |
|
22 | 17 |
parent::setUp(array_merge($modules, $added_modules)); |
23 | 18 |
|
24 | 19 |
// Create a profile field to test [user:?] tokens. |
... | ... | |
724 | 719 |
'pid' => '0', |
725 | 720 |
'weight' => '-15', |
726 | 721 |
), |
727 |
// Manually hard-code the input if token is not available. |
|
728 |
// @todo: Update after http://drupal.org/node/1347790 is finished. |
|
729 |
'sample values' => module_exists('token') ? NULL : 'bar', |
|
722 |
'sample values' => NULL, |
|
730 | 723 |
'database values' => array('bar'), |
731 |
'database default values' => module_exists('token') ? array('bar') : array(''),
|
|
724 |
'database default values' => array('bar'),
|
|
732 | 725 |
), |
733 | 726 |
'textfield_profile' => array( |
734 | 727 |
'component' => array( |
... | ... | |
745 | 738 |
), |
746 | 739 |
'sample values' => 'Female', |
747 | 740 |
'database values' => array('Female'), |
748 |
// The default value will be blank if token does not exist. |
|
749 |
// @todo: Update after http://drupal.org/node/1347790 is finished. |
|
750 |
'database default values' => module_exists('token') ? array($this->webform_users['admin']->gender[LANGUAGE_NONE][0]['value']) : array(''), |
|
741 |
'database default values' => array($this->webform_users['admin']->gender[LANGUAGE_NONE][0]['value']), |
|
751 | 742 |
), |
752 | 743 |
|
753 | 744 |
// Test time components. |
Formats disponibles : Unified diff
Weekly update of contrib modules