function it_increase_position_when_increase_position_action_called(CRUDElement $element, DoctrineDataIndexer $indexer, PositionableInterface $positionableEntity, ObjectManager $om, RouterInterface $router) { $indexer->getData(1)->willReturn($positionableEntity); $positionableEntity->increasePosition()->shouldBeCalled(); $om->persist($positionableEntity)->shouldBeCalled(); $om->flush()->shouldBeCalled(); $router->generate('fsi_admin_crud_list', array('element' => 'slides'))->willReturn('sample-path'); $response = $this->increasePositionAction($element, 1); $response->shouldHaveType('Symfony\\Component\\HttpFoundation\\RedirectResponse'); $response->getTargetUrl()->shouldReturn('sample-path'); }
function it_redirects_to_redirect_uri_parameter_after_operation(CRUDElement $element, DoctrineDataIndexer $indexer, \StdClass $category, Request $request, ParameterBag $query) { $query->get('redirect_uri')->willReturn('some_redirect_uri'); $indexer->getData(1)->willReturn($category); $response = $this->moveUpAction($element, 1, $request); $response->shouldHaveType('Symfony\\Component\\HttpFoundation\\RedirectResponse'); $response->getTargetUrl()->shouldReturn('some_redirect_uri'); $response = $this->moveDownAction($element, 1, $request); $response->shouldHaveType('Symfony\\Component\\HttpFoundation\\RedirectResponse'); $response->getTargetUrl()->shouldReturn('some_redirect_uri'); }
/** * @expectedException \FSi\Component\DataIndexer\Exception\RuntimeException */ public function testGetDataWithCompositeKeyAndSeparatorInID() { $class = "FSi\\Component\\DataIndexer\\Tests\\Fixtures\\Post"; $dataIndexer = new DoctrineDataIndexer($this->getManagerRegistry(), $class); $dataIndexer->getData("foo||bar"); }