/**
  * {@inheritDoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->dateMock = $this->getMockBuilder('Magento\\Framework\\Stdlib\\DateTime\\Filter\\Date')->disableOriginalConstructor()->getMock();
     $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
     $this->exportLowstockExcel = $objectManager->getObject('Magento\\Reports\\Controller\\Adminhtml\\Report\\Product\\ExportLowstockExcel', ['context' => $this->contextMock, 'fileFactory' => $this->fileFactoryMock, 'dateFilter' => $this->dateMock]);
 }
Exemplo n.º 2
0
    /**
     * {@inheritDoc}
     */
    protected function setUp()
    {
        parent::setUp();

        $this->dateMock = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\Filter\Date')
            ->disableOriginalConstructor()
            ->getMock();

        $this->helperMock = $this->getMockBuilder('Magento\Backend\Helper\Data')
            ->disableOriginalConstructor()
            ->getMock();

        $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface')
            ->disableOriginalConstructor()
            ->getMock();
        $this->objectManagerMock
            ->expects($this->any())
            ->method('get')
            ->willReturn($this->helperMock);

        $this->contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock);

        $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
        $this->exportViewedCsv = $objectManager->getObject(
            'Magento\Reports\Controller\Adminhtml\Report\Product\ExportViewedCsv',
            [
                'context' => $this->contextMock,
                'fileFactory' => $this->fileFactoryMock,
                'dateFilter' => $this->dateMock,
            ]
        );
    }
Exemplo n.º 3
0
    /**
     * {@inheritDoc}
     */
    protected function setUp()
    {
        parent::setUp();

        $this->exportAccountsCsv = new ExportAccountsCsv(
            $this->contextMock,
            $this->fileFactoryMock
        );
    }
Exemplo n.º 4
0
    /**
     * {@inheritDoc}
     */
    protected function setUp()
    {
        parent::setUp();

        $this->orders = new Orders(
            $this->contextMock,
            $this->fileFactoryMock
        );
    }
Exemplo n.º 5
0
    /**
     * {@inheritDoc}
     */
    protected function setUp()
    {
        parent::setUp();

        $this->totals = new Totals(
            $this->contextMock,
            $this->fileFactoryMock
        );
    }
Exemplo n.º 6
0
    /**
     * {@inheritDoc}
     */
    protected function setUp()
    {
        parent::setUp();

        $this->exportOrdersExcel = new ExportOrdersExcel(
            $this->contextMock,
            $this->fileFactoryMock
        );
    }
Exemplo n.º 7
0
    /**
     * {@inheritDoc}
     */
    protected function setUp()
    {
        parent::setUp();

        $this->accounts = new Accounts(
            $this->contextMock,
            $this->fileFactoryMock
        );
    }
Exemplo n.º 8
0
 /**
  * {@inheritDoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->dateMock = $this->getMockBuilder('Magento\\Framework\\Stdlib\\DateTime\\Filter\\Date')->disableOriginalConstructor()->getMock();
     $this->helperMock = $this->getMockBuilder('Magento\\Backend\\Helper\\Data')->disableOriginalConstructor()->getMock();
     $this->objectManagerMock = $this->getMockBuilder('Magento\\Framework\\ObjectManagerInterface')->disableOriginalConstructor()->getMock();
     $this->objectManagerMock->expects($this->any())->method('get')->willReturn($this->helperMock);
     $this->contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock);
     $this->exportViewedCsv = new ExportViewedCsv($this->contextMock, $this->fileFactoryMock, $this->dateMock);
 }
Exemplo n.º 9
0
    /**
     * {@inheritDoc}
     */
    protected function setUp()
    {
        parent::setUp();

        $this->dateMock = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\Filter\Date')
            ->disableOriginalConstructor()
            ->getMock();

        $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
        $this->downloads = $objectManager->getObject('Magento\Reports\Controller\Adminhtml\Report\Product\Downloads', [
            'context' => $this->contextMock,
            'fileFactory' => $this->fileFactoryMock,
            'dateFilter' => $this->dateMock,
        ]);
    }
Exemplo n.º 10
0
 /**
  * {@inheritDoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->dateMock = $this->getMockBuilder('Magento\\Framework\\Stdlib\\DateTime\\Filter\\Date')->disableOriginalConstructor()->getMock();
     $flagMock = $this->getMockBuilder('Magento\\Reports\\Model\\Flag')->disableOriginalConstructor()->getMock();
     $flagMock->expects($this->any())->method('setReportFlagCode')->willReturnSelf();
     $flagMock->expects($this->any())->method('loadSelf')->willReturnSelf();
     $this->helperMock = $this->getMockBuilder('Magento\\Backend\\Helper\\Data')->disableOriginalConstructor()->getMock();
     $this->objectManagerMock = $this->getMockBuilder('Magento\\Framework\\ObjectManagerInterface')->disableOriginalConstructor()->getMock();
     $this->objectManagerMock->expects($this->any())->method('create')->with('Magento\\Reports\\Model\\Flag')->willReturn($flagMock);
     $this->messageManagerMock = $this->getMockBuilder('Magento\\Framework\\Message\\ManagerInterface')->disableOriginalConstructor()->getMock();
     $flagMock = $this->getMockBuilder('Magento\\Framework\\App\\ActionFlag')->disableOriginalConstructor()->getMock();
     $responseMock = $this->getMockBuilder('Magento\\Framework\\App\\ResponseInterface')->disableOriginalConstructor()->setMethods(['setRedirect', 'sendResponse'])->getMock();
     $this->contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock);
     $this->contextMock->expects($this->any())->method('getHelper')->willReturn($this->helperMock);
     $this->contextMock->expects($this->any())->method('getMessageManager')->willReturn($this->messageManagerMock);
     $this->contextMock->expects($this->any())->method('getActionFlag')->willReturn($flagMock);
     $this->contextMock->expects($this->any())->method('getResponse')->willReturn($responseMock);
     $this->viewed = new Viewed($this->contextMock, $this->fileFactoryMock, $this->dateMock);
 }
Exemplo n.º 11
0
 /**
  * {@inheritDoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->dateMock = $this->getMockBuilder('Magento\\Framework\\Stdlib\\DateTime\\Filter\\Date')->disableOriginalConstructor()->getMock();
     $this->exportSoldCsv = new ExportSoldCsv($this->contextMock, $this->fileFactoryMock, $this->dateMock);
 }
Exemplo n.º 12
0
    /**
     * {@inheritDoc}
     */
    protected function setUp()
    {
        parent::setUp();

        $this->dateMock = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\Filter\Date')
            ->disableOriginalConstructor()
            ->getMock();

        $flagMock = $this->getMockBuilder('Magento\Reports\Model\Flag')
            ->disableOriginalConstructor()
            ->getMock();
        $flagMock
            ->expects($this->any())
            ->method('setReportFlagCode')
            ->willReturnSelf();
        $flagMock
            ->expects($this->any())
            ->method('loadSelf')
            ->willReturnSelf();

        $this->helperMock = $this->getMockBuilder('Magento\Backend\Helper\Data')
            ->disableOriginalConstructor()
            ->getMock();

        $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface')
            ->disableOriginalConstructor()
            ->getMock();
        $this->objectManagerMock
            ->expects($this->any())
            ->method('create')
            ->with('Magento\Reports\Model\Flag')
            ->willReturn($flagMock);

        $this->messageManagerMock = $this->getMockBuilder('Magento\Framework\Message\ManagerInterface')
            ->disableOriginalConstructor()
            ->getMock();

        $flagMock = $this->getMockBuilder('Magento\Framework\App\ActionFlag')
            ->disableOriginalConstructor()
            ->getMock();

        $responseMock = $this->getMockBuilder('Magento\Framework\App\ResponseInterface')
            ->disableOriginalConstructor()
            ->setMethods(['setRedirect', 'sendResponse'])
            ->getMock();

        $this->contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock);
        $this->contextMock->expects($this->any())->method('getHelper')->willReturn($this->helperMock);
        $this->contextMock->expects($this->any())->method('getMessageManager')->willReturn($this->messageManagerMock);
        $this->contextMock->expects($this->any())->method('getActionFlag')->willReturn($flagMock);
        $this->contextMock->expects($this->any())->method('getResponse')->willReturn($responseMock);

        $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
        $this->viewed = $objectManager->getObject(
            'Magento\Reports\Controller\Adminhtml\Report\Product\Viewed',
            [
                'context' => $this->contextMock,
                'fileFactory' => $this->fileFactoryMock,
                'dateFilter' => $this->dateMock,
            ]
        );
    }