spec\Newscoop\GimmeBundle\Controller\ArticlesControllerSpec::its_lockUnlockArticle_should_lock_article PHP Метод

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

public its_lockUnlockArticle_should_lock_article ( $request, $article, $query, $number, $language, $user, $token, $tokenStorage, $security )
    public function its_lockUnlockArticle_should_lock_article($request, $article, $query, $number, $language, $user, $token, $tokenStorage, $security)
    {
        $query->getOneOrNullResult()->willReturn($article);
        $request->getMethod()->willReturn('POST');
        $article->isLocked()->willReturn(false);
        $user = new User('[email protected]');
        $user->setUsername('doe');
        $tokenStorage->getToken()->willReturn($token);
        $token->getUser()->willReturn($user);
        $article->setLockUser($user)->willReturn(null);
        $article->setLockTime(Argument::type('\\DateTime'))->willReturn(null);
        $response = $this->lockUnlockArticle($request, $number, $language);
        $response->shouldBeAnInstanceOf('Symfony\\Component\\HttpFoundation\\Response');
        $response->getStatusCode()->shouldReturn(200);
    }