Révision 5e632cae
Ajouté par Assos Assos il y a plus de 3 ans
drupal7/sites/all/modules/field_collection/field_collection.test | ||
---|---|---|
35 | 35 |
'field_name' => $this->field_name, |
36 | 36 |
'entity_type' => 'node', |
37 | 37 |
'bundle' => 'article', |
38 |
'label' => $this->randomName() . '_label',
|
|
39 |
'description' => $this->randomName() . '_description',
|
|
40 |
'weight' => mt_rand(0, 127),
|
|
38 |
'label' => self::randomName() . '_label',
|
|
39 |
'description' => self::randomName() . '_description',
|
|
40 |
'weight' => random_int(0, 127),
|
|
41 | 41 |
'settings' => array(), |
42 | 42 |
'widget' => array( |
43 | 43 |
'type' => 'hidden', |
... | ... | |
340 | 340 |
$this->drupalGet($path); |
341 | 341 |
$this->assertText(t('Test text field'), 'Add form is shown.'); |
342 | 342 |
|
343 |
$edit['field_text[und][0][value]'] = $this->randomName();
|
|
343 |
$edit['field_text[und][0][value]'] = self::randomName();
|
|
344 | 344 |
$this->drupalPost($path, $edit, t('Save')); |
345 | 345 |
$this->assertText(t('The changes have been saved.'), 'Field collection saved.'); |
346 | 346 |
|
347 | 347 |
$this->assertText($edit['field_text[und][0][value]'], 'Added field value is shown.'); |
348 | 348 |
|
349 |
$edit['field_text[und][0][value]'] = $this->randomName();
|
|
349 |
$edit['field_text[und][0][value]'] = self::randomName();
|
|
350 | 350 |
$this->drupalPost('field-collection/field-test-collection/1/edit', $edit, t('Save')); |
351 | 351 |
$this->assertText(t('The changes have been saved.'), 'Field collection saved.'); |
352 | 352 |
$this->assertText($edit['field_text[und][0][value]'], 'Field collection has been edited.'); |
... | ... | |
361 | 361 |
// Make sure adding doesn't work any more as we have restricted cardinality |
362 | 362 |
// to 1. |
363 | 363 |
$this->drupalGet($path); |
364 |
$this->assertText(t('Too many items.'), 'Maxium cardinality has been reached.');
|
|
364 |
$this->assertResponse(403);
|
|
365 | 365 |
|
366 | 366 |
$this->drupalPost('field-collection/field-test-collection/1/delete', array(), t('Delete')); |
367 | 367 |
$this->drupalGet($path); |
... | ... | |
457 | 457 |
'field_name' => $this->field_name, |
458 | 458 |
'entity_type' => 'node', |
459 | 459 |
'bundle' => 'article', |
460 |
'label' => $this->randomName() . '_label',
|
|
461 |
'description' => $this->randomName() . '_description',
|
|
462 |
'weight' => mt_rand(0, 127),
|
|
460 |
'label' => self::randomName() . '_label',
|
|
461 |
'description' => self::randomName() . '_description',
|
|
462 |
'weight' => random_int(0, 127),
|
|
463 | 463 |
'settings' => array(), |
464 | 464 |
'widget' => array( |
465 | 465 |
'type' => 'hidden', |
... | ... | |
572 | 572 |
'field_name' => $this->field_name, |
573 | 573 |
'entity_type' => 'node', |
574 | 574 |
'bundle' => 'article', |
575 |
'label' => $this->randomName() . '_label',
|
|
576 |
'description' => $this->randomName() . '_description',
|
|
577 |
'weight' => mt_rand(0, 127),
|
|
575 |
'label' => self::randomName() . '_label',
|
|
576 |
'description' => self::randomName() . '_description',
|
|
577 |
'weight' => random_int(0, 127),
|
|
578 | 578 |
'settings' => array(), |
579 | 579 |
'widget' => array( |
580 | 580 |
'type' => 'field_collection_embed', |
... | ... | |
618 | 618 |
*/ |
619 | 619 |
public function testContentTranslation() { |
620 | 620 |
// Create "Article" content. |
621 |
$edit['title'] = $this->randomName();
|
|
622 |
$edit['body[' . LANGUAGE_NONE . '][0][value]'] = $this->randomName();
|
|
621 |
$edit['title'] = self::randomName();
|
|
622 |
$edit['body[' . LANGUAGE_NONE . '][0][value]'] = self::randomName();
|
|
623 | 623 |
$edit['language'] = 'en'; |
624 | 624 |
$field_collection_name = 'field_test_collection[' . LANGUAGE_NONE . '][0][field_text][' . LANGUAGE_NONE . '][0][value]'; |
625 |
$edit[$field_collection_name] = $this->randomName();
|
|
625 |
$edit[$field_collection_name] = self::randomName();
|
|
626 | 626 |
|
627 | 627 |
$this->drupalPost('node/add/article', $edit, t('Save')); |
628 | 628 |
$this->assertRaw(t('Article %title has been created.', array('%title' => $edit['title'])), 'Article created.'); |
... | ... | |
787 | 787 |
'field_name' => $this->field_name, |
788 | 788 |
'entity_type' => 'node', |
789 | 789 |
'bundle' => 'page', |
790 |
'label' => $this->randomName() . '_label',
|
|
791 |
'description' => $this->randomName() . '_description',
|
|
792 |
'weight' => mt_rand(0, 127),
|
|
790 |
'label' => self::randomName() . '_label',
|
|
791 |
'description' => self::randomName() . '_description',
|
|
792 |
'weight' => random_int(0, 127),
|
|
793 | 793 |
'settings' => array(), |
794 | 794 |
'widget' => array( |
795 | 795 |
'type' => 'field_collection_embed', |
... | ... | |
864 | 864 |
$num_values = self::NUM_VALUES; |
865 | 865 |
} |
866 | 866 |
|
867 |
$title = $this->randomName();
|
|
867 |
$title = self::randomName();
|
|
868 | 868 |
|
869 | 869 |
$this->drupalGet('node/add/page'); |
870 | 870 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules