spec\Newscoop\NewscoopBundle\Controller\TopicsControllerSpec::its_editAction_should_edit_topic PHP Метод

its_editAction_should_edit_topic() публичный Метод

public its_editAction_should_edit_topic ( $request, $repository, $topic, $csrfTokenManagerAdapter, $form, $cacheService )
    public function its_editAction_should_edit_topic($request, $repository, $topic, $csrfTokenManagerAdapter, $form, $cacheService)
    {
        $repository->findOneBy(array('id' => 1))->willReturn($topic);
        $data = array('id' => 1, 'title' => 'test');
        $form->getData()->willReturn($data);
        $csrfTokenManagerAdapter->isCsrfTokenValid('default', $this->token)->willReturn(true);
        $topicTranslation = new TopicTranslation('en', 'title', $data['title']);
        $topic->getTranslations()->willReturn(new ArrayCollection(array($topicTranslation)));
        $cacheService->clearNamespace('topic')->shouldBeCalled();
        $response = $this->editAction($request, 1);
        $response->getStatusCode()->shouldReturn(200);
        $response->shouldBeAnInstanceOf('Symfony\\Component\\HttpFoundation\\JsonResponse');
    }