Example #1
0
 protected function setUp()
 {
     $this->rule = $this->getMock('Magento\\Framework\\Object', null, array(), 'Rule', true);
     $this->item = $this->getMock('Magento\\Sales\\Model\\Quote\\Item\\AbstractItem', array(), array(), '', false);
     $this->data = $this->getMock('Magento\\SalesRule\\Model\\Rule\\Action\\Discount\\Data', null);
     $this->quote = $this->getMock('Magento\\Sales\\Model\\Quote', array(), array(), '', false);
     $this->address = $this->getMock('Magento\\Sales\\Model\\Quote\\Address', array('getCartFixedRules', 'setCartFixedRules', '__wakeup'), array(), '', false);
     $this->item->expects($this->any())->method('getQuote')->will($this->returnValue($this->quote));
     $this->item->expects($this->any())->method('getAddress')->will($this->returnValue($this->address));
     $this->validator = $this->getMock('Magento\\SalesRule\\Model\\Validator', array(), array(), '', false);
     $dataFactory = $this->getMock('Magento\\SalesRule\\Model\\Rule\\Action\\Discount\\DataFactory', array('create'), array(), '', false);
     $dataFactory->expects($this->any())->method('create')->will($this->returnValue($this->data));
     $this->model = new CartFixed($this->validator, $dataFactory);
 }