예제 #1
0
 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());
 }
예제 #2
0
 public function testGetActionsFieldSetId()
 {
     $formName = 'form_name';
     $this->model->setId(100);
     $expectedResult = 'form_namerule_actions_fieldset_100';
     $this->assertEquals($expectedResult, $this->model->getActionsFieldSetId($formName));
 }
예제 #3
0
 /**
  * {@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);
     }
 }