コード例 #1
0
ファイル: RuleTest.php プロジェクト: whoople/magento2-testing
 public function testLoadCustomerGroupIds()
 {
     $customerGroupIds = [1];
     $object = $this->getMockBuilder('Magento\\Framework\\Model\\AbstractModel')->disableOriginalConstructor()->getMock();
     $object->expects($this->once())->method('getId')->willReturn(1);
     $this->adapter->expects($this->once())->method('select')->willReturn($this->select);
     $this->select->expects($this->once())->method('from')->with('salesrule_customer_group', ['customer_group_id'])->willReturnSelf();
     $this->select->expects($this->once())->method('where')->with('rule_id = ?', 1)->willReturnSelf();
     $this->adapter->expects($this->once())->method('fetchCol')->with($this->select)->willReturn($customerGroupIds);
     $object->expects($this->once())->method('setData')->with('customer_group_ids', $customerGroupIds);
     $this->model->loadCustomerGroupIds($object);
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function loadCustomerGroupIds(\Magento\Framework\Model\AbstractModel $object)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'loadCustomerGroupIds');
     if (!$pluginInfo) {
         return parent::loadCustomerGroupIds($object);
     } else {
         return $this->___callPlugins('loadCustomerGroupIds', func_get_args(), $pluginInfo);
     }
 }