protected function setUp() { $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $className = 'Magento\\Customer\\Helper\\Address'; $arguments = $objectManagerHelper->getConstructArguments($className); /** @var \Magento\Framework\App\Helper\Context $context */ $this->context = $arguments['context']; $this->blockFactory = $arguments['blockFactory']; $this->storeManager = $arguments['storeManager']; $this->scopeConfig = $this->context->getScopeConfig(); $this->customerMetadataService = $arguments['customerMetadataService']; $this->addressConfig = $arguments['addressConfig']; $this->addressMetadataService = $arguments['addressMetadataService']; $this->helper = $objectManagerHelper->getObject($className, $arguments); }
/** * @param Context $context * @param ObjectManagerInterface $objectManager * @param StdlibString $string * @param ScopeConfigInterface $scopeConfig */ public function __construct(Context $context, ObjectManagerInterface $objectManager, StdlibString $string) { $this->request = $context->getRequest(); $this->objectManager = $objectManager; $this->string = $string; $this->scopeConfig = $context->getScopeConfig(); }
/** * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\GiftMessage\Api\CartRepositoryInterface $cartRepository * @param \Magento\GiftMessage\Api\ItemRepositoryInterface $itemRepository * @param \Magento\Checkout\Model\Session $checkoutSession */ public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\GiftMessage\Api\CartRepositoryInterface $cartRepository, \Magento\GiftMessage\Api\ItemRepositoryInterface $itemRepository, \Magento\Checkout\Model\Session $checkoutSession) { $this->scopeConfiguration = $context->getScopeConfig(); $this->cartRepository = $cartRepository; $this->itemRepository = $itemRepository; $this->checkoutSession = $checkoutSession; }
/** * Construct * * @param Context $context * @param StringUtils $string * @param Escaper $escaper * @param StoreManagerInterface $storeManager */ public function __construct(Context $context, StringUtils $string, Escaper $escaper, StoreManagerInterface $storeManager) { $this->string = $string; $this->scopeConfig = $context->getScopeConfig(); $this->escaper = $escaper; $this->storeManager = $storeManager; parent::__construct($context); }
/** * @param Context $context * @param ObjectManagerInterface $objectManager * @param StdlibString $string * @param Data|null $queryHelper */ public function __construct(Context $context, ObjectManagerInterface $objectManager, StdlibString $string, Data $queryHelper = null) { $this->request = $context->getRequest(); $this->objectManager = $objectManager; $this->string = $string; $this->scopeConfig = $context->getScopeConfig(); $this->queryHelper = $queryHelper === null ? $this->objectManager->get(Data::class) : $queryHelper; }
/** * Constructor * * @param ImageFactory $imageFactory * @param Context $context * @param AssetRepository $assetRepo */ public function __construct(ImageFactory $imageFactory, Context $context, AssetRepository $assetRepo) { $this->imageFactory = $imageFactory; $this->context = $context; $this->scopeConfig = $context->getScopeConfig(); $this->assetRepo = $assetRepo; parent::__construct($context); }
/** * Construct * * @param Context $context * @param String $string * @param QueryFactory $queryFactory * @param Escaper $escaper * @param StoreManagerInterface $storeManager */ public function __construct(Context $context, string $string, QueryFactory $queryFactory, Escaper $escaper, StoreManagerInterface $storeManager) { $this->string = $string; $this->_scopeConfig = $context->getScopeConfig(); $this->_queryFactory = $queryFactory; $this->_escaper = $escaper; $this->_storeManager = $storeManager; parent::__construct($context); }
/** * {@inheritdoc} * * @param UrlRewriteFactory $urlRewriteFactory * @param UrlRewriteCollectionFactory $urlRewriteCollectionFactory * @param FilterManager $filter * @param Context $context */ public function __construct(UrlRewriteFactory $urlRewriteFactory, UrlRewriteCollectionFactory $urlRewriteCollectionFactory, FilterManager $filter, Context $context) { $this->urlRewriteFactory = $urlRewriteFactory; $this->urlRewriteCollectionFactory = $urlRewriteCollectionFactory; $this->filter = $filter; $this->urlManager = $context->getUrlBuilder(); $this->scopeConfig = $context->getScopeConfig(); parent::__construct($context); }
/** * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Ebizmarts\MageMonkey\Model\Logger\Logger $logger * @param \Magento\Customer\Model\GroupRegistry $groupRegistry */ public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Ebizmarts\MageMonkey\Model\Logger\Logger $logger, \Magento\Customer\Model\GroupRegistry $groupRegistry, \Magento\Framework\App\State $state) { $this->_storeManager = $storeManager; $this->_mlogger = $logger; $this->_groupRegistry = $groupRegistry; $this->_scopeConfig = $context->getScopeConfig(); $this->_request = $context->getRequest(); $this->_state = $state; parent::__construct($context); }
/** * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Store\Model\StoreManagerInterface $storeManager, * @param \EMerchantPay\Genesis\Model\ConfigFactory $configFactory, * @param \Magento\Framework\Locale\ResolverInterface $localeResolver */ public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, \Magento\Framework\App\Helper\Context $context, \Magento\Payment\Helper\Data $paymentData, \Magento\Store\Model\StoreManagerInterface $storeManager, \EMerchantPay\Genesis\Model\ConfigFactory $configFactory, \Magento\Framework\Locale\ResolverInterface $localeResolver) { $this->_objectManager = $objectManager; $this->_paymentData = $paymentData; $this->_storeManager = $storeManager; $this->_configFactory = $configFactory; $this->_localeResolver = $localeResolver; $this->_scopeConfig = $context->getScopeConfig(); parent::__construct($context); }
/** * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\GiftMessage\Api\CartRepositoryInterface $cartRepository * @param \Magento\GiftMessage\Api\ItemRepositoryInterface $itemRepository * @param \Magento\Checkout\Model\Session $checkoutSession * @param HttpContext $httpContext * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param LocaleFormat $localeFormat * @param FormKey $formKey */ public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\GiftMessage\Api\CartRepositoryInterface $cartRepository, \Magento\GiftMessage\Api\ItemRepositoryInterface $itemRepository, \Magento\Checkout\Model\Session $checkoutSession, HttpContext $httpContext, \Magento\Store\Model\StoreManagerInterface $storeManager, LocaleFormat $localeFormat, FormKey $formKey) { $this->scopeConfiguration = $context->getScopeConfig(); $this->cartRepository = $cartRepository; $this->itemRepository = $itemRepository; $this->checkoutSession = $checkoutSession; $this->httpContext = $httpContext; $this->storeManager = $storeManager; $this->localeFormat = $localeFormat; $this->formKey = $formKey; }
/** * Wrapper method to get config value at path, scope, and scope code provided * * @param $path * @param $contextScope * @param $contextScopeId * @return mixed */ protected function _getConfigValue($path, $contextScope, $contextScopeId) { return $this->context->getScopeConfig()->getValue($path, $contextScope, $contextScopeId); }