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


PHP ViewsKernelTestBase::setUpFixtures方法代码示例

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


在下文中一共展示了ViewsKernelTestBase::setUpFixtures方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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:aWEBoLabs,项目名称:taxi,代码行数: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('system', 'field', 'node', 'comment'));
     NodeType::create(['type' => 'page', 'name' => 'Page'])->save();
     $this->addDefaultCommentField('node', 'page');
     parent::setUpFixtures();
     $this->installConfig(array('filter'));
 }
开发者ID:sojo,项目名称:d8_friendsofsilence,代码行数:12,代码来源:ViewExecutableTest.php

示例3: setUpFixtures

 /**
  * {@inheritdoc}
  */
 protected function setUpFixtures()
 {
     parent::setUpFixtures();
     $this->installEntitySchema('user');
     $this->installEntitySchema('entity_test');
     $this->installConfig(['user']);
     // Create some test entities.
     for ($i = 0; $i < 5; $i++) {
         EntityTest::create(['name' => $this->randomString()])->save();
     }
     // Create and admin user.
     $this->adminUser = $this->createUser(['view test entity'], FALSE, TRUE);
     Role::load(AccountInterface::ANONYMOUS_ROLE)->grantPermission('view test entity')->save();
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:17,代码来源: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:sojo,项目名称:d8_friendsofsilence,代码行数:21,代码来源:RowRenderCacheTest.php

示例5: setUpFixtures

 /**
  * {@inheritdoc}
  */
 protected function setUpFixtures()
 {
     $this->installEntitySchema('user');
     $this->installEntitySchema('entity_test');
     $this->installConfig(['entity_test']);
     EntityViewMode::create(['id' => 'entity_test.foobar', 'targetEntityType' => 'entity_test', 'status' => TRUE, 'enabled' => TRUE, 'label' => 'My view mode'])->save();
     $display = EntityViewDisplay::create(['targetEntityType' => 'entity_test', 'bundle' => 'entity_test', 'mode' => 'foobar', 'label' => 'My view mode', 'status' => TRUE]);
     $display->save();
     $field_storage = FieldStorageConfig::create(['field_name' => 'test_field', 'entity_type' => 'entity_test', 'type' => 'string']);
     $field_storage->save();
     $field_config = FieldConfig::create(['field_name' => 'test_field', 'entity_type' => 'entity_test', 'bundle' => 'entity_test']);
     $field_config->save();
     // Create some test entities.
     for ($i = 1; $i <= 3; $i++) {
         EntityTest::create(['name' => "Article title {$i}", 'test_field' => "Test {$i}"])->save();
     }
     $this->user = User::create(['name' => 'test user']);
     $this->user->save();
     parent::setUpFixtures();
 }
开发者ID:sojo,项目名称:d8_friendsofsilence,代码行数:23,代码来源:FieldRenderedEntityTest.php

示例6: setUpFixtures

 /**
  * {@inheritdoc}
  */
 protected function setUpFixtures()
 {
     Block::create(['id' => 'bartik_branding', 'theme' => 'bartik', 'plugin' => 'system_branding_block', 'weight' => 1])->save();
     Block::create(['id' => 'bartik_powered', 'theme' => 'bartik', 'plugin' => 'system_powered_by_block', 'weight' => 2])->save();
     parent::setUpFixtures();
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:9,代码来源:AreaOrderTest.php


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