function setUp() { parent::setUp(); // Add some basic test nodes. $this->nodes = array(); $this->nodes[] = $this->drupalCreateNode(array('created' => 100000)); $this->nodes[] = $this->drupalCreateNode(array('created' => 200000)); $this->nodes[] = $this->drupalCreateNode(array('created' => 300000)); $this->nodes[] = $this->drupalCreateNode(array('created' => time() + 86400)); $this->map = array('nid' => 'nid'); }
protected function setUp() { parent::setUp(); // Create content type with unlimited text field. $node_type = $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); // Create the unlimited text field. $field_storage = entity_create('field_storage_config', array('field_name' => $this->fieldName, 'entity_type' => 'node', 'type' => 'text', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)); $field_storage->save(); // Create an instance of the text field on the content type. $field = array('field_storage' => $field_storage, 'bundle' => $node_type->id()); entity_create('field_config', $field)->save(); }
protected function viewsData() { $data = parent::viewsData(); $data['views']['test_example'] = array('title' => 'Test Example area', 'help' => 'A area handler which just exists for tests.', 'area' => array('id' => 'test_example')); return $data; }
function setUp() { parent::setUp(); // Create Article content type. $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); }
/** * Overrides \Drupal\views\Tests\ViewTestBase::viewsData(). */ protected function viewsData() { $data = parent::viewsData(); $data['views_test_data']['job']['field']['id'] = 'test_field'; return $data; }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $admin_user = $this->drupalCreateUser(['access content overview', 'administer nodes', 'bypass node access']); $this->drupalLogin($admin_user); }