/** * @param string $entityType * @param object $entity * @return object * @throws \Exception */ public function execute($entityType, $entity) { $actions = $this->relationActionPool->getActions($entityType, 'create'); foreach ($actions as $action) { $entity = $action->execute($entityType, $entity); } return $entity; }
public function testGetActions() { $this->objectManagerMock->expects($this->once())->method('get')->with('Test_Class')->willReturn(new \stdClass()); $this->assertNotEmpty($this->model->getActions('Entity_Test', 'Test_Read')); }