/** * {@inheritdoc} */ public function setUp() { $this->currencyStorage = $this->getMock(EntityStorageInterface::class); $this->currencyLocaleStorage = $this->getMock(EntityStorageInterface::class); $this->entityTypeManager = $this->getMock(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); }
/** * {@inheritdoc} */ public function setUp() { $this->configFactory = $this->getMock(ConfigFactoryInterface::class); $this->currencyLocaleStorage = $this->getMock(EntityStorageInterface::class); $this->entityTypeManager = $this->getMock(EntityTypeManagerInterface::class); $this->entityTypeManager->expects($this->any())->method('getStorage')->with('currency_locale')->willReturn($this->currencyLocaleStorage); $this->eventDispatcher = $this->getMock(EventDispatcherInterface::class); $this->languageManager = $this->getMock(LanguageManagerInterface::class); $this->sut = new LocaleResolver($this->entityTypeManager, $this->languageManager, $this->configFactory, $this->eventDispatcher); }
/** * {@inheritdoc} */ public function setUp() { $this->configStorage = $this->getMock(StorageInterface::class); $this->currencyStorage = $this->getMock(EntityStorageInterface::class); $this->currencyLocaleStorage = $this->getMock(EntityStorageInterface::class); $this->eventDispatcher = $this->getMock(EventDispatcherInterface::class); $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class); $this->typedConfigManager = $this->getMock(TypedConfigManagerInterface::class); $map = [['currency', $this->currencyStorage], ['currency_locale', $this->currencyLocaleStorage]]; $this->entityTypeManager = $this->getMock(EntityTypeManagerInterface::class); $this->entityTypeManager->expects($this->atLeastOnce())->method('getStorage')->willReturnMap($map); $this->sut = new ConfigImporter($this->moduleHandler, $this->eventDispatcher, $this->typedConfigManager, $this->entityTypeManager); }