Example #1
0
    /**
     * @param int $isFilter
     * @param string $useAggregatedData
     * @param string $mainTable
     * @dataProvider salesDataProvider
     * @return void
     */
    public function testCalculateSales($isFilter, $useAggregatedData, $mainTable)
    {
        $this->scopeConfigMock
            ->expects($this->once())
            ->method('getValue')
            ->with(
                'sales/dashboard/use_aggregated_data',
                \Magento\Store\Model\ScopeInterface::SCOPE_STORE
            )
            ->willReturn($useAggregatedData);

        $storeMock = $this->getMockBuilder('Magento\Store\Model\Store')
            ->disableOriginalConstructor()
            ->getMock();

        $this->storeManagerMock
            ->expects($this->any())
            ->method('getStore')
            ->willReturn($storeMock);

        $this->resourceMock
            ->expects($this->at(0))
            ->method('getTable')
            ->with($mainTable);

        $this->collection->calculateSales($isFilter);
    }