function it_throws_exception_when_entity_doesnt_have_correct_repository(CRUDElement $element, EntityRepository $repository, DoctrineDataIndexer $indexer, \StdClass $category, Request $request)
 {
     $indexer->getData(666)->willReturn($category);
     $element->getRepository()->willReturn($repository);
     $this->shouldThrow('\\InvalidArgumentException')->duringMoveUpAction($element, 666, $request);
     $this->shouldThrow('\\InvalidArgumentException')->duringMoveDownAction($element, 666, $request);
 }
 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);
 }
 /**
  * {@inheritdoc}
  */
 public function getSuccessRouteParameters()
 {
     return $this->appendLocaleParameter(parent::getSuccessRouteParameters());
 }
 /**
  * @param CRUDElement $element
  * @param $entity
  */
 private function persistAndFlush(CRUDElement $element, $entity)
 {
     $om = $element->getObjectManager();
     $om->persist($entity);
     $om->flush();
 }
 /**
  * @param \FSi\Bundle\AdminBundle\Doctrine\Admin\CRUDElement $element
  * @param \Doctrine\Common\Persistence\ManagerRegistry $managerRegistry
  */
 function it_mount_datagrid_factory_to_elements_that_are_doctrine_elements($element, $managerRegistry)
 {
     $element->setManagerRegistry($managerRegistry)->shouldBeCalled();
     $this->mount($element);
 }