UninstallTest.php in Commerce Square Connect 8
File
tests/src/Kernel/UninstallTest.php
View source
<?php
namespace Drupal\Tests\commerce_square\Kernel;
use Drupal\KernelTests\KernelTestBase;
class UninstallTest extends KernelTestBase {
public static $modules = [
'system',
'commerce_square',
'commerce_number_pattern',
];
public function testUninstallRemoveAuthData() {
$this->container
->get('state')
->set('commerce_square.production_access_token', 'TESTTOKEN');
$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'));
}
}