spec\Newscoop\GimmeBundle\Controller\UserTopicsControllerSpec::its_getUserTopicsAction_should_return_list_of_topics_followed_by_user PHP Метод

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

public its_getUserTopicsAction_should_return_list_of_topics_followed_by_user ( $request, $repository, $user, $userTopicService, $paginator, Symfony\Component\HttpFoundation\ParameterBag $parameterBag, $knpPaginator )
$parameterBag Symfony\Component\HttpFoundation\ParameterBag
    public function its_getUserTopicsAction_should_return_list_of_topics_followed_by_user($request, $repository, $user, $userTopicService, $paginator, ParameterBag $parameterBag, $knpPaginator)
    {
        $userId = 1;
        $topic = new Topic();
        $topic->setId(10);
        $topic->setTitle('test');
        $topic->setParent(null);
        $repository->findOneBy(array('id' => $userId))->shouldBeCalled()->willReturn($user);
        $topics = array($topic);
        $userTopics = array('items' => $topics);
        $parameterBag->get("language", null)->willReturn(null);
        $request->query = $parameterBag;
        $userTopicService->getTopics($user, null)->shouldBeCalled()->willReturn($topics);
        $paginator->setUsedRouteParams(array("id" => $userId, "language" => null))->willReturn($knpPaginator);
        $paginator->paginate($topics, array('distinct' => false))->willReturn($userTopics);
        $this->getUserTopicsAction($request, $userId)->shouldReturn($userTopics);
    }