Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/store/web/modules/contrib/commerce/tests/src/Kernel/

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/html/store/web/modules/contrib/commerce/tests/src/Kernel/RemoteIdItemTest.php

<?php

namespace Drupal\Tests\commerce\Kernel;

use Drupal\entity_test\Entity\EntityTest;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;

/**
 * Tests the 'commerce_remote_id' field type.
 *
 * @group commerce
 */
class RemoteIdItemTest extends CommerceKernelTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'commerce_test',
  ];

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

    $field_storage = FieldStorageConfig::create([
      'field_name' => 'test_remote_id',
      'entity_type' => 'entity_test',
      'type' => 'commerce_remote_id',
    ]);
    $field_storage->save();

    $field = FieldConfig::create([
      'field_name' => 'test_remote_id',
      'entity_type' => 'entity_test',
      'bundle' => 'entity_test',
    ]);
    $field->save();
  }

  /**
   * Tests the field.
   */
  public function testField() {
    $entity = EntityTest::create([
      'test_remote_id' => [
        'provider' => 'braintree',
        'remote_id' => '123',
      ],
    ]);
    $entity->save();
    $entity = $this->reloadEntity($entity);

    $this->assertEquals('123', $entity->test_remote_id->getByProvider('braintree'));
    $this->assertNull($entity->test_remote_id->getByProvider('stripe'));

    $entity->test_remote_id->setByProvider('braintree', '456');
    $entity->test_remote_id->setByProvider('stripe', '789');
    $entity->save();
    $entity = $this->reloadEntity($entity);

    $this->assertEquals('456', $entity->test_remote_id->getByProvider('braintree'));
    $this->assertNull($entity->test_remote_id->getByProvider('stripe'));
  }

}

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