You are here

trait SettingsDataTrait in Acquia Lift Connector 8

Same name in this branch
  1. 8 src/Tests/SettingsDataTrait.php \Drupal\acquia_lift\Tests\SettingsDataTrait
  2. 8 tests/src/Unit/Traits/SettingsDataTrait.php \Drupal\Tests\acquia_lift\Unit\Traits\SettingsDataTrait
Same name and namespace in other branches
  1. 8.4 tests/src/Unit/Traits/SettingsDataTrait.php \Drupal\Tests\acquia_lift\Unit\Traits\SettingsDataTrait
  2. 8.3 tests/src/Unit/Traits/SettingsDataTrait.php \Drupal\Tests\acquia_lift\Unit\Traits\SettingsDataTrait

Settings Data Trait.

Hierarchy

5 files declare their use of SettingsDataTrait
HelpMessageHelperTest.php in tests/src/Unit/Service/Helper/HelpMessageHelperTest.php
Contains \Drupal\Tests\acquia_lift\Service\Helper\HelpMessageHelperTest.
NodeTypeThumbnailFormHelperTest.php in tests/src/Unit/Service/Helper/NodeTypeThumbnailFormHelperTest.php
Contains \Drupal\Tests\acquia_lift\Service\Helper\NodeTypeThumbnailFormHelperTest.
PageContextTest.php in tests/src/Unit/Service/Context/PageContextTest.php
Contains \Drupal\Tests\acquia_lift\Service\Context\PageContextTest.
PathContextTest.php in tests/src/Unit/Service/Context/PathContextTest.php
Contains \Drupal\Tests\acquia_lift\Service\Context\PathContextTest.
SettingsHelperTest.php in tests/src/Unit/Service/Helper/SettingsHelperTest.php
Contains \Drupal\Tests\acquia_lift\Service\Helper\SettingsHelperTest.

File

tests/src/Unit/Traits/SettingsDataTrait.php, line 13
Contains \Drupal\Tests\acquia_lift\Unit\Traits\SettingsDataTrait.

Namespace

Drupal\Tests\acquia_lift\Unit\Traits
View source
trait SettingsDataTrait {

  /**
   * Get a valid credential settings array.
   *
   * @return array
   *   A valid credential settings array.
   */
  private function getValidCredentialSettings() {
    return [
      'account_name' => 'account_name_1',
      'customer_site' => 'customer_site_1',
      'api_url' => 'api_url_1',
      'access_key' => 'access_key_1',
      'secret_key' => 'secret_key_1',
      'js_path' => 'js_path_1',
    ];
  }

  /**
   * Get a valid identity settings array.
   *
   * @return array
   *   A valid identity settings array.
   */
  private function getValidIdentitySettings() {
    return [
      'capture_identity' => FALSE,
      'identity_parameter' => 'my_identity_parameter',
      'identity_type_parameter' => 'my_identity_type_parameter',
      'default_identity_type' => 'my_default_identity_type',
    ];
  }

  /**
   * Get a valid field mappings settings array.
   *
   * @return array
   *   A valid field mappings settings array.
   */
  private function getValidFieldMappingsSettings() {
    return [
      'content_section' => 'field_country',
      'content_keywords' => 'field_tags',
      'persona' => 'field_people',
    ];
  }

  /**
   * Get a valid thumbnail settings array.
   *
   * @return array
   *   A valid thumbnail settings array.
   */
  private function getValidThumbnailSettings() {
    return [
      'article' => [
        'field' => 'field_media->field_image',
        'style' => 'medium',
      ],
    ];
  }

  /**
   * Get a valid visibility settings array.
   *
   * @return array
   *   A valid visibility settings array.
   */
  private function getValidVisibilitySettings() {
    return [
      'path_patterns' => "/admin\n/admin/*\n/batch\n/node/add*\n/node/*/*\n/user/*/*",
    ];
  }

  /**
   * Get a valid front end credential settings.
   *
   * @return array
   *   A valid front end credential settings array.
   */
  private function getValidFrontEndCredentialSettings() {
    return [
      'account_name' => 'account_name_1',
      'customer_site' => 'customer_site_1',
      'js_path' => 'js_path_1',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SettingsDataTrait::getValidCredentialSettings private function Get a valid credential settings array.
SettingsDataTrait::getValidFieldMappingsSettings private function Get a valid field mappings settings array.
SettingsDataTrait::getValidFrontEndCredentialSettings private function Get a valid front end credential settings.
SettingsDataTrait::getValidIdentitySettings private function Get a valid identity settings array.
SettingsDataTrait::getValidThumbnailSettings private function Get a valid thumbnail settings array.
SettingsDataTrait::getValidVisibilitySettings private function Get a valid visibility settings array.