Révision 582db59d
Ajouté par Assos Assos il y a plus de 8 ans
drupal7/modules/file/tests/file.test | ||
---|---|---|
951 | 951 |
$this->assertRaw($field_name . '[' . LANGUAGE_NONE . '][0][display]', 'First file appears as expected.'); |
952 | 952 |
$this->assertRaw($field_name . '[' . LANGUAGE_NONE . '][1][display]', 'Second file appears as expected.'); |
953 | 953 |
} |
954 |
|
|
955 |
/** |
|
956 |
* Tests default display of File Field. |
|
957 |
*/ |
|
958 |
function testDefaultFileFieldDisplay() { |
|
959 |
$field_name = strtolower($this->randomName()); |
|
960 |
$type_name = 'article'; |
|
961 |
$field_settings = array( |
|
962 |
'display_field' => '1', |
|
963 |
'display_default' => '0', |
|
964 |
); |
|
965 |
$instance_settings = array( |
|
966 |
'description_field' => '1', |
|
967 |
); |
|
968 |
$widget_settings = array(); |
|
969 |
$this->createFileField($field_name, $type_name, $field_settings, $instance_settings, $widget_settings); |
|
970 |
$field = field_info_field($field_name); |
|
971 |
$instance = field_info_instance('node', $field_name, $type_name); |
|
972 |
|
|
973 |
$test_file = $this->getTestFile('text'); |
|
974 |
|
|
975 |
// Create a new node with the uploaded file. |
|
976 |
$nid = $this->uploadNodeFile($test_file, $field_name, $type_name); |
|
977 |
|
|
978 |
$this->drupalGet('node/' . $nid . '/edit'); |
|
979 |
$this->assertFieldByXPath('//input[@type="checkbox" and @name="' . $field_name . '[und][0][display]"]', NULL, 'Default file display checkbox field exists.'); |
|
980 |
$this->assertFieldByXPath('//input[@type="checkbox" and @name="' . $field_name . '[und][0][display]" and not(@checked)]', NULL, 'Default file display is off.'); |
|
981 |
} |
|
954 | 982 |
} |
955 | 983 |
|
956 | 984 |
/** |
Formats disponibles : Unified diff
Update Drupal core to version 7.40