You are here

protected function CartLinksRegexpTest::setUp in Ubercart 8.4

Overrides UnitTestCase::setUp

File

uc_cart_links/tests/src/Unit/CartLinksRegexpTest.php, line 40

Class

CartLinksRegexpTest
@coversDefaultClass \Drupal\uc_cart_links\CartLinksValidator

Namespace

Drupal\Tests\uc_cart_links\Unit

Code

protected function setUp() {
  parent::setUp();
  $container = new ContainerBuilder();
  $this->messenger = new TestMessenger();
  $this->cartLinksValidator = new CartLinksValidator($this->messenger);
  $container
    ->set('uc_cart_links.validator', $this->cartLinksValidator);
  $container
    ->set('messenger', $this->messenger);
  \Drupal::setContainer($container);
  $this->container = $container;
}