当前位置: 首页>>代码示例>>PHP>>正文


PHP TaxonomyTestBase::setUp方法代码示例

本文整理汇总了PHP中Drupal\taxonomy\Tests\TaxonomyTestBase::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP TaxonomyTestBase::setUp方法的具体用法?PHP TaxonomyTestBase::setUp怎么用?PHP TaxonomyTestBase::setUp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\taxonomy\Tests\TaxonomyTestBase的用法示例。


在下文中一共展示了TaxonomyTestBase::setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 function setUp()
 {
     parent::setUp();
     $this->admin_user = $this->drupalCreateUser(array('administer taxonomy'));
     $this->drupalLogin($this->admin_user);
     $this->vocabulary = $this->createVocabulary();
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:7,代码来源:EfqTest.php

示例2: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->drupalCreateUser(['administer taxonomy']));
     $this->vocabulary = $this->createVocabulary();
     $this->drupalPlaceBlock('local_actions_block');
 }
开发者ID:ravindrasingh22,项目名称:Drupal-8-rc,代码行数:7,代码来源:VocabularyUiTest.php

示例3: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->vocabulary = $this->createVocabulary();
     // RDF mapping - term bundle.
     rdf_get_mapping('taxonomy_term', $this->vocabulary->id())->setBundleMapping(array('types' => array('skos:Concept')))->setFieldMapping('name', array('properties' => array('rdfs:label', 'skos:prefLabel')))->save();
 }
开发者ID:Nikola-xiii,项目名称:d8intranet,代码行数:7,代码来源:TaxonomyAttributesTest.php

示例4: setUp

 protected function setUp()
 {
     parent::setUp();
     $admin_user = $this->drupalCreateUser(array('create article content', 'administer taxonomy'));
     $this->drupalLogin($admin_user);
     $this->vocabulary = $this->createVocabulary();
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:7,代码来源:VocabularyCrudTest.php

示例5: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->setupLanguages();
     $this->vocabulary = $this->createVocabulary();
     $this->enableTranslation();
     $this->setUpTerms();
     $this->setUpTermReferenceField();
 }
开发者ID:Wylbur,项目名称:gj,代码行数:12,代码来源:TermTranslationTest.php

示例6: setUp

 protected function setUp()
 {
     parent::setUp();
     // Create an administrative user.
     $this->drupalLogin($this->drupalCreateUser(['administer taxonomy']));
     // Add some custom languages.
     ConfigurableLanguage::create(array('id' => 'aa', 'label' => $this->randomMachineName()))->save();
     ConfigurableLanguage::create(array('id' => 'bb', 'label' => $this->randomMachineName()))->save();
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:9,代码来源:VocabularyLanguageTest.php

示例7: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Create filter format.
     $restricted_html_format = entity_create('filter_format', array('format' => 'restricted_html', 'name' => 'Restricted HTML', 'filters' => array('filter_html' => array('status' => TRUE, 'weight' => -10, 'settings' => array('allowed_html' => '<p> <br /> <strong> <a> <em> <h4>')), 'filter_autop' => array('status' => TRUE, 'weight' => 0), 'filter_url' => array('status' => TRUE, 'weight' => 0), 'filter_htmlcorrector' => array('status' => TRUE, 'weight' => 10))));
     $restricted_html_format->save();
     // Create user then login.
     $this->user = $this->drupalCreateUser(array('administer site configuration', 'access site map', 'administer menu', 'administer nodes', 'create article content', 'administer taxonomy', $restricted_html_format->getPermissionName()));
     $this->drupalLogin($this->user);
 }
开发者ID:jeroenos,项目名称:jeroenos_d8.mypressonline.com,代码行数:13,代码来源:SiteMapTestBase.php

示例8: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access', 'administer content types', 'administer node display']));
     $this->vocabulary = $this->createVocabulary();
     $this->fieldName = 'taxonomy_' . $this->vocabulary->id();
     $handler_settings = array('target_bundles' => array($this->vocabulary->id() => $this->vocabulary->id()), 'auto_create' => TRUE);
     $this->createEntityReferenceField('node', 'article', $this->fieldName, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
     entity_get_form_display('node', 'article', 'default')->setComponent($this->fieldName, array('type' => 'options_select'))->save();
     entity_get_display('node', 'article', 'default')->setComponent($this->fieldName, array('type' => 'entity_reference_label'))->save();
 }
开发者ID:brstde,项目名称:gap1,代码行数:11,代码来源:RssTest.php

示例9: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access']));
     $this->vocabulary = $this->createVocabulary();
     $this->fieldName = 'taxonomy_' . $this->vocabulary->id();
     entity_create('field_storage_config', array('field_name' => $this->fieldName, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, 'settings' => array('allowed_values' => array(array('vocabulary' => $this->vocabulary->id(), 'parent' => 0)))))->save();
     entity_create('field_config', array('field_name' => $this->fieldName, 'bundle' => 'article', 'entity_type' => 'node'))->save();
     entity_get_form_display('node', 'article', 'default')->setComponent($this->fieldName, array('type' => 'options_select'))->save();
     entity_get_display('node', 'article', 'default')->setComponent($this->fieldName, array('type' => 'taxonomy_term_reference_link'))->save();
 }
开发者ID:Nikola-xiii,项目名称:d8intranet,代码行数:11,代码来源:TokenReplaceTest.php

示例10: setUp

 protected function setUp()
 {
     parent::setUp();
     // Create a tags vocabulary for the 'article' content type.
     $vocabulary = Vocabulary::create(['name' => 'Tags', 'vid' => 'tags']);
     $vocabulary->save();
     $field_name = 'field_' . $vocabulary->id();
     $handler_settings = array('target_bundles' => array($vocabulary->id() => $vocabulary->id()), 'auto_create' => TRUE);
     $this->createEntityReferenceField('node', 'article', $field_name, 'Tags', 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
     entity_get_form_display('node', 'article', 'default')->setComponent($field_name, array('type' => 'entity_reference_autocomplete_tags'))->save();
     $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'administer nodes', 'bypass node access']));
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:12,代码来源:LegacyTest.php

示例11: setUp

 protected function setUp()
 {
     parent::setUp();
     // Create an administrative user.
     $this->drupalLogin($this->drupalCreateUser(['administer taxonomy']));
     // Create a vocabulary to which the terms will be assigned.
     $this->vocabulary = $this->createVocabulary();
     // Add some custom languages.
     foreach (array('aa', 'bb', 'cc') as $language_code) {
         ConfigurableLanguage::create(array('id' => $language_code, 'label' => $this->randomMachineName()))->save();
     }
 }
开发者ID:318io,项目名称:318-io,代码行数:12,代码来源:TermLanguageTest.php

示例12: setUp

 function setUp()
 {
     parent::setUp();
     // Create an administrative user.
     $this->admin_user = $this->drupalCreateUser(array('administer taxonomy'));
     $this->drupalLogin($this->admin_user);
     // Add some custom languages.
     $language = new Language(array('id' => 'aa', 'name' => $this->randomMachineName()));
     language_save($language);
     $language = new Language(array('id' => 'bb', 'name' => $this->randomMachineName()));
     language_save($language);
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:12,代码来源:VocabularyLanguageTest.php

示例13: setUp

 protected function setUp()
 {
     parent::setUp();
     // Create a tags vocabulary for the 'article' content type.
     $vocabulary = entity_create('taxonomy_vocabulary', array('name' => 'Tags', 'vid' => 'tags'));
     $vocabulary->save();
     $field_name = 'field_' . $vocabulary->id();
     entity_create('field_storage_config', array('field_name' => $field_name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, 'settings' => array('allowed_values' => array(array('vocabulary' => $vocabulary->id(), 'parent' => 0)))))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => $field_name, 'bundle' => 'article', 'label' => 'Tags'))->save();
     entity_get_form_display('node', 'article', 'default')->setComponent($field_name, array('type' => 'taxonomy_autocomplete'))->save();
     $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'administer nodes', 'bypass node access']));
 }
开发者ID:Nikola-xiii,项目名称:d8intranet,代码行数:12,代码来源:LegacyTest.php

示例14: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->drupalCreateUser(['view test entity', 'administer entity_test content', 'administer taxonomy']));
     $this->vocabulary1 = $this->createVocabulary();
     $this->vocabulary2 = $this->createVocabulary();
     // Set up a field storage and a field.
     $this->fieldName = Unicode::strtolower($this->randomMachineName());
     entity_create('field_storage_config', array('field_name' => $this->fieldName, 'entity_type' => 'entity_test', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, 'settings' => array('allowed_values' => array(array('vocabulary' => $this->vocabulary1->id(), 'parent' => '0'), array('vocabulary' => $this->vocabulary2->id(), 'parent' => '0')))))->save();
     entity_create('field_config', array('field_name' => $this->fieldName, 'entity_type' => 'entity_test', 'bundle' => 'entity_test'))->save();
     entity_get_form_display('entity_test', 'entity_test', 'default')->setComponent($this->fieldName, array('type' => 'options_select'))->save();
     entity_get_display('entity_test', 'entity_test', 'full')->setComponent($this->fieldName, array('type' => 'taxonomy_term_reference_link'))->save();
 }
开发者ID:Nikola-xiii,项目名称:d8intranet,代码行数:13,代码来源:TermFieldMultipleVocabularyTest.php

示例15: setUp

 protected function setUp()
 {
     parent::setUp();
     $web_user = $this->drupalCreateUser(array('bypass node access', 'administer taxonomy'));
     $this->drupalLogin($web_user);
     $this->vocabulary = $this->createVocabulary();
     // Create the field.
     $this->fieldName = 'field_taxonomy_test';
     $this->createTaxonomyTermReferenceField($this->fieldName, $this->vocabulary);
     // Set the RDF mapping for the new field.
     rdf_get_mapping('node', 'article')->setFieldMapping($this->fieldName, array('properties' => array('dc:subject'), 'mapping_type' => 'rel'))->save();
     rdf_get_mapping('taxonomy_term', $this->vocabulary->id())->setBundleMapping(array('types' => array('skos:Concept')))->setFieldMapping('name', array('properties' => array('rdfs:label')))->save();
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:13,代码来源:TaxonomyTermFieldAttributesTest.php


注:本文中的Drupal\taxonomy\Tests\TaxonomyTestBase::setUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。