protected function setUp() { parent::setUp(); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Page')); // Create a multi-valued field for 'page' nodes to use for Ajax testing. $field_name = 'field_ajax_test'; FieldStorageConfig::create(array('entity_type' => 'node', 'field_name' => $field_name, 'type' => 'text', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED))->save(); FieldConfig::create(['field_name' => $field_name, 'entity_type' => 'node', 'bundle' => 'page'])->save(); entity_get_form_display('node', 'page', 'default')->setComponent($field_name, array('type' => 'text_textfield'))->save(); // Log in a user who can create 'page' nodes. $this->drupalLogin($this->drupalCreateUser(array('create page content'))); }
protected function setUp() { parent::setUp(); $this->drupalLogin($this->drupalCreateUser(array('access content'))); }
function setUp() { parent::setUp(); $this->web_user = $this->drupalCreateUser(array('access content')); $this->drupalLogin($this->web_user); }
function setUp() { parent::setUp('pants'); $this->web_user = $this->drupalCreateUser(array('change pants status')); }