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)); }
/** * @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)); }