/**
  * Sets the configuration for row actions
  *
  * @param DatagridConfiguration  $datagridConfig
  * @param ConfigurationInterface $customEntityConfig
  */
 protected function setRowActions(DatagridConfiguration $datagridConfig, ActionInterface $indexAction)
 {
     $name = $indexAction->getConfiguration()->getName();
     $properties = ['id' => []];
     $actions = [];
     foreach ($indexAction->getRowActions() as $rowActionType) {
         $link = $rowActionType . '_link';
         $rowAction = $this->actionFactory->getAction($name, $rowActionType);
         $actions[$rowActionType] = $rowAction->getGridActionOptions() + ['link' => $link];
         $properties[$link] = ['type' => 'custom_entity_url', 'route' => sprintf('%s/%s', $name, $rowActionType), 'params' => ['id']];
     }
     $datagridConfig->offsetSetByPath('[actions]', $actions);
     $datagridConfig->offsetSetByPath('[properties]', $properties);
 }
 public function it_configures_mass_actions(BuildBefore $event, DatagridConfiguration $datagridConfig, ActionInterface $indexAction, ActionFactory $actionFactory, ActionInterface $action1, ActionInterface $action2)
 {
     $action1->implement('Pim\\Bundle\\CustomEntityBundle\\Action\\GridActionInterface');
     $action2->implement('Pim\\Bundle\\CustomEntityBundle\\Action\\GridActionInterface');
     $actionFactory->getAction('entity', 'action1')->willReturn($action1);
     $actionFactory->getAction('entity', 'action2')->willReturn($action2);
     $action1->getGridActionOptions()->willReturn(['action1_key1' => 'action1_value1']);
     $datagridConfig->getName()->willReturn('entity');
     $indexAction->getMassActions()->willReturn(['action1', 'action2']);
     $indexAction->getRowActions()->willReturn([]);
     $indexAction->getOptions()->willReturn([]);
     $datagridConfig->offsetGetByPath('[extends]')->willReturn('custom_entity');
     $datagridConfig->offsetGetByPath('[properties]')->willReturn([]);
     $datagridConfig->offsetGetByPath('[actions]')->willReturn([]);
     $datagridConfig->offsetGetByPath('[source]')->willReturn([]);
     $datagridConfig->offsetGetByPath('[mass_actions]')->willReturn(['action2' => []]);
     $datagridConfig->offsetSetByPath("[source]", ["entity" => "entity_class", "type" => "pim_custom_entity"])->shouldBeCalled();
     $datagridConfig->offsetSetByPath("[actions]", [])->shouldBeCalled();
     $datagridConfig->offsetSetByPath("[properties]", ['id' => []])->shouldBeCalled();
     $datagridConfig->offsetSetByPath("[mass_actions]", ["action2" => [], "action1" => ["action1_key1" => "action1_value1"]])->shouldBeCalled();
     $this->buildBefore($event);
 }