本文整理汇总了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();
}
示例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'));
}
示例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);
}
示例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();
}