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


PHP KernelTests\KernelTestBase類代碼示例

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


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

示例1: setUp

 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->installSchema('system', ['sequence']);
     $this->installEntitySchema('user');
     $this->installEntitySchema('block_content');
 }
開發者ID:eigentor,項目名稱:tommiblog,代碼行數:10,代碼來源:BlockContentDeletionTest.php

示例2: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->container->get('module_handler')->loadInclude('user', 'install');
     $this->installEntitySchema('user');
     user_install();
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:10,代碼來源:UserInstallTest.php

示例3: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('ceb_test_content');
     $this->installEntitySchema('user');
     $this->installSchema('system', ['sequences']);
 }
開發者ID:heddn,項目名稱:content_entity_base,代碼行數:10,代碼來源:ContentEntityBaseStorageTest.php

示例4: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installSchema('system', 'key_value_expire');
     $this->installSchema('search_api', array('search_api_task'));
     $this->storage = $this->container->get('entity_type.manager')->getStorage('search_api_server');
 }
開發者ID:curveagency,項目名稱:intranet,代碼行數:10,代碼來源:ServerStorageTest.php

示例5: setUp

  /**
   * {@inheritdoc}
   */
  public function setUp() {
    parent::setUp();

    $this->state = $this->container->get('state');

    $this->installEntitySchema('user');
    $this->installSchema('search_api', array('search_api_item', 'search_api_task'));

    // Create a test server.
    $this->server = Server::create(array(
      'name' => $this->randomString(),
      'id' => $this->randomMachineName(),
      'status' => 1,
      'backend' => 'search_api_test_backend',
    ));
    $this->server->save();

    // Create a test index.
    $this->index = Index::create(array(
      'name' => $this->randomString(),
      'id' => $this->randomMachineName(),
      'status' => 1,
      'datasources' => array('entity:user'),
      'tracker' => 'default',
      'server' => $this->server->id(),
      'options' => array('index_directly' => FALSE),
    ));
    $this->index->save();

    $this->serverTaskManager = $this->container->get('search_api.server_task_manager');
  }
開發者ID:jkyto,項目名稱:agolf,代碼行數:34,代碼來源:ServerTaskUnitTest.php

示例6: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installSchema('system', 'sequences');
     $this->installEntitySchema('user');
     $this->typedDataResolver = \Drupal::service('ctools.typed_data.resolver');
 }
開發者ID:isramv,項目名稱:camp-gdl,代碼行數:10,代碼來源:TypedDataResolverTest.php

示例7: setUp

 /**
  * Set the default field storage backend for fields created during tests.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('user');
     // Set default storage backend.
     $this->installConfig(array('field'));
 }
開發者ID:eigentor,項目名稱:tommiblog,代碼行數:10,代碼來源:NodeImportCreateTest.php

示例8: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('node');
     $this->installEntitySchema('user');
     $this->installConfig(array('field', 'node', 'user'));
 }
開發者ID:ravibarnwal,項目名稱:laraitassociate.in,代碼行數:7,代碼來源:EntityDisplayTest.php

示例9: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->entityTypeId = 'config_test';
     $this->entityId = 'test_1';
     $this->container->get('entity_type.manager')->getStorage($this->entityTypeId)->create(array('id' => $this->entityId, 'label' => 'Original label'))->save();
 }
開發者ID:318io,項目名稱:318-io,代碼行數:10,代碼來源:ConfigEntityStaticCacheTest.php

示例10: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('node');
     $this->installEntitySchema('user');
     $this->installConfig('workbench_moderation');
 }
開發者ID:tedbow,項目名稱:scheduled-updates-demo,代碼行數:10,代碼來源:EntityStateChangeValidationTest.php

示例11: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->container->get('router.builder')->rebuild();
     $this->assetResolver = $this->container->get('asset.resolver');
     $this->renderer = $this->container->get('renderer');
 }
開發者ID:eigentor,項目名稱:tommiblog,代碼行數:10,代碼來源:AttachedAssetsTest.php

示例12: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->actionManager = $this->container->get('plugin.manager.action');
     $this->installEntitySchema('user');
     $this->installSchema('system', array('sequences'));
 }
開發者ID:eigentor,項目名稱:tommiblog,代碼行數:10,代碼來源:ActionTest.php

示例13: setUp

 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     // Enable translation for the entity_test module.
     \Drupal::state()->set('entity_test.translation', TRUE);
     $this->installSchema('search_api', array('search_api_item', 'search_api_task'));
     $this->installEntitySchema('entity_test_mul');
     // Create the default languages.
     $this->installConfig(array('language'));
     $this->langcodes = array();
     for ($i = 0; $i < 3; ++$i) {
         /** @var \Drupal\language\Entity\ConfigurableLanguage $language */
         $language = ConfigurableLanguage::create(array('id' => 'l' . $i, 'label' => 'language - ' . $i, 'weight' => $i));
         $this->langcodes[$i] = $language->getId();
         $language->save();
     }
     // Do not use a batch for tracking the initial items after creating an
     // index when running the tests via the GUI. Otherwise, it seems Drupal's
     // Batch API gets confused and the test fails.
     \Drupal::state()->set('search_api_use_tracking_batch', FALSE);
     // Create a test server.
     $this->server = Server::create(array('name' => 'Test Server', 'id' => 'test_server', 'status' => 1, 'backend' => 'search_api_test_backend'));
     $this->server->save();
     // Create a test index.
     $this->index = Index::create(array('name' => 'Test Index', 'id' => 'test_index', 'status' => 1, 'datasource_settings' => array('entity:' . $this->testEntityTypeId => array('plugin_id' => 'entity:' . $this->testEntityTypeId, 'settings' => array())), 'tracker_settings' => array('default' => array('plugin_id' => 'default', 'settings' => array())), 'server' => $this->server->id(), 'options' => array('index_directly' => FALSE)));
     $this->index->save();
 }
開發者ID:curveagency,項目名稱:intranet,代碼行數:30,代碼來源:LanguageKernelTest.php

示例14: register

 /**
  * {@inheritdoc}
  */
 public function register(ContainerBuilder $container)
 {
     parent::register($container);
     $parameters = $container->getParameter('twig.config');
     $parameters['debug'] = TRUE;
     $container->setParameter('twig.config', $parameters);
 }
開發者ID:penguinclub,項目名稱:penguinweb_drupal8,代碼行數:10,代碼來源:DevelTwigExtensionTest.php

示例15: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Install all core themes.
     sort($this->allThemes);
     $this->container->get('theme_installer')->install($this->allThemes);
     // Enable all core modules.
     $all_modules = system_rebuild_module_data();
     $all_modules = array_filter($all_modules, function ($module) {
         // Filter contrib, hidden, already enabled modules and modules in the
         // Testing package.
         if ($module->origin !== 'core' || !empty($module->info['hidden']) || $module->status == TRUE || $module->info['package'] == 'Testing') {
             return FALSE;
         }
         return TRUE;
     });
     $this->allModules = array_keys($all_modules);
     $this->allModules[] = 'system';
     sort($this->allModules);
     $this->container->get('module_installer')->install($this->allModules);
     $this->themeHandler = $this->container->get('theme_handler');
     $this->themeInitialization = $this->container->get('theme.initialization');
     $this->themeManager = $this->container->get('theme.manager');
     $this->libraryDiscovery = $this->container->get('library.discovery');
 }
開發者ID:eigentor,項目名稱:tommiblog,代碼行數:28,代碼來源:ResolvedLibraryDefinitionsFilesMatchTest.php


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