Пример #1
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->enableViewsTestModule();
     $admin_user = $this->drupalCreateUser(array('administer news feeds'));
     $this->drupalLogin($admin_user);
 }
Пример #2
0
 protected function setUp()
 {
     parent::setUp();
     $this->enableViewsTestModule();
     $this->drupalPlaceBlock('page_title_block');
     $admin_user = $this->drupalCreateUser(array('administer site configuration'));
     $this->drupalLogin($admin_user);
 }
Пример #3
0
 protected function setUp()
 {
     parent::setUp();
     // Create a bunch of test nodes.
     for ($i = 0; $i < 20; $i++) {
         $this->nodes[] = $this->drupalCreateNode();
     }
 }
Пример #4
0
 protected function setUp()
 {
     parent::setUp();
     $this->drupalCreateContentType(array('type' => 'page'));
     // Create a bunch of test nodes.
     for ($i = 0; $i < 20; $i++) {
         $this->nodes[] = $this->drupalCreateNode();
     }
 }
Пример #5
0
 protected function setUp()
 {
     parent::setUp();
     $this->enableViewsTestModule();
     $this->adminUser = $this->drupalCreateUser(array('administer views'));
     $this->drupalLogin($this->adminUser);
     // Create 10 nodes.
     for ($i = 0; $i <= 10; $i++) {
         $this->drupalCreateNode(array('promote' => TRUE));
     }
 }
Пример #6
0
 protected function setUp()
 {
     parent::setUp();
     $this->enableViewsTestModule();
     ViewTestData::createTestViews(get_class($this), array('views_test_data'));
     $this->webUser = $this->drupalCreateUser();
     $normal_role = $this->drupalCreateRole(array());
     $this->normalUser = $this->drupalCreateUser(array('views_test_data test permission'));
     $this->normalUser->addRole($normal_role);
     // @todo when all the plugin information is cached make a reset function and
     // call it here.
 }
 protected function setUp()
 {
     parent::setUp();
     $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
     $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
     $this->nodeStorage = $this->container->get('entity.manager')->getStorage('node');
     $this->nodeViewBuilder = $this->container->get('entity.manager')->getViewBuilder('node');
     $this->userViewBuilder = $this->container->get('entity.manager')->getViewBuilder('user');
     for ($i = 1; $i <= 5; $i++) {
         $this->pages[] = $this->drupalCreateNode(array('title' => "Test {$i}", 'type' => 'page'));
     }
     $this->article = $this->drupalCreateNode(array('title' => "Test article", 'type' => 'article'));
     $this->user = $this->drupalCreateUser();
 }
Пример #8
0
 protected function setUp()
 {
     parent::setUp();
     $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
     $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
     $this->nodeStorage = $this->container->get('entity.manager')->getStorage('node');
     $this->nodeViewBuilder = $this->container->get('entity.manager')->getViewBuilder('node');
     $this->userViewBuilder = $this->container->get('entity.manager')->getViewBuilder('user');
     for ($i = 1; $i <= 5; $i++) {
         $this->pages[] = $this->drupalCreateNode(array('title' => "Test {$i}", 'type' => 'page'));
     }
     $this->article = $this->drupalCreateNode(array('title' => "Test article", 'type' => 'article'));
     $this->user = $this->drupalCreateUser();
     // Mark the current request safe, in order to make render cache working, see
     // \Drupal\Core\Render\RenderCache::get.
     \Drupal::request()->setMethod('GET');
 }
Пример #9
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->drupalCreateUser(array('administer views')));
     // Create the text field.
     $this->fieldName = 'field_test_entity_ref_display';
     $this->fieldStorage = FieldStorageConfig::create(['field_name' => $this->fieldName, 'entity_type' => 'entity_test', 'type' => 'text']);
     $this->fieldStorage->save();
     // Create an instance of the text field on the content type.
     $this->field = FieldConfig::create(['field_storage' => $this->fieldStorage, 'bundle' => 'entity_test']);
     $this->field->save();
     // Create some entities to search. Add a common string to the name and
     // the text field in two entities so we can test that we can search in both.
     for ($i = 0; $i < 5; $i++) {
         EntityTest::create(['bundle' => 'entity_test', 'name' => 'name' . $i, $this->fieldName => 'text'])->save();
         EntityTest::create(['bundle' => 'entity_test', 'name' => 'name', $this->fieldName => 'text' . $i])->save();
     }
 }
Пример #10
0
 protected function setUp()
 {
     parent::setUp();
     $this->enableViewsTestModule();
 }
Пример #11
0
 /**
  * Overrides Drupal\views\Tests\ViewTestBase::viewsData().
  */
 protected function viewsData()
 {
     $data = parent::viewsData();
     $data['views_test_data']['name']['filter']['id'] = 'test_filter';
     return $data;
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->enableViewsTestModule();
     $this->drupalPlaceBlock('local_tasks_block');
 }