commerce_square-8.x-1.x-dev/tests/src/Kernel/UninstallTest.php

tests/src/Kernel/UninstallTest.php
<?php

namespace Drupal\Tests\commerce_square\Kernel;

use Drupal\KernelTests\KernelTestBase;

/**
 * Tests the uninstall of the module.
 *
 * @group commerce_square
 */
class UninstallTest extends KernelTestBase {

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

  /**
   * Tests OAuth data is removed from the state key value store.
   */
  public function testUninstallRemoveAuthData() {
    $this->container->get('state')->set('commerce_square.production_access_token', 'TEST-TOKEN');
    $this->container->get('state')->set('commerce_square.production_access_token_expiry', $this->container->get('datetime.time')->getRequestTime());

    $this->container->get('module_installer')->uninstall(['commerce_square']);

    $this->assertNull($this->container->get('state')->get('commerce_square.production_access_token'));
    $this->assertNull($this->container->get('state')->get('commerce_square.production_access_token_expiry'));
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc