public function testLoadCouponCode() { $this->coupon->expects($this->once())->method('loadPrimaryByRule')->with(1); $this->coupon->expects($this->once())->method('setRule')->with($this->model)->willReturnSelf(); $this->coupon->expects($this->once())->method('setIsPrimary')->with(true)->willReturnSelf(); $this->coupon->expects($this->once())->method('getCode')->willReturn('test_code'); $this->coupon->expects($this->once())->method('getUsageLimit')->willReturn(1); $this->model->setId(1); $this->model->setUsesPerCoupon(null); $this->model->setUseAutoGeneration(false); $this->model->loadCouponCode(); $this->assertEquals(1, $this->model->getUsesPerCoupon()); }
public function testGetActionsFieldSetId() { $formName = 'form_name'; $this->model->setId(100); $expectedResult = 'form_namerule_actions_fieldset_100'; $this->assertEquals($expectedResult, $this->model->getActionsFieldSetId($formName)); }
/** * {@inheritdoc} */ public function setId($value) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'setId'); if (!$pluginInfo) { return parent::setId($value); } else { return $this->___callPlugins('setId', func_get_args(), $pluginInfo); } }