當前位置: 首頁>>代碼示例>>PHP>>正文


PHP KernelTestBase::setup方法代碼示例

本文整理匯總了PHP中Drupal\simpletest\KernelTestBase::setup方法的典型用法代碼示例。如果您正苦於以下問題:PHP KernelTestBase::setup方法的具體用法?PHP KernelTestBase::setup怎麽用?PHP KernelTestBase::setup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\simpletest\KernelTestBase的用法示例。


在下文中一共展示了KernelTestBase::setup方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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 = entity_create('user', array('name' => $this->randomMachineName()));
    $this->currentUser->save();
  }
開發者ID:AshishNaik021,項目名稱:iimisac-d8,代碼行數:26,代碼來源:PathautoUnitTest.php

示例2: setUp

 public function setUp()
 {
     parent::setup();
     $this->installConfig(array('pathauto', 'taxonomy', 'system'));
     $this->installEntitySchema('user');
     $this->installEntitySchema('node');
     $this->installEntitySchema('taxonomy_term');
     $this->installSchema('node', array('node_access'));
     $this->installSchema('system', array('url_alias', 'sequences', 'router'));
     \Drupal::service('router.builder')->rebuild();
     $this->currentUser = entity_create('user', array('name' => $this->randomMachineName()));
     $this->currentUser->save();
 }
開發者ID:dev981,項目名稱:gaptest,代碼行數:13,代碼來源:PathautoUnitTest.php

示例3: 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');
 }
開發者ID:ddrozdik,項目名稱:dmaps,代碼行數:17,代碼來源:EntityReferenceSettingsTest.php

示例4: setUp

 protected function setUp()
 {
     parent::setup();
     $this->installEntitySchema('file');
     $this->typedDataManager = $this->container->get('typed_data_manager');
 }
開發者ID:318io,項目名稱:318-io,代碼行數:6,代碼來源:TypedDataTest.php

示例5: setUp

 protected function setUp()
 {
     parent::setup();
     $this->typedDataManager = $this->container->get('typed_data_manager');
 }
開發者ID:neetumorwani,項目名稱:blogging,代碼行數:5,代碼來源:TypedDataDefinitionTest.php


注:本文中的Drupal\simpletest\KernelTestBase::setup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。