/**
  * Constructor
  *
  * @param Context  $context
  * @param Registry $registry
  * @param          $registryIdKey
  * @param array    $buttonData
  */
 public function __construct(Context $context, Registry $registry, $registryIdKey, $buttonData = [])
 {
     $this->urlBuilder = $context->getUrlBuilder();
     $this->registry = $registry;
     $this->buttonData = $buttonData;
     $this->registryIdKey = $registryIdKey;
 }
Ejemplo n.º 2
0
 /**
  * @param \Magento\Backend\Block\Widget\Context $context
  * @param \Magento\Framework\Registry $registry
  * @param \Magento\Sales\Helper\Admin $adminHelper
  * @param \Magento\Sales\Api\OrderPaymentRepositoryInterface $orderPaymentRepository
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry, \Magento\Sales\Helper\Admin $adminHelper, OrderPaymentRepositoryInterface $orderPaymentRepository, array $data = [])
 {
     $this->_coreRegistry = $registry;
     $this->adminHelper = $adminHelper;
     $this->_urlBuilder = $context->getUrlBuilder();
     $this->orderPaymentRepository = $orderPaymentRepository;
 }
Ejemplo n.º 3
0
 public function __construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\ObjectManagerInterface $manager, array $data = [])
 {
     $this->_request = $context->getRequest();
     $mailId = $this->_request->getParam('id');
     $this->_mail = $manager->get('\\Shockwavemk\\Mail\\Base\\Model\\Mail');
     $this->_mail->load($mailId);
     parent::__construct($context, $data);
 }
 protected function setUp()
 {
     $this->contextMock = $this->getMock('Magento\\Backend\\Block\\Widget\\Context', [], [], '', false);
     $this->customerRegistryMock = $this->getMock('Magento\\Customer\\Model\\CustomerRegistry', ['retrieve'], [], '', false);
     $this->customerModelMock = $this->getMock('Magento\\Customer\\Model\\Customer', [], [], '', false);
     $this->registryMock = $this->getMock('Magento\\Framework\\Registry', ['registry'], [], '', false);
     $this->urlBuilderMock = $this->getMockBuilder('Magento\\Framework\\UrlInterface')->setMethods(['getUrl'])->disableOriginalConstructor()->getMockForAbstractClass();
     $this->contextMock->expects($this->any())->method('getUrlBuilder')->willReturn($this->urlBuilderMock);
     $objectManagerHelper = new ObjectManagerHelper($this);
     $this->block = $objectManagerHelper->getObject('Magento\\Customer\\Block\\Adminhtml\\Edit\\UnlockButton', ['context' => $this->contextMock, 'customerRegistry' => $this->customerRegistryMock, 'urlBuilder' => $this->urlBuilderMock, 'registry' => $this->registryMock]);
 }
Ejemplo n.º 5
0
 public function __construct(\Ess\M2ePro\Helper\Factory $helperFactory, \Ess\M2ePro\Model\Factory $modelFactory, \Ess\M2ePro\Model\ActiveRecord\Factory $activeRecordFactory, \Ess\M2ePro\Model\ActiveRecord\Component\Parent\Factory $parentFactory, Renderer\CssRenderer $css, Renderer\JsPhpRenderer $jsPhp, Renderer\JsRenderer $js, Renderer\JsTranslatorRenderer $jsTranslatorRenderer, Renderer\JsUrlRenderer $jsUrlRenderer, \Magento\Framework\App\RequestInterface $request, \Magento\Framework\View\LayoutInterface $layout, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\UrlInterface $urlBuilder, \Magento\Framework\App\CacheInterface $cache, \Magento\Framework\View\DesignInterface $design, \Magento\Framework\Session\Generic $session, \Magento\Framework\Session\SidResolverInterface $sidResolver, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\View\ConfigInterface $viewConfig, \Magento\Framework\App\Cache\StateInterface $cacheState, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Escaper $escaper, \Magento\Framework\Filter\FilterManager $filterManager, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\View\FileSystem $viewFileSystem, \Magento\Framework\View\TemplateEnginePool $enginePool, \Magento\Framework\App\State $appState, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\View\Page\Config $pageConfig, \Magento\Framework\View\Element\Template\File\Resolver $resolver, \Magento\Framework\View\Element\Template\File\Validator $validator, \Magento\Framework\AuthorizationInterface $authorization, \Magento\Backend\Model\Session $backendSession, \Magento\Framework\Math\Random $mathRandom, \Magento\Framework\Data\Form\FormKey $formKey, \Magento\Framework\Code\NameBuilder $nameBuilder, Button\ButtonList $buttonList, Button\ToolbarInterface $toolbar)
 {
     $this->helperFactory = $helperFactory;
     $this->modelFactory = $modelFactory;
     $this->activeRecordFactory = $activeRecordFactory;
     $this->parentFactory = $parentFactory;
     $this->css = $css;
     $this->jsPhp = $jsPhp;
     $this->js = $js;
     $this->jsTranslator = $jsTranslatorRenderer;
     $this->jsUrl = $jsUrlRenderer;
     parent::__construct($request, $layout, $eventManager, $urlBuilder, $cache, $design, $session, $sidResolver, $scopeConfig, $assetRepo, $viewConfig, $cacheState, $logger, $escaper, $filterManager, $localeDate, $inlineTranslation, $filesystem, $viewFileSystem, $enginePool, $appState, $storeManager, $pageConfig, $resolver, $validator, $authorization, $backendSession, $mathRandom, $formKey, $nameBuilder, $buttonList, $toolbar);
 }
 /**
  * Generate url by route and parameters
  *
  * @param   string $route
  * @param   array $params
  * @return  string
  */
 public function getUrl($route = '', $params = [])
 {
     return $this->context->getUrlBuilder()->getUrl($route, $params);
 }
Ejemplo n.º 7
0
 /**
  * @param Context $context
  */
 public function __construct(Context $context)
 {
     $this->urlBuilder = $context->getUrlBuilder();
 }
Ejemplo n.º 8
0
 /**
  * @param Context $context
  * @param array $data
  */
 public function __construct(\Magento\Backend\Block\Widget\Context $context, array $data = [])
 {
     $this->buttonList = $context->getButtonList();
     $this->toolbar = $context->getButtonToolbar();
     parent::__construct($context, $data);
 }
Ejemplo n.º 9
0
 /**
  * Constructor
  *
  * @param \Magento\Backend\Block\Widget\Context $context
  * @param \Magento\Framework\Registry $registry
  */
 public function __construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry)
 {
     $this->urlBuilder = $context->getUrlBuilder();
     $this->registry = $registry;
 }
 protected function initContext()
 {
     $this->urlBuilder = $this->getMockBuilder('Magento\\Framework\\UrlInterface')->disableOriginalConstructor()->getMock();
     $this->context = $this->getMockBuilder('Magento\\Backend\\Block\\Widget\\Context')->disableOriginalConstructor()->getMock();
     $this->context->expects($this->any())->method('getUrlBuilder')->willReturn($this->urlBuilder);
 }
Ejemplo n.º 11
0
 /**
  * Constructor
  *
  * @param \Magento\Backend\Block\Widget\Context $context
  * @param \Magento\Framework\Registry $registry
  */
 public function __construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry)
 {
     $this->authorization = $context->getAuthorization();
     parent::__construct($context, $registry);
 }