Révision 7fe061e8
Ajouté par Assos Assos il y a plus de 8 ans
drupal7/sites/all/modules/link/tests/link.attribute.test | ||
---|---|---|
254 | 254 |
} |
255 | 255 |
} |
256 | 256 |
|
257 |
function testFormatterHost() { |
|
258 |
$content_type_friendly = $this->randomName(20); |
|
259 |
$content_type_machine = strtolower($this->randomName(10)); |
|
260 |
|
|
261 |
$this->drupalCreateContentType(array( |
|
262 |
'type' => $content_type_machine, |
|
263 |
'name' => $content_type_friendly, |
|
264 |
)); |
|
265 |
|
|
266 |
|
|
267 |
// Now add a singleton field. |
|
268 |
$single_field_name_friendly = $this->randomName(20); |
|
269 |
$single_field_name_machine = strtolower($this->randomName(10)); |
|
270 |
//$single_field_name = 'field_'. $single_field_name_machine; |
|
271 |
$this->createSimpleLinkField($single_field_name_machine, $single_field_name_friendly, $content_type_machine); |
|
272 |
|
|
273 |
// Okay, now we want to make sure this display is changed: |
|
274 |
$this->drupalGet('admin/structure/types/manage/'. $content_type_machine .'/display'); |
|
275 |
$edit = array( |
|
276 |
'fields[field_'. $single_field_name_machine .'][label]' => 'above', |
|
277 |
'fields[field_'. $single_field_name_machine .'][type]' => 'link_host', |
|
278 |
); |
|
279 |
$this->drupalPost(NULL, $edit, t('Save')); |
|
280 |
|
|
281 |
$this->createNodeTypeUser($content_type_machine); |
|
282 |
|
|
283 |
$link_text = 'Display'; |
|
284 |
$link_url = 'http://www.example.com/'; |
|
285 |
$this->createNodeForTesting($content_type_machine, $content_type_friendly, $single_field_name_machine, $link_text, $link_url); |
|
286 |
|
|
287 |
$this->assertText('www.example.com'); |
|
288 |
$this->assertNoText($link_text); |
|
289 |
$this->assertNoLinkByHref($link_url); |
|
290 |
} |
|
291 |
|
|
257 | 292 |
function testFormatterURL() { |
258 | 293 |
$content_type_friendly = $this->randomName(20); |
259 | 294 |
$content_type_machine = strtolower($this->randomName(10)); |
Formats disponibles : Unified diff
Weekly update of contrib modules