/**
  * Overrides \Drupal\views\Tests\ViewTestBase::dataSet().
  */
 public function dataSet()
 {
     $data = parent::dataSet();
     $data[0]['age'] = 0;
     $data[3]['age'] = 0;
     return $data;
 }
 protected function setUp()
 {
     parent::setUp();
     $permissions = array('administer views', 'translate configuration');
     // Create and log in user.
     $this->drupalLogin($this->drupalCreateUser($permissions));
 }
Example #3
0
 protected function setUp()
 {
     parent::setUp();
     $this->drupalCreateContentType(array('type' => 'article'));
     $this->drupalCreateContentType(array('type' => 'page'));
     // Create some random nodes.
     for ($i = 0; $i < 5; $i++) {
         $this->drupalCreateNode();
     }
 }
Example #4
0
 /**
  * Overrides \Drupal\views\Tests\ViewTestBase::viewsData().
  *
  * Adds:
  * - a relationship for the uid column.
  * - a dummy field with no help text.
  */
 protected function viewsData()
 {
     $data = parent::viewsData();
     $data['views_test_data']['uid'] = array('title' => t('UID'), 'help' => t('The test data UID'), 'relationship' => array('id' => 'standard', 'base' => 'users_field_data', 'base field' => 'uid'));
     // Create a dummy field with no help text.
     $data['views_test_data']['no_help'] = $data['views_test_data']['name'];
     $data['views_test_data']['no_help']['field']['title'] = t('No help');
     $data['views_test_data']['no_help']['field']['real field'] = 'name';
     unset($data['views_test_data']['no_help']['help']);
     return $data;
 }
Example #5
0
 protected function setUp()
 {
     parent::setUp();
     $this->drupalCreateContentType(array('type' => 'article'));
     $this->drupalCreateContentType(array('type' => 'page'));
     // Create some random nodes.
     for ($i = 0; $i < 5; $i++) {
         $this->drupalCreateNode();
     }
     // Error strings used in the grouped filter form validation.
     $this->groupFormUiErrors['missing_value'] = t('A value is required if the label for this item is defined.');
     $this->groupFormUiErrors['missing_title'] = t('A label is required if the value for this item is defined.');
     $this->groupFormUiErrors['missing_title_empty_operator'] = t('A label is required for the specified operator.');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     Vocabulary::create(['vid' => 'tags', 'name' => 'Tags'])->save();
     // Setup a hierarchy which looks like this:
     // term 0.0
     // term 1.0
     // - term 1.1
     // term 2.0
     // - term 2.1
     // - term 2.2
     for ($i = 0; $i < 3; $i++) {
         for ($j = 0; $j <= $i; $j++) {
             $this->terms[$i][$j] = $term = Term::create(['vid' => 'tags', 'name' => "Term {$i}.{$j}", 'parent' => isset($terms[$i][0]) ? $terms[$i][0]->id() : 0]);
             $term->save();
         }
     }
     ViewTestData::createTestViews(get_class($this), array('taxonomy_test_views'));
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     ViewTestData::createTestViews(get_class($this), array('taxonomy_test_views'));
 }
Example #8
0
 /**
  * Overrides \Drupal\views\Tests\ViewTestBase::viewsData().
  */
 protected function viewsData()
 {
     $data = parent::viewsData();
     $data['views_test_data']['table']['base']['query_id'] = 'query_test';
     return $data;
 }
Example #9
0
 /**
  * Overrides \Drupal\views\Tests\ViewTestBase::viewsData().
  *
  * Adds a relationship for the uid column.
  */
 protected function viewsData()
 {
     $data = parent::viewsData();
     $data['views_test_data']['uid'] = array('title' => t('UID'), 'help' => t('The test data UID'), 'relationship' => array('id' => 'standard', 'base' => 'users', 'base field' => 'uid'));
     return $data;
 }
Example #10
0
 protected function setUp()
 {
     parent::setUp();
     $this->drupalPlaceBlock('page_title_block');
 }
Example #11
0
 protected function setUp()
 {
     parent::setUp();
     ViewTestData::createTestViews(get_class($this), ['views_field_view_test_config']);
 }
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     ViewTestData::createTestViews(get_class($this), array('ctools_views_test_views'));
     $this->storage = $this->container->get('entity.manager')->getStorage('block');
 }