本文整理匯總了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');
}