/**
  * {@inheritdoc}
  */
 public function setUp($modules = [])
 {
     parent::setUp();
     $this->admin_user = $this->drupalCreateUser(['administer content types', 'administer node fields']);
     $this->drupalLogin($this->admin_user);
     $node_type = NodeType::create(['type' => 'article', 'name' => 'Article', 'description' => "Use <em>articles</em> for time-sensitive content like news, press releases or blog posts."]);
     $node_type->save();
     entity_create('field_storage_config', array('field_name' => 'field_body', 'entity_type' => 'node', 'type' => 'text_with_summary'))->save();
     entity_create('field_config', array('field_name' => 'field_body', 'label' => 'Body', 'entity_type' => 'node', 'bundle' => 'article'))->save();
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function setUp($modules = [])
 {
     parent::setUp();
     $this->adminUser = $this->drupalCreateUser(['administer content types', 'administer node fields']);
     $this->drupalLogin($this->adminUser);
     $node_type = NodeType::create(['type' => 'article', 'name' => 'Article', 'description' => "Use <em>articles</em> for time-sensitive content like news, press releases or blog posts."]);
     $node_type->save();
     entity_create('field_storage_config', array('field_name' => 'field_body', 'entity_type' => 'node', 'type' => 'text_with_summary'))->save();
     entity_create('field_config', array('field_name' => 'field_body', 'label' => 'Body', 'entity_type' => 'node', 'bundle' => 'article'))->save();
     entity_create('field_storage_config', array('field_name' => 'field_image', 'entity_type' => 'node', 'type' => 'image'))->save();
     entity_create('field_config', array('field_name' => 'field_image', 'label' => 'Image', 'entity_type' => 'node', 'bundle' => 'article'))->save();
     entity_get_form_display('node', 'article', 'default')->setComponent('field_body', ['type' => 'text_textarea_with_summary', 'settings' => ['rows' => '9', 'summary_rows' => '3'], 'weight' => 5])->save();
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     // Enable user pictures.
     \Drupal::state()->set('user_pictures', 1);
     \Drupal::state()->set('user_picture_file_size', '');
     // Set up the pictures directory.
     $picture_path = file_default_scheme() . '://' . \Drupal::state()->get('user_picture_path', 'pictures');
     if (!file_prepare_directory($picture_path, FILE_CREATE_DIRECTORY)) {
         $this->fail('Could not create directory ' . $picture_path . '.');
     }
     $this->account = $this->drupalCreateUser(array('administer users'));
     $this->drupalLogin($this->account);
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function setUp($modules = array())
 {
     parent::setUp();
     $this->admin_user = $this->drupalCreateUser(array('access content', 'administer blocks'));
     $this->drupalLogin($this->admin_user);
 }
Example #5
0
 public function setUp()
 {
     parent::setUp();
     $this->account = $this->drupalCreateUser(['access administration pages']);
     $this->drupalLogin($this->account);
 }
Example #6
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->saveAlias('node/1', 'first-node');
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->account = $this->drupalCreateUser(['administer users', 'administer account settings']);
     $this->drupalLogin($this->account);
 }