function let(RouterInterface $router, CRUDElement $element, DoctrineDataIndexer $indexer, ObjectManager $om)
 {
     $element->getId()->willReturn('slides');
     $element->getDataIndexer()->willReturn($indexer);
     $element->getObjectManager()->willReturn($om);
     $element->getRoute()->willReturn('fsi_admin_crud_list');
     $element->getRouteParameters()->willReturn(array('element' => 'slides'));
     $this->beConstructedWith($router);
 }
 function let(Router $router, CRUDElement $element, DoctrineDataIndexer $indexer, ObjectManager $om, NestedTreeRepository $repository, Request $request, ParameterBag $query)
 {
     $request->query = $query;
     $element->getId()->willReturn('category');
     $element->getDataIndexer()->willReturn($indexer);
     $element->getObjectManager()->willReturn($om);
     $element->getRepository()->willReturn($repository);
     $element->getRoute()->willReturn('fsi_admin_crud_list');
     $element->getRouteParameters()->willReturn(['element' => 'category']);
     $this->beConstructedWith($router);
 }
 /**
  * @param CRUDElement $element
  * @param $entity
  */
 private function persistAndFlush(CRUDElement $element, $entity)
 {
     $om = $element->getObjectManager();
     $om->persist($entity);
     $om->flush();
 }