objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $this->objectManager->getObject( '\Magento\SalesRule\Model\ResourceModel\Rule\DateApplier', [ ] ); } /** * test ApplyDate */ public function testApplyDate() { $className = '\Magento\Framework\DB\Select'; /** @var \Magento\Framework\DB\Select|\PHPUnit_Framework_MockObject_MockObject $select */ $select = $this->getMock($className, [], [], '', false); $select->expects($this->exactly(2)) ->method('where') ->willReturnSelf(); $now = date('Y-m-d'); $this->model->applyDate($select, $now); } }