You are here

public function FormHelperTest::setUp in Currency 8.3

Overrides UnitTestCase::setUp

File

tests/src/Unit/FormHelperTest.php, line 58

Class

FormHelperTest
@coversDefaultClass \Drupal\currency\FormHelper

Namespace

Drupal\Tests\currency\Unit

Code

public function setUp() : void {
  $this->currencyStorage = $this
    ->createMock(EntityStorageInterface::class);
  $this->currencyLocaleStorage = $this
    ->createMock(EntityStorageInterface::class);
  $this->entityTypeManager = $this
    ->createMock(EntityTypeManagerInterface::class);
  $map = [
    [
      'currency',
      $this->currencyStorage,
    ],
    [
      'currency_locale',
      $this->currencyLocaleStorage,
    ],
  ];
  $this->entityTypeManager
    ->expects($this
    ->atLeastOnce())
    ->method('getStorage')
    ->willReturnMap($map);
  $this->stringTranslation = $this
    ->getStringTranslationStub();
  $this->sut = new FormHelper($this->stringTranslation, $this->entityTypeManager);
}