示例#1
0
 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')));
 }
示例#2
0
 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->drupalCreateUser(array('access content')));
 }
示例#3
0
 function setUp()
 {
     parent::setUp();
     $this->web_user = $this->drupalCreateUser(array('access content'));
     $this->drupalLogin($this->web_user);
 }
示例#4
0
 function setUp()
 {
     parent::setUp('pants');
     $this->web_user = $this->drupalCreateUser(array('change pants status'));
 }