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


PHP simpletest\WebTestBase類代碼示例

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


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

示例1: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->adminUser = $this->drupalCreateUser(array('access content', 'access administration pages', 'administer site configuration', 'administer users', 'administer permissions', 'administer content types', 'administer node fields', 'administer node display', 'administer nodes', 'bypass node access'));
     $this->drupalLogin($this->adminUser);
     $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
 }
開發者ID:papillon-cendre,項目名稱:d8,代碼行數:7,代碼來源:FileFieldTestBase.php

示例2: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     // Install Drupal.
     parent::setUp();
     // Add the system menu blocks to appropriate regions.
     $this->setupExamplesMenus();
 }
開發者ID:seongbae,項目名稱:drumo-distribution,代碼行數:10,代碼來源:ExamplesTestBase.php

示例3: setUp

 function setUp()
 {
     parent::setUp();
     $this->drupalCreateContentType(array('type' => 'article'));
     $this->article_creator = $this->drupalCreateUser(array('create article content', 'edit own article content'));
     $this->drupalLogin($this->article_creator);
 }
開發者ID:alnutile,項目名稱:drunatra,代碼行數:7,代碼來源:reEnableModuleFieldTest.php

示例4: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Create and login user.
     $this->webUser = $this->drupalCreateUser(array('administer entity_test content'));
     $this->drupalLogin($this->webUser);
 }
開發者ID:ddrozdik,項目名稱:dmaps,代碼行數:10,代碼來源:EntityListBuilderTest.php

示例5: setUp

 function setUp()
 {
     parent::setUp();
     $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
     // Create and login user.
     $admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer languages', 'access administration pages', 'administer content types', 'administer comments', 'create article content', 'access comments', 'post comments', 'skip comment approval'));
     $this->drupalLogin($admin_user);
     // Add language.
     $edit = array('predefined_langcode' => 'fr');
     $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
     // Set "Article" content type to use multilingual support.
     $edit = array('language_configuration[language_show]' => TRUE);
     $this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type'));
     // Enable content language negotiation UI.
     \Drupal::state()->set('language_test.content_language_type', TRUE);
     // Set interface language detection to user and content language detection
     // to URL. Disable inheritance from interface language to ensure content
     // language will fall back to the default language if no URL language can be
     // detected.
     $edit = array('language_interface[enabled][language-user]' => TRUE, 'language_content[enabled][language-url]' => TRUE, 'language_content[enabled][language-interface]' => FALSE);
     $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
     // Change user language preference, this way interface language is always
     // French no matter what path prefix the URLs have.
     $edit = array('preferred_langcode' => 'fr');
     $this->drupalPostForm("user/" . $admin_user->id() . "/edit", $edit, t('Save'));
     // Create comment field on article.
     $this->container->get('comment.manager')->addDefaultField('node', 'article');
     // Make comment body translatable.
     $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body');
     $field_storage->translatable = TRUE;
     $field_storage->save();
     $this->assertTrue($field_storage->isTranslatable(), 'Comment body is translatable.');
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:33,代碼來源:CommentLanguageTest.php

示例6: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalPlaceBlock('local_tasks_block');
     $this->drupalPlaceBlock('local_actions_block');
     $this->drupalPlaceBlock('page_title_block');
 }
開發者ID:eric-shell,項目名稱:eric-shell-d8,代碼行數:10,代碼來源:ParagraphsDemoTest.php

示例7: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Create and log in an administrative user.
     $this->adminUser = $this->drupalCreateUser(['access toolbar', 'access administration pages']);
     $this->drupalLogin($this->adminUser);
 }
開發者ID:eric-shell,項目名稱:eric-shell-d8,代碼行數:10,代碼來源:AdminToolbarToolsAlterTest.php

示例8: setUp

 protected function setUp()
 {
     parent::setUp();
     // Create admin user and log in admin user.
     $this->drupalLogin($this->drupalCreateUser(array('administer site configuration', 'administer content types', 'administer nodes', 'administer node fields', 'administer node form display', 'administer node display')));
     $this->drupalPlaceBlock('local_actions_block');
 }
開發者ID:318io,項目名稱:318-io,代碼行數:7,代碼來源:DateTimeTest.php

示例9: setUp

 function setUp()
 {
     parent::setUp();
     // Create an administrative user and log it in.
     $this->admin_user = $this->drupalCreateUser(array('access toolbar'));
     $this->drupalLogin($this->admin_user);
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:7,代碼來源:ToolbarHookToolbarTest.php

示例10: setUp

  function setUp() {
    parent::setUp();

    $this->type = entity_create('profile_type', [
      'id' => 'personal',
      'label' => 'Personal data',
      'weight' => 0,
      'registration' => TRUE,
    ]);
    $this->type->save();

    $this->checkPermissions([], TRUE);
    $this->admin_user = $this->drupalCreateUser([
      'access user profiles',
      'administer profile types',
      'administer profile fields',
      'administer profile display',
      'bypass profile access',
    ]);
    $user_permissions = [
      'access user profiles',
      'add own personal profile',
      'edit own personal profile',
      'view any personal profile',
    ];
    $this->web_user = $this->drupalCreateUser($user_permissions);
    $this->other_user = $this->drupalCreateUser($user_permissions);
  }
開發者ID:housineali,項目名稱:drpl8_dv,代碼行數:28,代碼來源:ProfileFieldAccessTest.php

示例11: setUp

 function setUp()
 {
     parent::setUp();
     // Create users with specific permissions.
     $this->big_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages', 'access site reports', 'administer users'));
     $this->any_user = $this->drupalCreateUser(array());
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:7,代碼來源:DbLogTest.php

示例12: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Create a test entity.
     $random_label = $this->randomMachineName();
     $data = array('type' => 'entity_test', 'name' => $random_label);
     $this->entity = entity_create('entity_test', $data);
     $this->entity->save();
     // Create a test entity with only canonical route.
     $random_label = $this->randomMachineName();
     $data = array('type' => 'devel_entity_test_canonical', 'name' => $random_label);
     $this->entity_canonical = entity_create('devel_entity_test_canonical', $data);
     $this->entity_canonical->save();
     // Create a test entity with only edit route.
     $random_label = $this->randomMachineName();
     $data = array('type' => 'devel_entity_test_edit', 'name' => $random_label);
     $this->entity_edit = entity_create('devel_entity_test_edit', $data);
     $this->entity_edit->save();
     // Create a test entity with no routes.
     $random_label = $this->randomMachineName();
     $data = array('type' => 'devel_entity_test_no_links', 'name' => $random_label);
     $this->entity_no_links = entity_create('devel_entity_test_no_links', $data);
     $this->entity_no_links->save();
     $this->drupalPlaceBlock('local_tasks_block');
     $web_user = $this->drupalCreateUser(array('view test entity', 'administer entity_test content', 'access devel information'));
     $this->drupalLogin($web_user);
 }
開發者ID:atif-shaikh,項目名稱:DCX-Profile,代碼行數:30,代碼來源:DevelControllerTest.php

示例13: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $permissions = ['access administration pages', 'administer piwik'];
     // User to set up piwik.
     $this->admin_user = $this->drupalCreateUser($permissions);
 }
開發者ID:rsmccc,項目名稱:drupal-bootstrap,代碼行數:10,代碼來源:PiwikStatusMessagesTest.php

示例14: setUp

 protected function setUp()
 {
     parent::setUp();
     // Create an administrative user and log it in.
     $this->adminUser = $this->drupalCreateUser(array('access toolbar', 'translate interface', 'administer languages', 'access administration pages'));
     $this->drupalLogin($this->adminUser);
 }
開發者ID:nstielau,項目名稱:drops-8,代碼行數:7,代碼來源:ToolbarMenuTranslationTest.php

示例15: setUp

 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     /** @var \Drupal\currency\ConfigImporterInterface $config_importer */
     $config_importer = \Drupal::service('currency.config_importer');
     $config_importer->importCurrency('EUR');
 }
開發者ID:nishantkumar155,項目名稱:drupal8.crackle,代碼行數:10,代碼來源:PaymentReferenceWebTest.php


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