Exemplo n.º 1
0
 public function testGetReadOperation()
 {
     $entityType = 'test_read_entity_type';
     $operationName = 'read';
     $this->assertInstanceOf('Magento\\Framework\\Model\\Operation\\WriteInterface', $this->model->getWriteOperation($entityType, $operationName));
 }
 public function testGetReadOperation()
 {
     $entityType = 'test_read_entity_type';
     $this->objectManagerMock->expects($this->once())->method('get')->with('ReadOperation')->willReturn($this->readOperationMock);
     $this->assertEquals($this->readOperationMock, $this->model->getReadOperation($entityType));
 }
Exemplo n.º 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);
 }
 public function testDelete()
 {
     $this->orchestratorPool->expects($this->once())->method('getWriteOperation')->with('Test\\Entity\\Type', 'delete')->willReturn($this->writeOperation);
     $this->writeOperation->expects($this->once())->method('execute')->with('Test\\Entity\\Type', $this->abstractEntity)->willReturn(true);
     $this->assertTrue($this->subject->delete('Test\\Entity\\Type', $this->abstractEntity));
 }