spec\Newscoop\GimmeBundle\Controller\ArticlesControllerSpec::it_should_create_new_article PHP Method

it_should_create_new_article() public method

public it_should_create_new_article ( $request, $user, $form, $languageRepository, $language, $articleTypeRepository, $articleType, $publicationRepository, $publication, $issueRepository, $issue, $sectionRepository, $section, $author, $authorTypeRepository, $authorType, $articleService, $article )
    public function it_should_create_new_article($request, $user, $form, $languageRepository, $language, $articleTypeRepository, $articleType, $publicationRepository, $publication, $issueRepository, $issue, $sectionRepository, $section, $author, $authorTypeRepository, $authorType, $articleService, $article)
    {
        $user->hasPermission('AddArticle')->willReturn(true);
        $user->getAuthor()->willReturn($author);
        $form->getData()->willReturn(array('language' => 1, 'type' => 'news', 'publication' => 1, 'issue' => null, 'section' => null));
        $languageRepository->findOneBy(Argument::any())->willReturn($language);
        $articleTypeRepository->findOneBy(Argument::any())->willReturn($articleType);
        $publicationRepository->findOneBy(Argument::any())->willReturn($publication);
        $issueRepository->findOneBy(Argument::any())->willReturn($issue);
        $sectionRepository->findOneBy(Argument::any())->willReturn($section);
        $authorTypeRepository->findOneBy(Argument::any())->willReturn($authorType);
        $articleService->createArticle(Argument::cetera())->willReturn($article);
        $this->createArticleAction($request);
    }