Exemple #1
0
 protected function setUp()
 {
     $this->objectManager = new ObjectManager($this);
     $this->checkoutSession = $this->getMock('Magento\\Checkout\\Model\\Session', [], [], '', false);
     $this->messageManager = $this->getMock('Magento\\Framework\\Message\\ManagerInterface', [], [], '', false);
     $this->object = $this->objectManager->getObject('Magento\\Checkout\\Model\\Observer', ['checkoutSession' => $this->checkoutSession, 'messageManager' => $this->messageManager]);
 }
Exemple #2
0
 public function testGetFormHtmlId()
 {
     $formMock = $this->getMock('Magento\\Framework\\Data\\Form', ['getHtmlIdPrefix'], [], '', false);
     $formMock->expects($this->once())->method('getHtmlIdPrefix')->will($this->returnValue('account_form'));
     $this->block = $this->objectManagerHelper->getObject('Magento\\Customer\\Block\\Adminhtml\\Edit\\Renderer\\Attribute\\Sendemail', ['context' => $this->contextMock, 'data' => ['form' => $formMock]]);
     $this->assertEquals('account_form', $this->block->getFormHtmlId());
 }
Exemple #3
0
 protected function setUp()
 {
     $this->scopeConfigMock = $this->getMock('Magento\\Framework\\App\\Config\\ScopeConfigInterface');
     $this->requestMock = $this->getMock('Magento\\Framework\\App\\Request\\Http', [], [], '', false);
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->designExceptions = $this->objectManagerHelper->getObject('Magento\\Framework\\View\\DesignExceptions', ['scopeConfig' => $this->scopeConfigMock, 'exceptionConfigPath' => $this->exceptionConfigPath, 'scopeType' => $this->scopeType]);
 }
Exemple #4
0
 /**
  * @param bool $isSecure
  * @param array $metadata
  * @param bool $expected
  * @param int $callNum
  * @dataProvider toArrayDataProvider
  */
 public function testToArray($isSecure, $metadata, $expected, $callNum = 1)
 {
     $this->requestMock->expects($this->exactly($callNum))->method('isSecure')->willReturn($isSecure);
     /** @var \Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata $object */
     $object = $this->objectManager->getObject('Magento\\Framework\\Stdlib\\Cookie\\SensitiveCookieMetadata', ['request' => $this->requestMock, 'metadata' => $metadata]);
     $this->assertEquals($expected, $object->__toArray());
 }
Exemple #5
0
 /**
  * @dataProvider getPropertiesDataProvider
  */
 public function testGetProperties($queryText, $resultsCount)
 {
     /** @var \Magento\Search\Model\QueryResult $queryResult */
     $queryResult = $this->objectManager->getObject('Magento\\Search\\Model\\QueryResult', ['queryText' => $queryText, 'resultsCount' => $resultsCount]);
     $this->assertEquals($queryText, $queryResult->getQueryText());
     $this->assertEquals($resultsCount, $queryResult->getResultsCount());
 }
Exemple #6
0
 protected function setUp()
 {
     $this->sendfriendModel = $this->getMock('Magento\\Sendfriend\\Model\\Sendfriend', ['__wakeup', 'canEmailToFriend'], [], '', false);
     $this->productView = $this->getMock('Magento\\Catalog\\Block\\Product\\View', [], [], '', false);
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->view = $this->objectManagerHelper->getObject('Magento\\Sendfriend\\Block\\Plugin\\Catalog\\Product\\View', ['sendfriend' => $this->sendfriendModel]);
 }
Exemple #7
0
 protected function setUp()
 {
     $this->context = $this->getMock('Magento\\Framework\\View\\Element\\Template\\Context', [], [], '', false);
     $this->rssManagerInterface = $this->getMock('Magento\\Framework\\App\\Rss\\RssManagerInterface');
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->block = $this->objectManagerHelper->getObject('Magento\\Rss\\Block\\Feeds', ['context' => $this->context, 'rssManager' => $this->rssManagerInterface]);
 }
Exemple #8
0
 public function setUp()
 {
     $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
     $this->_indexerMock = $this->getMock('Magento\\Indexer\\Model\\Indexer', array('getId', 'invalidate'), array(), '', false);
     $this->_indexerMock->expects($this->any())->method('getId')->will($this->returnValue(1));
     $this->_model = $this->_objectManager->getObject('Magento\\CatalogImportExport\\Model\\Indexer\\Product\\Price\\Plugin\\Import', array('indexer' => $this->_indexerMock));
 }
Exemple #9
0
 protected function setUp()
 {
     $this->contextMock = $this->getMock('Magento\\Framework\\App\\Helper\\Context', [], [], '', false);
     $this->scopeConfigMock = $this->getMock('Magento\\Framework\\App\\Config\\ScopeConfigInterface');
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->data = $this->objectManagerHelper->getObject('Magento\\CatalogInventory\\Helper\\Data', ['context' => $this->contextMock, 'scopeConfig' => $this->scopeConfigMock]);
 }
Exemple #10
0
 protected function setUp()
 {
     $this->sessionMock = $this->getMock('Magento\\Checkout\\Model\\Session', array(), array(), '', false);
     $this->filterMock = $this->getMock('Magento\\RecurringPayment\\Model\\Quote\\Filter');
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->payment = $this->objectManagerHelper->getObject('Magento\\RecurringPayment\\Block\\Plugin\\Payment', array('session' => $this->sessionMock, 'filter' => $this->filterMock));
 }
Exemple #11
0
 protected function setUp()
 {
     $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
     $this->_moduleReaderMock = $this->getMock('Magento\\Framework\\Module\\Dir\\Reader', [], [], '', false);
     $this->_moduleReaderMock->expects($this->once())->method('getModuleDir')->with('etc', 'moduleName')->will($this->returnValue('schema_dir'));
     $this->_model = $this->objectManager->getObject('Magento\\Framework\\App\\Config\\Initial\\SchemaLocator', ['moduleReader' => $this->_moduleReaderMock, 'moduleName' => 'moduleName']);
 }
Exemple #12
0
 public function setUp()
 {
     $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
     $this->_indexerMock = $this->getMock('Magento\\Indexer\\Model\\Indexer', ['getId', 'invalidate'], [], '', false);
     $this->indexerRegistryMock = $this->getMock('Magento\\Indexer\\Model\\IndexerRegistry', ['get'], [], '', false);
     $this->_model = $this->_objectManager->getObject('Magento\\CatalogImportExport\\Model\\Indexer\\Product\\Price\\Plugin\\Import', ['indexerRegistry' => $this->indexerRegistryMock]);
 }
Exemple #13
0
 /**
  * @return void
  * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
  */
 public function testPrepareLayout()
 {
     $customerId = 1;
     $registry = $this->getMockBuilder('Magento\\Framework\\Registry')->disableOriginalConstructor()->setMethods(array('registry'))->getMock();
     $registry->expects($this->once())->method('registry')->with('current_customer_id')->will($this->returnValue($customerId));
     $store = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock();
     $collectionElement = $this->getMockBuilder('Magento\\RecurringPayment\\Model\\Payment')->disableOriginalConstructor()->setMethods(array('setStore', 'renderData', 'getReferenceId', '__wakeup'))->getMock();
     $collectionElement->expects($this->once())->method('setStore')->with($store)->will($this->returnValue($collectionElement));
     $collectionElement->expects($this->once())->method('getReferenceId')->will($this->returnValue(1));
     $collectionElement->expects($this->atLeastOnce())->method('renderData')->will($this->returnValue(2));
     $collection = $this->getMockBuilder('Magento\\RecurringPayment\\Model\\Resource\\Payment\\Collection')->disableOriginalConstructor()->setMethods(array('addFieldToFilter', 'addFieldToSelect', 'setOrder'))->getMock();
     $collection->expects($this->once())->method('addFieldToFilter')->with('customer_id', 1)->will($this->returnValue($collection));
     $collection->expects($this->once())->method('addFieldToSelect')->will($this->returnValue($collection));
     $collection->expects($this->once())->method('setOrder')->will($this->returnValue(array($collectionElement)));
     $payment = $this->getMockBuilder('Magento\\RecurringPayment\\Model\\Payment')->disableOriginalConstructor()->setMethods(array('getCollection', 'getFieldLabel', '__wakeup'))->getMock();
     $payment->expects($this->once())->method('getCollection')->will($this->returnValue($collection));
     $storeManager = $this->getMockBuilder('Magento\\Store\\Model\\StoreManager')->disableOriginalConstructor()->setMethods(array('getStore'))->getMock();
     $storeManager->expects($this->once())->method('getStore')->will($this->returnValue($store));
     $locale = $this->getMockBuilder('\\Magento\\Framework\\Stdlib\\DateTime\\TimezoneInterface')->disableOriginalConstructor()->setMethods(array('formatDate'))->getMockForAbstractClass();
     $locale->expects($this->once())->method('formatDate')->will($this->returnValue('11-11-1999'));
     $block = $this->_objectManagerHelper->getObject('Magento\\RecurringPayment\\Block\\Payment\\Grid', array('recurringPayment' => $payment, 'registry' => $registry, 'storeManager' => $storeManager, 'localeDate' => $locale));
     $pagerBlock = $this->getMockBuilder('Magento\\Theme\\Block\\Html\\Pager')->disableOriginalConstructor()->setMethods(array('setCollection'))->getMock();
     $pagerBlock->expects($this->once())->method('setCollection')->with(array($collectionElement))->will($this->returnValue($pagerBlock));
     $layout = $this->_getMockLayout();
     $layout->expects($this->once())->method('createBlock')->will($this->returnValue($pagerBlock));
     $block->setLayout($layout);
     $this->assertNotEmpty($block->getGridColumns());
     $expectedResult = array(new \Magento\Framework\Object(array('reference_id' => 1, 'reference_id_link_url' => null, 'state' => 2, 'created_at' => '11-11-1999', 'updated_at' => '', 'method_code' => 2)));
     $this->assertEquals($expectedResult, $block->getGridElements());
 }
Exemple #14
0
 /**
  *  Test protected `_toHtml` method via public `toHtml` method.
  */
 public function testToHtml()
 {
     $eventManager = $this->getMockBuilder('Magento\\Framework\\Event\\Manager')->disableOriginalConstructor()->setMethods(['dispatch'])->getMock();
     $eventManager->expects($this->once())->method('dispatch')->will($this->returnValue(true));
     $scopeConfig = $this->getMockBuilder('\\Magento\\Framework\\App\\Config')->setMethods(['getValue'])->disableOriginalConstructor()->getMock();
     $scopeConfig->expects($this->once())->method('getValue')->withAnyParameters()->will($this->returnValue(false));
     $product = $this->getMockBuilder('Magento\\Catalog\\Model\\Product')->disableOriginalConstructor()->setMethods(['setStoreId', 'load', 'getId', '__wakeup', '__sleep'])->getMock();
     $product->expects($this->once())->method('setStoreId')->will($this->returnSelf());
     $product->expects($this->once())->method('load')->will($this->returnSelf());
     $product->expects($this->once())->method('getId')->will($this->returnValue(1));
     $optionsBlock = $this->getMockBuilder('Magento\\Catalog\\Block\\Adminhtml\\Product\\Edit\\Tab\\Options\\Option')->setMethods(['setIgnoreCaching', 'setProduct', 'getOptionValues'])->disableOriginalConstructor()->getMock();
     $optionsBlock->expects($this->once())->method('setIgnoreCaching')->with(true)->will($this->returnSelf());
     $optionsBlock->expects($this->once())->method('setProduct')->with($product)->will($this->returnSelf());
     $optionsBlock->expects($this->once())->method('getOptionValues')->will($this->returnValue([]));
     $layout = $this->getMockBuilder('Magento\\Framework\\View\\Layout\\Element\\Layout')->disableOriginalConstructor()->setMethods(['createBlock'])->getMock();
     $layout->expects($this->once())->method('createBlock')->with('Magento\\Catalog\\Block\\Adminhtml\\Product\\Edit\\Tab\\Options\\Option')->will($this->returnValue($optionsBlock));
     $request = $this->getMockBuilder('Magento\\Framework\\App\\Request\\Http')->setMethods(['getParam'])->disableOriginalConstructor()->getMock();
     $request->expects($this->once())->method('getParam')->with('store')->will($this->returnValue(0));
     $this->context->expects($this->once())->method('getEventManager')->will($this->returnValue($eventManager));
     $this->context->expects($this->once())->method('getScopeConfig')->will($this->returnValue($scopeConfig));
     $this->context->expects($this->once())->method('getLayout')->will($this->returnValue($layout));
     $this->context->expects($this->once())->method('getRequest')->will($this->returnValue($request));
     $this->registry->expects($this->once())->method('registry')->with('import_option_products')->will($this->returnValue([1]));
     $this->productFactory->expects($this->once())->method('create')->will($this->returnValue($product));
     $this->block = $this->objectManagerHelper->getObject('Magento\\Catalog\\Block\\Adminhtml\\Product\\Options\\Ajax', ['context' => $this->context, 'jsonEncoder' => $this->encoderInterface, 'productFactory' => $this->productFactory, 'coreData' => $this->coreHelper, 'registry' => $this->registry]);
     $this->block->toHtml();
 }
Exemple #15
0
 protected function setUp()
 {
     $this->objectManagerMock = $this->getMock('Magento\\Framework\\ObjectManagerInterface');
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->pageFactory = $this->objectManagerHelper->getObject('Magento\\Framework\\View\\Result\\PageFactory', ['objectManager' => $this->objectManagerMock]);
     $this->page = $this->getMockBuilder('Magento\\Framework\\View\\Result\\Page')->disableOriginalConstructor()->getMock();
 }
Exemple #16
0
 public function testIsSatisfiedBy()
 {
     $paymentMethodCode = 'test';
     $this->configMock->expects($this->once())->method('getMethodsInfo')->will($this->returnValue(array($paymentMethodCode => array(\Magento\RecurringPayment\Model\Method\RecurringPaymentSpecification::CONFIG_KEY => 1))));
     $this->recurringPaymentSpecification = $this->objectManagerHelper->getObject('Magento\\RecurringPayment\\Model\\Method\\RecurringPaymentSpecification', array('paymentConfig' => $this->configMock));
     $this->assertTrue($this->recurringPaymentSpecification->isSatisfiedBy($paymentMethodCode));
 }
Exemple #17
0
 public function setUp()
 {
     $this->productRepository = $this->getMockBuilder('Magento\\Catalog\\Model\\ProductRepository')->disableOriginalConstructor()->getMock();
     $this->productConverter = $this->getMockBuilder('Magento\\Catalog\\Service\\V1\\Data\\Converter')->disableOriginalConstructor()->getMock();
     $this->objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this);
     $this->object = $this->objectManagerHelper->getObject('Magento\\ConfigurableProduct\\Service\\V1\\Product\\Link\\ReadService', ['productRepository' => $this->productRepository, 'productConverter' => $this->productConverter]);
 }
Exemple #18
0
    /**
     * @return void
     */
    protected function setUp()
    {
        $this->requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface')
            ->getMock();
        $this->guestHelperMock = $this->getMockBuilder('Magento\Sales\Helper\Guest')
            ->disableOriginalConstructor()
            ->getMock();
        $this->resultRedirectMock = $this->getMockBuilder('Magento\Framework\Controller\Result\Redirect')
            ->disableOriginalConstructor()
            ->getMock();
        $this->resultPageFactoryMock = $this->getMockBuilder('Magento\Framework\View\Result\PageFactory')
            ->disableOriginalConstructor()
            ->setMethods(['create'])
            ->getMock();
        $this->resultPageMock = $this->getMockBuilder('Magento\Framework\View\Result\Page')
            ->disableOriginalConstructor()
            ->getMock();

        $this->objectManagerHelper = new ObjectManagerHelper($this);
        $this->context = $this->objectManagerHelper->getObject(
            'Magento\Framework\App\Action\Context',
            [
                'request' => $this->requestMock
            ]
        );
        $this->viewController = $this->objectManagerHelper->getObject(
            'Magento\Sales\Controller\Guest\View',
            [
                'context' => $this->context,
                'guestHelper' => $this->guestHelperMock,
                'resultPageFactory' => $this->resultPageFactoryMock
            ]
        );
    }
Exemple #19
0
 /**
  * @dataProvider notIsValidDataProvider
  * @param $data
  * @param $result
  */
 public function testNotIsValid($data, $result)
 {
     $provider = $this->getMockForAbstractClass('Magento\\Checkout\\Model\\Agreements\\AgreementsProviderInterface');
     $provider->expects($this->once())->method('getRequiredAgreementIds')->will($this->returnValue([1, 3, '4']));
     $this->object = $this->objectManagerHelper->getObject('Magento\\Checkout\\Model\\Agreements\\AgreementsValidator', ['list' => [$provider]]);
     $this->assertEquals($result, $this->object->isValid($data));
 }
Exemple #20
0
 protected function setUp()
 {
     $this->managerInterface = $this->getMock('Magento\\Framework\\Event\\ManagerInterface');
     $this->reviewFactory = $this->getMock('Magento\\Review\\Model\\ReviewFactory', ['create'], [], '', false);
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->rss = $this->objectManagerHelper->getObject('Magento\\Review\\Model\\Rss', ['eventManager' => $this->managerInterface, 'reviewFactory' => $this->reviewFactory]);
 }
Exemple #21
0
 public function setUp()
 {
     $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
     $this->categoryTreeMock = $this->getMockBuilder('Magento\\Catalog\\Service\\V1\\Data\\Category\\Tree')->disableOriginalConstructor()->getMock();
     $this->categoryFactoryMock = $this->getMockBuilder('\\Magento\\Catalog\\Model\\CategoryFactory')->disableOriginalConstructor()->setMethods(['create', 'load'])->getMock();
     $this->categoryService = $this->objectManager->getObject('\\Magento\\Catalog\\Service\\V1\\Category\\Tree\\ReadService', ['categoryFactory' => $this->categoryFactoryMock, 'categoryTree' => $this->categoryTreeMock]);
 }
Exemple #22
0
 public function setUp()
 {
     $resourceMethods = ['getIdFieldName', 'loadByRequestPath', 'load'];
     $this->resourceMock = $this->getMockForAbstractClass('\\Magento\\Framework\\Model\\Resource\\AbstractResource', [], '', false, true, true, $resourceMethods);
     $this->objectManager = new ObjectManager($this);
     $this->model = $this->objectManager->getObject('\\Magento\\UrlRewrite\\Model\\UrlRewrite', ['resource' => $this->resourceMock]);
 }
Exemple #23
0
 public function testGetDefaultGroup()
 {
     $this->assertEquals(ManagerInterface::DEFAULT_GROUP, $this->model->getDefaultGroup());
     $customDefaultGroup = 'some_group';
     $customManager = $this->objectManager->getObject('Magento\\Framework\\Message\\Manager', ['defaultGroup' => $customDefaultGroup]);
     $this->assertEquals($customDefaultGroup, $customManager->getDefaultGroup());
 }
Exemple #24
0
 /**
  * @param array $data
  * @param string $priceCode
  * @param array $cssClasses
  * @dataProvider toHtmlDataProvider
  */
 public function testToHtml($data, $priceCode, $cssClasses)
 {
     $this->price->expects($this->once())->method('getPriceCode')->will($this->returnValue($priceCode));
     $priceBox = $this->objectManager->getObject('Magento\\Framework\\Pricing\\Render\\PriceBox', ['context' => $this->context, 'saleableItem' => $this->saleable, 'price' => $this->price, 'rendererPool' => $this->rendererPool, 'data' => $data]);
     $priceBox->toHtml();
     $this->assertEquals($cssClasses, $priceBox->getData('css_classes'));
 }
Exemple #25
0
 /**
  * Test for getLicenseHtml when EULA file name is empty
  *
  * @dataProvider getLicenseHtmlWhenFileIsEmptyDataProvider
  *
  * @param $fileName
  */
 public function testGetLicenseHtmlWhenFileIsEmpty($fileName)
 {
     $fileSystem = $this->getMock('Magento\\Framework\\App\\Filesystem', array(), array(), '', false);
     $fileSystem->expects($this->never())->method('read');
     $block = $this->_objectManager->getObject('Magento\\Install\\Block\\Begin', array('filesystem' => $fileSystem, 'eulaFile' => $fileName));
     $this->assertEquals('', $block->getLicenseHtml());
 }
Exemple #26
0
 protected function setUp()
 {
     $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
     $this->paymentHelperMock = $this->getMock('\\Magento\\Payment\\Helper\\Data', [], [], '', false);
     $this->specificationFactoryMock = $this->getMock('\\Magento\\Payment\\Model\\Checks\\SpecificationFactory', [], [], '', false);
     $this->methodList = $this->objectManager->getObject('\\Magento\\Payment\\Model\\MethodList', ['paymentHelper' => $this->paymentHelperMock, 'specificationFactory' => $this->specificationFactoryMock]);
 }
Exemple #27
0
 protected function setUp()
 {
     $this->dateTime = $this->getMock('Magento\\Framework\\Stdlib\\DateTime');
     $this->collectionFactory = $this->getMock('Magento\\SalesRule\\Model\\Resource\\Rule\\CollectionFactory', ['create'], [], '', false);
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->discounts = $this->objectManagerHelper->getObject('Magento\\SalesRule\\Model\\Rss\\Discounts', ['dateTime' => $this->dateTime, 'collectionFactory' => $this->collectionFactory]);
 }
Exemple #28
0
 protected function setUp()
 {
     $this->entityFactoryMock = $this->getMock('Magento\\Framework\\Data\\Collection\\EntityFactory', [], [], '', false);
     $this->loggerMock = $this->getMock('Psr\\Log\\LoggerInterface');
     $this->fetchStrategyMock = $this->getMock('Magento\\Framework\\Data\\Collection\\Db\\FetchStrategyInterface');
     $this->managerInterfaceMock = $this->getMock('Magento\\Framework\\Event\\ManagerInterface');
     $this->configMock = $this->getMock('Magento\\Eav\\Model\\Config', [], [], '', false);
     $this->resourceMock = $this->getMock('Magento\\Framework\\App\\Resource', [], [], '', false);
     $this->entityFactoryMock2 = $this->getMock('Magento\\Eav\\Model\\EntityFactory', [], [], '', false);
     $this->helperMock = $this->getMock('Magento\\Catalog\\Model\\Resource\\Helper', [], [], '', false);
     $entity = $this->getMock('Magento\\Eav\\Model\\Entity\\AbstractEntity', [], [], '', false);
     $adapter = $this->getMockForAbstractClass('Zend_Db_Adapter_Abstract', [], '', false);
     $entity->expects($this->any())->method('getReadConnection')->will($this->returnValue($adapter));
     $entity->expects($this->any())->method('getDefaultAttributes')->will($this->returnValue([]));
     $this->universalFactoryMock = $this->getMock('Magento\\Framework\\Validator\\UniversalFactory', [], [], '', false);
     $this->universalFactoryMock->expects($this->any())->method('create')->will($this->returnValue($entity));
     $this->storeManagerMock = $this->getMockForAbstractClass('Magento\\Framework\\Store\\StoreManagerInterface');
     $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnCallback(function ($store) {
         return is_object($store) ? $store : new \Magento\Framework\Object(['id' => 42]);
     }));
     $this->catalogHelperMock = $this->getMock('Magento\\Catalog\\Helper\\Data', [], [], '', false);
     $this->stateMock = $this->getMock('Magento\\Catalog\\Model\\Indexer\\Product\\Flat\\State', [], [], '', false);
     $this->scopeConfigInterfaceMock = $this->getMock('Magento\\Framework\\App\\Config\\ScopeConfigInterface');
     $this->optionFactoryMock = $this->getMock('Magento\\Catalog\\Model\\Product\\OptionFactory', [], [], '', false);
     $this->urlMock = $this->getMock('Magento\\Catalog\\Model\\Resource\\Url', [], [], '', false);
     $this->timezoneInterfaceMock = $this->getMock('Magento\\Framework\\Stdlib\\DateTime\\TimezoneInterface');
     $this->sessionMock = $this->getMock('Magento\\Customer\\Model\\Session', [], [], '', false);
     $this->dateTimeMock = $this->getMock('Magento\\Framework\\Stdlib\\DateTime');
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->collection = $this->objectManagerHelper->getObject('Magento\\Catalog\\Model\\Resource\\Product\\Link\\Product\\Collection', ['entityFactory' => $this->entityFactoryMock, 'logger' => $this->loggerMock, 'fetchStrategy' => $this->fetchStrategyMock, 'eventManager' => $this->managerInterfaceMock, 'eavConfig' => $this->configMock, 'resource' => $this->resourceMock, 'eavEntityFactory' => $this->entityFactoryMock2, 'resourceHelper' => $this->helperMock, 'universalFactory' => $this->universalFactoryMock, 'storeManager' => $this->storeManagerMock, 'catalogData' => $this->catalogHelperMock, 'catalogProductFlatState' => $this->stateMock, 'scopeConfig' => $this->scopeConfigInterfaceMock, 'productOptionFactory' => $this->optionFactoryMock, 'catalogUrl' => $this->urlMock, 'localeDate' => $this->timezoneInterfaceMock, 'customerSession' => $this->sessionMock, 'dateTime' => $this->dateTimeMock]);
 }
Exemple #29
0
 protected function setUp()
 {
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->helperMock = $this->getMockBuilder('Magento\\Framework\\View\\Layout\\ScheduledStructure\\Helper')->disableOriginalConstructor()->getMock();
     $this->readerPoolMock = $this->getMockBuilder('Magento\\Framework\\View\\Layout\\ReaderPool')->disableOriginalConstructor()->getMock();
     $this->container = $this->objectManagerHelper->getObject('Magento\\Framework\\View\\Layout\\Reader\\Container', ['helper' => $this->helperMock, 'readerPool' => $this->readerPoolMock]);
 }
Exemple #30
0
 public function testAsArrayException()
 {
     $notifierCorrect = $this->objectManagerHelper->getObject('Magento\\Framework\\Notification\\NotifierPool');
     $notifierIncorrect = $this->objectManagerHelper->getObject('Magento\\Framework\\Notification\\NotifierList');
     $notifierList = $this->objectManagerHelper->getObject('Magento\\Framework\\Notification\\NotifierList', ['objectManager' => $this->objectManager, 'notifiers' => [$notifierCorrect, $notifierIncorrect]]);
     $this->setExpectedException('InvalidArgumentException');
     $notifierList->asArray();
 }