NumberPatternKernelTestBase.php in Commerce Core 8.2
File
modules/number_pattern/tests/src/Kernel/NumberPatternKernelTestBase.php
View source
<?php
namespace Drupal\Tests\commerce_number_pattern\Kernel;
use Drupal\Component\Datetime\TimeInterface;
use Drupal\Tests\commerce\Kernel\CommerceKernelTestBase;
abstract class NumberPatternKernelTestBase extends CommerceKernelTestBase {
protected $pluginManager;
public static $modules = [
'entity_reference_revisions',
'commerce_number_pattern_test',
'commerce_number_pattern',
'token',
];
protected function setUp() : void {
parent::setUp();
$this
->installConfig([
'system',
]);
$this
->installSchema('commerce_number_pattern', [
'commerce_number_pattern_sequence',
]);
$this
->installEntitySchema('entity_test_with_store');
$this->pluginManager = $this->container
->get('plugin.manager.commerce_number_pattern');
}
protected function rewindTime($new_time) {
$mock_time = $this
->prophesize(TimeInterface::class);
$mock_time
->getCurrentTime()
->willReturn($new_time);
$mock_time
->getRequestTime()
->willReturn($new_time);
$this->container
->set('datetime.time', $mock_time
->reveal());
}
}