/**
  * test load
  */
 public function testLoad()
 {
     $ruleId = 1;
     /** @var \Magento\Framework\Model\AbstractModel|\PHPUnit_Framework_MockObject_MockObject $abstractModel */
     $abstractModel = $this->getMockBuilder('Magento\\Framework\\Model\\AbstractModel')->disableOriginalConstructor()->getMockForAbstractClass();
     $this->entityManager->expects($this->once())->method('load')->with(RuleInterface::class, $abstractModel, $ruleId);
     $result = $this->model->load($abstractModel, $ruleId);
     $this->assertSame($this->model, $result);
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function load(\Magento\Framework\Model\AbstractModel $object, $value, $field = null)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'load');
     if (!$pluginInfo) {
         return parent::load($object, $value, $field);
     } else {
         return $this->___callPlugins('load', func_get_args(), $pluginInfo);
     }
 }