当前位置: 首页>>代码示例>>PHP>>正文


PHP ViewsKernelTestBase::setUp方法代码示例

本文整理汇总了PHP中Drupal\Tests\views\Kernel\ViewsKernelTestBase::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP ViewsKernelTestBase::setUp方法的具体用法?PHP ViewsKernelTestBase::setUp怎么用?PHP ViewsKernelTestBase::setUp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Tests\views\Kernel\ViewsKernelTestBase的用法示例。


在下文中一共展示了ViewsKernelTestBase::setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp();
     $this->installEntitySchema('taxonomy_term');
     $this->installConfig(array('taxonomy'));
     \Drupal::service('router.builder')->rebuild();
 }
开发者ID:sojo,项目名称:d8_friendsofsilence,代码行数:10,代码来源:RowEntityTest.php

示例2: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp($import_test_views);
     $this->installEntitySchema('node');
     $this->installEntitySchema('user');
     $this->installSchema('node', 'node_access');
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:10,代码来源:SqlEntityLoadingTest.php

示例3: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp($import_test_views);
     $this->entityManger = $this->container->get('entity.manager');
     $this->menuLinkManager = $this->container->get('plugin.manager.menu.link');
     $this->menuLinkOverrides = $this->container->get('menu_link.static.overrides');
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:10,代码来源:ViewsMenuLinkTest.php

示例4: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp($import_test_views);
     $this->installEntitySchema('user');
     $this->installEntitySchema('comment');
     // Create the anonymous role.
     $this->installConfig(['user']);
     // Create an anonymous user.
     $storage = \Drupal::entityManager()->getStorage('user');
     // Insert a row for the anonymous user.
     $storage->create(array('uid' => 0, 'name' => '', 'status' => 0))->save();
     $admin_role = Role::create(['id' => 'admin', 'permissions' => ['administer comments', 'access user profiles']]);
     $admin_role->save();
     /* @var \Drupal\user\RoleInterface $anonymous_role */
     $anonymous_role = Role::load(Role::ANONYMOUS_ID);
     $anonymous_role->grantPermission('access comments');
     $anonymous_role->save();
     $this->adminUser = User::create(['name' => $this->randomMachineName(), 'roles' => [$admin_role->id()]]);
     $this->adminUser->save();
     // Create some comments.
     $comment = Comment::create(['subject' => 'My comment title', 'uid' => $this->adminUser->id(), 'name' => $this->adminUser->label(), 'entity_type' => 'entity_test', 'comment_type' => 'entity_test', 'status' => 1]);
     $comment->save();
     $comment_anonymous = Comment::create(['subject' => 'Anonymous comment title', 'uid' => 0, 'name' => 'barry', 'mail' => 'test@example.com', 'homepage' => 'https://example.com', 'entity_type' => 'entity_test', 'comment_type' => 'entity_test', 'created' => 123456, 'status' => 1]);
     $comment_anonymous->save();
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:28,代码来源:CommentUserNameTest.php

示例5: setUp

 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp();
     $this->installConfig(array('language'));
     // Create another language beside English.
     ConfigurableLanguage::create(array('id' => 'xx-lolspeak', 'label' => 'Lolspeak'))->save();
 }
开发者ID:sojo,项目名称:d8_friendsofsilence,代码行数:7,代码来源:LanguageTestBase.php

示例6: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp();
     // Rebuild the router, otherwise we can't generate links.
     $this->container->get('router.builder')->rebuild();
     $this->installSchema('dblog', array('watchdog'));
     ViewTestData::createTestViews(get_class($this), array('dblog_test_views'));
 }
开发者ID:sojo,项目名称:d8_friendsofsilence,代码行数:11,代码来源:ViewsIntegrationTest.php

示例7: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp($import_test_views);
     $this->installEntitySchema('node');
     $this->installEntitySchema('user');
     $this->installConfig(['node', 'field']);
     ViewTestData::createTestViews(get_class($this), ['node_test_views']);
 }
开发者ID:sojo,项目名称:d8_friendsofsilence,代码行数:11,代码来源:NidArgumentTest.php

示例8: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp();
     $this->installEntitySchema('user');
     $this->installEntitySchema('entity_test');
     $this->installEntitySchema('entity_test_mul');
     $this->storage = $this->container->get('entity.manager')->getStorage('entity_test');
     ConfigurableLanguage::createFromLangcode('it')->save();
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:12,代码来源:QueryGroupByTest.php

示例9: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp($import_test_views);
     $this->installEntitySchema('node');
     $this->installEntitySchema('taxonomy_term');
     $this->installEntitySchema('user');
     // Setup the current time properly.
     \Drupal::request()->server->set('REQUEST_TIME', time());
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:12,代码来源:CacheTest.php

示例10: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp();
     $this->installEntitySchema('aggregator_item');
     $this->installEntitySchema('aggregator_feed');
     ViewTestData::createTestViews(get_class($this), array('aggregator_test_views'));
     $this->itemStorage = $this->container->get('entity.manager')->getStorage('aggregator_item');
     $this->feedStorage = $this->container->get('entity.manager')->getStorage('aggregator_feed');
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:12,代码来源:IntegrationTest.php

示例11: setUp

 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp();
     ViewTestData::createTestViews(get_class($this), array('user_test_views'));
     $this->installEntitySchema('user');
     $entity_manager = $this->container->get('entity.manager');
     $this->roleStorage = $entity_manager->getStorage('user_role');
     $this->userStorage = $entity_manager->getStorage('user');
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:9,代码来源:UserKernelTestBase.php

示例12: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp($import_test_views);
     $this->installSchema('node', 'node_access');
     $this->installEntitySchema('node');
     $this->installEntitySchema('user');
     if ($import_test_views) {
         ViewTestData::createTestViews(get_class($this), ['node_test_views']);
     }
 }
开发者ID:sojo,项目名称:d8_friendsofsilence,代码行数:13,代码来源:RevisionCreateTimestampTest.php

示例13: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp();
     $this->installEntitySchema('user');
     $this->installEntitySchema('entity_test');
     $this->installEntitySchema('entity_test_mul');
     // Create reference from entity_test to entity_test_mul.
     $this->createEntityReferenceField('entity_test', 'entity_test', 'field_test_data', 'field_test_data', 'entity_test_mul');
     // Create reference from entity_test_mul to entity_test.
     $this->createEntityReferenceField('entity_test_mul', 'entity_test_mul', 'field_data_test', 'field_data_test', 'entity_test');
     ViewTestData::createTestViews(get_class($this), array('entity_reference_test_views'));
 }
开发者ID:318io,项目名称:318-io,代码行数:15,代码来源:EntityReferenceRelationshipTest.php

示例14: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp($import_test_views);
     $this->installEntitySchema('node');
     $this->installEntitySchema('user');
     $this->installEntitySchema('content_moderation_state');
     $this->installSchema('node', 'node_access');
     $this->installConfig('content_moderation_test_views');
     $this->installConfig('content_moderation');
     $node_type = NodeType::create(['type' => 'page']);
     $node_type->setThirdPartySetting('content_moderation', 'enabled', TRUE);
     $node_type->save();
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:16,代码来源:ViewsDataIntegrationTest.php

示例15: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp($import_test_views);
     $this->installEntitySchema('user');
     $role_with_access = Role::create(['id' => 'with_access', 'permissions' => ['view test entity field']]);
     $role_with_access->save();
     $role_without_access = Role::create(['id' => 'without_access', 'permissions' => []]);
     $role_without_access->save();
     $this->userWithAccess = User::create(['name' => $this->randomMachineName(), 'roles' => [$role_with_access->id()]]);
     $this->userWithAccess->save();
     $this->userWithoutAccess = User::create(['name' => $this->randomMachineName(), 'roles' => [$role_without_access->id()]]);
     $this->userWithoutAccess->save();
 }
开发者ID:sojo,项目名称:d8_friendsofsilence,代码行数:16,代码来源:FieldFieldAccessTestBase.php


注:本文中的Drupal\Tests\views\Kernel\ViewsKernelTestBase::setUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。