Révision 41cc1b08
Ajouté par Assos Assos il y a presque 9 ans
drupal7/sites/all/modules/feeds/tests/feeds_mapper.test | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* Helper class with auxiliary functions for feeds mapper module tests.
|
|
5 |
* Contains FeedsMapperTestCase.
|
|
6 | 6 |
*/ |
7 | 7 |
|
8 | 8 |
/** |
9 |
* Base class for implementing Feeds Mapper test cases.
|
|
9 |
* Helper class with auxiliary functions for feeds mapper module tests.
|
|
10 | 10 |
*/ |
11 | 11 |
class FeedsMapperTestCase extends FeedsWebTestCase { |
12 | 12 |
|
... | ... | |
19 | 19 |
'email' => 'email_textfield', |
20 | 20 |
'emimage' => 'emimage_textfields', |
21 | 21 |
'emaudio' => 'emaudio_textfields', |
22 |
'filefield' => 'filefield_widget',
|
|
23 |
'image' => 'imagefield_widget',
|
|
22 |
'file' => 'file_generic',
|
|
23 |
'image' => 'image_image',
|
|
24 | 24 |
'link_field' => 'link_field', |
25 |
'list_text' => 'options_select', |
|
25 | 26 |
'number_float' => 'number', |
26 | 27 |
'number_integer' => 'number', |
27 | 28 |
'nodereference' => 'nodereference_select', |
28 | 29 |
'text' => 'text_textfield', |
30 |
'text_long' => 'text_textarea', |
|
31 |
'text_with_summary' => 'text_textarea_with_summary', |
|
29 | 32 |
'userreference' => 'userreference_select', |
30 | 33 |
); |
31 | 34 |
|
... | ... | |
52 | 55 |
} |
53 | 56 |
} |
54 | 57 |
|
58 |
/** |
|
59 |
* Assert that a form field for the given field with the given value |
|
60 |
* does not exist in the current form. |
|
61 |
* |
|
62 |
* @param $field_name |
|
63 |
* The name of the field. |
|
64 |
* @param $value |
|
65 |
* The (raw) value of the field. |
|
66 |
* @param $index |
|
67 |
* The index of the field (for q multi-valued field). |
|
68 |
* |
|
69 |
* @see FeedsMapperTestCase::getFormFieldsNames() |
|
70 |
* @see FeedsMapperTestCase::getFormFieldsValues() |
|
71 |
*/ |
|
72 |
protected function assertNoNodeFieldValue($field_name, $value, $index = 0) { |
|
73 |
$names = $this->getFormFieldsNames($field_name, $index); |
|
74 |
$values = $this->getFormFieldsValues($field_name, $value); |
|
75 |
foreach ($names as $k => $name) { |
|
76 |
$value = $values[$k]; |
|
77 |
$this->assertNoFieldByName($name, $value, t('Did not find form field %name for %field_name with the value %value.', array('%name' => $name, '%field_name' => $field_name, '%value' => $value))); |
|
78 |
} |
|
79 |
} |
|
80 |
|
|
55 | 81 |
/** |
56 | 82 |
* Returns the form fields names for a given CCK field. Default implementation |
57 | 83 |
* provides support for a single form field with the following name pattern |
... | ... | |
157 | 183 |
$field_widgets = FeedsMapperTestCase::$field_widgets; |
158 | 184 |
return isset($field_widgets[$field_type]) ? $field_widgets[$field_type] : NULL; |
159 | 185 |
} |
186 |
|
|
160 | 187 |
} |
Formats disponibles : Unified diff
Update feeds 7.x-2.0-alpha9 -> 7.x-2.0-beta1
Install lib simplepie 1.3.1