public function CurrencyLocaleFormTest::setUp in Currency 8.3
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ Entity/ CurrencyLocale/ CurrencyLocaleFormTest.php, line 85
Class
- CurrencyLocaleFormTest
- @coversDefaultClass \Drupal\currency\Entity\CurrencyLocale\CurrencyLocaleForm
Namespace
Drupal\Tests\currency\Unit\Entity\CurrencyLocaleCode
public function setUp() : void {
$this->countryManager = $this
->createMock(CountryManagerInterface::class);
$this->currencyLocale = $this
->createMock(CurrencyLocaleInterface::class);
$this->currencyLocaleStorage = $this
->createMock(EntityStorageInterface::class);
$this->linkGenerator = $this
->createMock(LinkGeneratorInterface::class);
$this->stringTranslation = $this
->getStringTranslationStub();
$this->formValidator = $this
->createMock(FormValidatorInterface::class);
$this->messenger = $this
->createMock(MessengerInterface::class);
$container = new ContainerBuilder();
$container
->set('form_validator', $this->formValidator);
\Drupal::setContainer($container);
$this->sut = new CurrencyLocaleForm($this->stringTranslation, $this->linkGenerator, $this->currencyLocaleStorage, $this->countryManager);
$this->sut
->setEntity($this->currencyLocale);
$this->sut
->setMessenger($this->messenger);
}