public function testGetWriteOperation()
 {
     $entityType = 'test_write_entity_type';
     $operationName = 'write';
     $this->objectManagerMock->expects($this->once())->method('get')->with('WriteOperation')->willReturn($this->writeOperationMock);
     $this->assertEquals($this->writeOperationMock, $this->model->getWriteOperation($entityType, $operationName));
 }
 public function testGetReadOperation()
 {
     $entityType = 'test_read_entity_type';
     $operationName = 'read';
     $this->assertInstanceOf('Magento\\Framework\\Model\\Operation\\WriteInterface', $this->model->getWriteOperation($entityType, $operationName));
 }
Exemple #3
0
 /**
  * @param string $entityType
  * @param object $entity
  * @return bool|object
  * @throws \Exception
  */
 public function delete($entityType, $entity)
 {
     $operation = $this->orchestratorPool->getWriteOperation($entityType, 'delete');
     return $operation->execute($entityType, $entity);
 }