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


PHP ViewUnitTestBase::setUpFixtures方法代码示例

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


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

示例1: setUpFixtures

 /**
  * {@inheritdoc}
  */
 protected function setUpFixtures()
 {
     $this->installEntitySchema('user');
     $this->installEntitySchema('entity_test');
     $this->installConfig(['entity_test']);
     Block::create(['id' => 'test_block', 'plugin' => 'system_main_block'])->save();
     parent::setUpFixtures();
 }
开发者ID:nsp15,项目名称:Drupal8,代码行数:11,代码来源:AreaEntityTest.php

示例2: setUpFixtures

 protected function setUpFixtures()
 {
     $this->installEntitySchema('user');
     $this->installEntitySchema('node');
     $this->installEntitySchema('comment');
     $this->installSchema('comment', array('comment_entity_statistics'));
     $this->installConfig(array('field'));
     entity_create('node_type', array('type' => 'page', 'name' => 'Page'))->save();
     $this->container->get('comment.manager')->addDefaultField('node', 'page');
     parent::setUpFixtures();
     $this->installConfig(array('filter'));
 }
开发者ID:anyforsoft,项目名称:csua_d8,代码行数:12,代码来源:ViewExecutableTest.php

示例3: setUpFixtures

 /**
  * {@inheritdoc}
  */
 protected function setUpFixtures()
 {
     parent::setUpFixtures();
     $this->installEntitySchema('user');
     $this->installEntitySchema('entity_test');
     // Create some test entities.
     for ($i = 0; $i < 5; $i++) {
         EntityTest::create(['name' => $this->randomString()])->save();
     }
     // Create and admin user.
     $this->adminUser = $this->createUser([], FALSE, TRUE);
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:15,代码来源:FieldEntityLinkTest.php

示例4: setUpFixtures

 /**
  * {@inheritdoc}
  */
 protected function setUpFixtures()
 {
     parent::setUpFixtures();
     $this->installEntitySchema('user');
     $this->installEntitySchema('node');
     $this->installSchema('node', 'node_access');
     $type = NodeType::create(['type' => 'test']);
     $type->save();
     $this->editorUser = $this->createUser(['bypass node access']);
     $this->powerUser = $this->createUser(['access content', 'create test content', 'edit own test content', 'delete own test content']);
     $this->regularUser = $this->createUser(['access content']);
     // Create some test entities.
     for ($i = 0; $i < 5; $i++) {
         Node::create(['title' => 'b' . $i . $this->randomMachineName(), 'type' => 'test'])->save();
     }
     // Create a power user node.
     Node::create(['title' => 'z' . $this->randomMachineName(), 'uid' => $this->powerUser->id(), 'type' => 'test'])->save();
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:21,代码来源:RowRenderCacheTest.php


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