Update to Drupal 8.0.1. For more information, see https://www.drupal.org/node/2627402
This commit is contained in:
parent
013aaaf2ff
commit
1a0e9d9fac
153 changed files with 1268 additions and 670 deletions
|
@ -8,6 +8,7 @@
|
|||
namespace Drupal\field\Tests\EntityReference;
|
||||
|
||||
use Drupal\Core\Entity\Entity;
|
||||
use Drupal\Core\Field\FieldStorageDefinitionInterface;
|
||||
use Drupal\field_ui\Tests\FieldUiTestTrait;
|
||||
use Drupal\node\Entity\Node;
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
@ -235,7 +236,12 @@ class EntityReferenceAdminTest extends WebTestBase {
|
|||
'field_name' => $field_name,
|
||||
);
|
||||
$this->drupalPostForm($bundle_path . '/fields/add-field', $edit, t('Save and continue'));
|
||||
$this->drupalPostForm(NULL, array(), t('Save field settings'));
|
||||
|
||||
// Set to unlimited.
|
||||
$edit = array(
|
||||
'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
|
||||
);
|
||||
$this->drupalPostForm(NULL, $edit, t('Save field settings'));
|
||||
|
||||
// Add the view to the test field.
|
||||
$edit = array(
|
||||
|
@ -268,6 +274,17 @@ class EntityReferenceAdminTest extends WebTestBase {
|
|||
$this->assertRaw($node1->getTitle() . ' (' . $node1->id() . ')');
|
||||
$this->assertRaw($node2->getTitle() . ' (' . $node2->id() . ')');
|
||||
|
||||
// Try to add a new node, fill the entity reference field and submit the
|
||||
// form.
|
||||
$this->drupalPostForm('node/add/' . $this->type, [], t('Add another item'));
|
||||
$edit = array(
|
||||
'title[0][value]' => 'Example',
|
||||
'field_test_entity_ref_field[0][target_id]' => 'Foo Node (' . $node1->id() . ')',
|
||||
'field_test_entity_ref_field[1][target_id]' => 'Foo Node (' . $node2->id() . ')',
|
||||
);
|
||||
$this->drupalPostForm(NULL, $edit, t('Save'));
|
||||
$this->assertResponse(200);
|
||||
|
||||
$edit = array(
|
||||
'title[0][value]' => 'Example',
|
||||
'field_test_entity_ref_field[0][target_id]' => 'Test'
|
||||
|
|
Reference in a new issue