33 $this->collectionFactory = $this->createPartialMock(
38 $this->objectManagerHelper =
new ObjectManagerHelper($this);
39 $this->discounts = $this->objectManagerHelper->getObject(
40 \
Magento\SalesRule\Model\Rss\Discounts::class,
42 'collectionFactory' => $this->collectionFactory
49 $ruleCollection = $this->createPartialMock(\
Magento\SalesRule\Model\
ResourceModel\Rule\Collection::class, [
50 'addWebsiteGroupDateFilter',
55 $this->collectionFactory->expects($this->once())->method(
'create')->will($this->returnValue($ruleCollection));
56 $ruleCollection->expects($this->once())->method(
'addWebsiteGroupDateFilter')->will($this->returnSelf());
57 $ruleCollection->expects($this->once())->method(
'addFieldToFilter')->will($this->returnSelf());
58 $ruleCollection->expects($this->once())->method(
'setOrder')->will($this->returnSelf());
59 $ruleCollection->expects($this->once())->method(
'load')->will($this->returnSelf());
60 $this->assertEquals($ruleCollection, $this->discounts->getDiscountCollection(1, 1));