本文整理汇总了PHP中Drupal\KernelTests\KernelTestBase::setup方法的典型用法代码示例。如果您正苦于以下问题:PHP KernelTestBase::setup方法的具体用法?PHP KernelTestBase::setup怎么用?PHP KernelTestBase::setup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\KernelTests\KernelTestBase
的用法示例。
在下文中一共展示了KernelTestBase::setup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* {@inheritdoc}
*/
protected function setUp()
{
parent::setup();
$this->installEntitySchema('node');
$this->installEntitySchema('taxonomy_term');
$this->installEntitySchema('entity_test');
$this->nodeType = NodeType::create(['type' => Unicode::strtolower($this->randomMachineName()), 'name' => $this->randomString()]);
$this->nodeType->save();
$this->vocabulary = Vocabulary::create(['vid' => Unicode::strtolower($this->randomMachineName()), 'name' => $this->randomString()]);
$this->vocabulary->save();
// Create a custom bundle.
$this->customBundle = 'test_bundle_' . Unicode::strtolower($this->randomMachineName());
entity_test_create_bundle($this->customBundle, NULL, 'entity_test');
}
示例2: setUp
public function setUp()
{
parent::setup();
$this->installConfig(array('pathauto', 'taxonomy', 'system', 'node'));
$this->installEntitySchema('user');
$this->installEntitySchema('node');
$this->installEntitySchema('taxonomy_term');
ConfigurableLanguage::createFromLangcode('fr')->save();
$this->installSchema('node', array('node_access'));
$this->installSchema('system', array('url_alias', 'sequences', 'router'));
$type = NodeType::create(['type' => 'page']);
$type->save();
node_add_body_field($type);
$this->nodePattern = $this->createPattern('node', '/content/[node:title]');
$this->userPattern = $this->createPattern('user', '/users/[user:name]');
\Drupal::service('router.builder')->rebuild();
$this->currentUser = User::create(array('name' => $this->randomMachineName()));
$this->currentUser->save();
}
示例3: setUp
protected function setUp()
{
parent::setup();
$this->installEntitySchema('file');
$this->typedDataManager = $this->container->get('typed_data_manager');
}
示例4: setUp
protected function setUp()
{
parent::setup();
$this->typedDataManager = $this->container->get('typed_data_manager');
}